Code scrub DxeIpl, Runtime, DevicePath, FvbServicesLib, DiskIo, Partition, English, EBC.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7105 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8
2008-12-23 16:20:43 +00:00
parent a387653db2
commit 48557c6550
38 changed files with 315 additions and 377 deletions

View File

@@ -46,8 +46,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_GUID mEfiDevicePathMessagingSASGuid
/**
The user Entry Point for DevicePath module.
This is the entrhy point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
optionall the Device Path to Text and Device Path from Text protocols based on feature flags.
This is the entry point for DevicePath module. It installs the UEFI Device Path Utility Protocol and
optionally the Device Path to Text and Device Path from Text protocols based on feature flags.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.

View File

@@ -31,14 +31,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DevicePathLib.h>
#include <Library/PcdLib.h>
extern const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid;
extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
#define MAX_CHAR 480
#define MIN_ALIGNMENT_SIZE sizeof(UINTN)
#define ALIGN_SIZE(a) ((a % MIN_ALIGNMENT_SIZE) ? MIN_ALIGNMENT_SIZE - (a % MIN_ALIGNMENT_SIZE) : 0)
#define IS_COMMA(a) ((a) == L',')
#define IS_HYPHEN(a) ((a) == L'-')
#define IS_DOT(a) ((a) == L'.')
@@ -47,11 +42,8 @@ extern const EFI_GUID mEfiDevicePathMessagingSASGuid;
#define IS_SLASH(a) ((a) == L'/')
#define IS_NULL(a) ((a) == L'\0')
#define DEVICE_NODE_END 1
#define DEVICE_PATH_INSTANCE_END 2
#define DEVICE_PATH_END 3
#define SET_DEVICE_PATH_INSTANCE_END_NODE(a) { \
#define SET_DEVICE_PATH_INSTANCE_END_NODE(a) { \
(a)->Type = END_DEVICE_PATH_TYPE; \
(a)->SubType = END_INSTANCE_DEVICE_PATH_SUBTYPE; \
(a)->Length[0] = sizeof (EFI_DEVICE_PATH_PROTOCOL); \

View File

@@ -1,9 +1,10 @@
#/** @file
# Device path driver that produces three UEFI device path protocols.
#
# Component description file for Device Path Driver.
#
# This driver implement these three UEFI deveice path protocols (
# DevicePathUtilities, DevicePahtToText and DevicePathFromText) and install them.
# This driver produces Device Path Utilities protocol and optionally
# DevicePahtToText and DevicePathFromText protocols based on feature flags
# PcdDevicePathSupportDevicePathToText & PcdDevicePathSupportDevicePathFromText
# respectively.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -57,7 +58,9 @@
gEfiVT100Guid # ALWAYS_CONSUMED
gEfiVT100PlusGuid # ALWAYS_CONSUMED
gEfiPcAnsiGuid # ALWAYS_CONSUMED
gEfiUartDevicePathGuid # ALWAYS_CONSUMED
gEfiSasDevicePathGuid # ALWAYS_CONSUMED
[Protocols]
gEfiDevicePathToTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiDevicePathFromTextProtocolGuid # PROTOCOL ALWAYS_PRODUCED
@@ -70,4 +73,3 @@
[Depex]
TRUE

View File

@@ -1504,7 +1504,7 @@ DevPathFromTextUartFlowCtrl (
sizeof (UART_FLOW_CONTROL_DEVICE_PATH)
);
CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid);
CopyGuid (&UartFlowControl->Guid, &gEfiUartDevicePathGuid);
if (StrCmp (ValueStr, L"XonXoff") == 0) {
UartFlowControl->FlowControlMap = 2;
} else if (StrCmp (ValueStr, L"Hardware") == 0) {
@@ -1555,7 +1555,7 @@ DevPathFromTextSAS (
sizeof (SAS_DEVICE_PATH)
);
CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid);
CopyGuid (&Sas->Guid, &gEfiSasDevicePathGuid);
Strtoi64 (AddressStr, &Sas->SasAddress);
Strtoi64 (LunStr, &Sas->Lun);
Sas->RelativeTargetPort = (UINT16) Strtoi (RTPStr);

View File

@@ -55,10 +55,10 @@ CatPrint (
Size = StrSize (AppendStr) - sizeof (UINT16);
Size = Size + StrSize (Str->Str);
Str->Str = ReallocatePool (
StrSize (Str->Str),
Size,
Str->Str
);
StrSize (Str->Str),
Size,
Str->Str
);
ASSERT (Str->Str != NULL);
}
@@ -73,9 +73,9 @@ CatPrint (
}
/**
Converts a PCI device path structure to its string representive.
Converts a PCI device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -100,9 +100,9 @@ DevPathToTextPci (
}
/**
Converts a PC Card device path structure to its string representive.
Converts a PC Card device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -127,9 +127,9 @@ DevPathToTextPccard (
}
/**
Converts a Memory Map device path structure to its string representive.
Converts a Memory Map device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -160,9 +160,9 @@ DevPathToTextMemMap (
}
/**
Converts a Vendor device path structure to its string representive.
Converts a Vendor device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -208,7 +208,7 @@ DevPathToTextVendor (
} else if (CompareGuid (&Vendor->Guid, &gEfiVTUTF8Guid)) {
CatPrint (Str, L"VenUft8()");
return ;
} else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingUartFlowControlGuid)) {
} else if (CompareGuid (&Vendor->Guid, &gEfiUartDevicePathGuid)) {
FlowControlMap = (((UART_FLOW_CONTROL_DEVICE_PATH *) Vendor)->FlowControlMap);
switch (FlowControlMap & 0x00000003) {
case 0:
@@ -228,7 +228,7 @@ DevPathToTextVendor (
}
return ;
} else if (CompareGuid (&Vendor->Guid, &mEfiDevicePathMessagingSASGuid)) {
} else if (CompareGuid (&Vendor->Guid, &gEfiSasDevicePathGuid)) {
CatPrint (
Str,
L"SAS(0x%lx,0x%lx,0x%x,",
@@ -287,9 +287,9 @@ DevPathToTextVendor (
}
/**
Converts a Controller device path structure to its string representive.
Converts a Controller device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -318,9 +318,9 @@ DevPathToTextController (
}
/**
Converts a ACPI device path structure to its string representive.
Converts a ACPI device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -404,9 +404,9 @@ EisaIdToText (
}
/**
Converts a ACPI extended HID device path structure to its string representive.
Converts a ACPI extended HID device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -488,9 +488,9 @@ DevPathToTextAcpiEx (
}
/**
Converts a ACPI address device path structure to its string representive.
Converts a ACPI address device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -525,9 +525,9 @@ DevPathToTextAcpiAdr (
}
/**
Converts a ATAPI device path structure to its string representive.
Converts a ATAPI device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -563,9 +563,9 @@ DevPathToTextAtapi (
}
/**
Converts a SCSI device path structure to its string representive.
Converts a SCSI device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -590,9 +590,9 @@ DevPathToTextScsi (
}
/**
Converts a Fibre device path structure to its string representive.
Converts a Fibre device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -617,9 +617,9 @@ DevPathToTextFibre (
}
/**
Converts a 1394 device path structure to its string representive.
Converts a 1394 device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -647,9 +647,9 @@ DevPathToText1394 (
}
/**
Converts a USB device path structure to its string representive.
Converts a USB device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -674,9 +674,9 @@ DevPathToTextUsb (
}
/**
Converts a USB WWID device path structure to its string representive.
Converts a USB WWID device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -723,9 +723,9 @@ DevPathToTextUsbWWID (
}
/**
Converts a Logic Unit device path structure to its string representive.
Converts a Logic Unit device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -750,9 +750,9 @@ DevPathToTextLogicalUnit (
}
/**
Converts a USB class device path structure to its string representive.
Converts a USB class device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -886,9 +886,9 @@ DevPathToTextUsbClass (
}
/**
Converts a SATA device path structure to its string representive.
Converts a SATA device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -919,9 +919,9 @@ DevPathToTextSata (
}
/**
Converts a I20 device path structure to its string representive.
Converts a I20 device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -946,9 +946,9 @@ DevPathToTextI2O (
}
/**
Converts a MAC address device path structure to its string representive.
Converts a MAC address device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -987,9 +987,9 @@ DevPathToTextMacAddr (
}
/**
Converts a IPv4 device path structure to its string representive.
Converts a IPv4 device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1039,9 +1039,9 @@ DevPathToTextIPv4 (
}
/**
Converts a IPv6 device path structure to its string representive.
Converts a IPv6 device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1127,9 +1127,9 @@ DevPathToTextIPv6 (
}
/**
Converts an Infini Band device path structure to its string representive.
Converts an Infini Band device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1162,9 +1162,9 @@ DevPathToTextInfiniBand (
}
/**
Converts a UART device path structure to its string representive.
Converts a UART device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1254,9 +1254,9 @@ DevPathToTextUart (
}
/**
Converts an iSCSI device path structure to its string representive.
Converts an iSCSI device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1302,9 +1302,9 @@ DevPathToTextiSCSI (
}
/**
Converts a Hard drive device path structure to its string representive.
Converts a Hard drive device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1360,9 +1360,9 @@ DevPathToTextHardDrive (
}
/**
Converts a CDROM device path structure to its string representive.
Converts a CDROM device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1392,9 +1392,9 @@ DevPathToTextCDROM (
}
/**
Converts a File device path structure to its string representive.
Converts a File device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1419,9 +1419,9 @@ DevPathToTextFilePath (
}
/**
Converts a Media protocol device path structure to its string representive.
Converts a Media protocol device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1446,9 +1446,9 @@ DevPathToTextMediaProtocol (
}
/**
Converts a Firmware Volume device path structure to its string representive.
Converts a Firmware Volume device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1473,9 +1473,9 @@ DevPathToTextFv (
}
/**
Converts a Firmware Volume File device path structure to its string representive.
Converts a Firmware Volume File device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1500,9 +1500,9 @@ DevPathToTextFvFile (
}
/**
Converts a BIOS Boot Specification device path structure to its string representive.
Converts a BIOS Boot Specification device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1569,9 +1569,9 @@ DevPathToTextBBS (
}
/**
Converts an End-of-Device-Path structure to its string representive.
Converts an End-of-Device-Path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly
@@ -1593,9 +1593,9 @@ DevPathToTextEndInstance (
}
/**
Converts an unknown device path structure to its string representive.
Converts an unknown device path structure to its string representative.
@param Str The string representive of input device.
@param Str The string representative of input device.
@param DevPath The input device path structure.
@param DisplayOnly If DisplayOnly is TRUE, then the shorter text representation
of the display node is used, where applicable. If DisplayOnly

View File

@@ -231,7 +231,6 @@ DiskIoDriverBindingStop (
&Private->DiskIo
);
if (!EFI_ERROR (Status)) {
Status = gBS->CloseProtocol (
ControllerHandle,
&gEfiBlockIoProtocolGuid,

View File

@@ -29,9 +29,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/UefiBootServicesTableLib.h>
#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
#define DATA_BUFFER_BLOCK_NUM 64
#define DATA_BUFFER_BLOCK_NUM (64)
#define DISK_IO_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('d', 's', 'k', 'I')
typedef struct {
UINTN Signature;

View File

@@ -1,7 +1,12 @@
#/** @file
#
# This module lays DiskIo protocol on every blockIo protocol
# to provide byte-oriented access to block media.
# Module that lays Disk I/O protocol on every Block I/O protocol.
#
# This module produces Disk I/O protocol to abstract the block accesses
# of the Block I/O protocol to a more general offset-length protocol
# to provide byte-oriented access to block media. It adds this protocol
# to any Block I/O interface that appears in the system that does not
# already have a Disk I/O protocol. File systems and other disk access
# code utilize the Disk I/O protocol.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials

View File

@@ -6,7 +6,7 @@
code that is not run on an EFI system. The legacy code reads the
first sector of the active partition into memory and
BPB - Boot(?) Parameter Block is in the first sector of a FAT file system.
BPB - BIOS Parameter Block is in the first sector of a FAT file system.
The BPB contains information about the FAT file system. The BPB is
always on the first sector of a media. The first sector also contains
the legacy boot strap code.
@@ -212,7 +212,7 @@ PartitionInstallMbrChildHandles (
HdDev.PartitionNumber = PartitionNumber ++;
HdDev.PartitionStart = UNPACK_UINT32 (Mbr->Partition[Index].StartingLBA);
HdDev.PartitionSize = UNPACK_UINT32 (Mbr->Partition[Index].SizeInLBA);
CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (UINT32));
CopyMem (HdDev.Signature, &(Mbr->UniqueMbrSignature[0]), sizeof (Mbr->UniqueMbrSignature));
Status = PartitionInstallChildHandle (
This,

View File

@@ -31,7 +31,7 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {
};
//
// Priortized function list to detect partition table.
// Prioritized function list to detect partition table.
//
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
PartitionInstallGptChildHandles,
@@ -278,7 +278,7 @@ PartitionDriverBindingStart (
/**
Stop this driver on ControllerHandle. Support stoping any child handles
Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.

View File

@@ -143,7 +143,7 @@ PartitionDriverBindingStart (
);
/**
Stop this driver on ControllerHandle. Support stoping any child handles
Stop this driver on ControllerHandle. Support stopping any child handles
created by this driver.
@param This Protocol instance pointer.

View File

@@ -1,11 +1,11 @@
#/** @file
#
# Component description file for Partition module.
#
# Partition driver produces the logical BlockIo device
# that represents the bytes Start to End of the Parent Block IO
# device (one partition of physical BlockIo device,
# which can be one of GPT, MBR, ElTorito partition).
# Modules that produces the logic Block I/O protocol for every partition
# it discovers via the physical Block I/O.
#
# This module produces the logical Block I/O device that represents
# the bytes from Start to End of the Parent Block I/O device.
# The partition of physical BlockIo device supported is one of legacy MBR, GPT,
# and "El Torito" partitions.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
@@ -31,9 +31,9 @@
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
# DRIVER_BINDING = gPartitionDriverBinding
# COMPONENT_NAME = gPartitionComponentName
# COMPONENT_NAME2 = gPartitionComponentName2
# DRIVER_BINDING = gPartitionDriverBinding
# COMPONENT_NAME = gPartitionComponentName
# COMPONENT_NAME2 = gPartitionComponentName2
#
[Sources.common]
@@ -68,7 +68,7 @@
[Protocols]
gEfiBlockIoProtocolGuid # PROTOCOL BY_START
gEfiDevicePathProtocolGuid # PROTOCOL BY_START
gEfiDiskIoProtocolGuid # PROTOCOL BY_START
gEfiBlockIoProtocolGuid # PROTOCOL TO_START
gEfiDevicePathProtocolGuid # PROTOCOL TO_START
gEfiDiskIoProtocolGuid # PROTOCOL TO_START
gEfiBlockIoProtocolGuid # PROTOCOL TO_START

View File

@@ -1,8 +1,11 @@
#/** @file
# English module that provides Unicode Collation supports.
#
# Component description file for English module for unicode collation.
#
# This driver installs UEFI EFI_UNICODE_COLLATION_PROTOCOL protocol to provide Unicode strings function.
# This driver installs Unicode ISO 639-2 Collation and
# RFC 4646 Unicode Collation 2 protocols based on feature flags
# PcdUnicodeCollationSupport & PcdUnicodeCollation2Support respectively.
# It allows code running in the boot services environment to perform lexical
# comparison functions on Unicode strings for English languages.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials

View File

@@ -15,9 +15,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "UnicodeCollationEng.h"
CHAR8 mEngUpperMap[0x100];
CHAR8 mEngLowerMap[0x100];
CHAR8 mEngInfoMap[0x100];
CHAR8 mEngUpperMap[MAP_TABLE_SIZE];
CHAR8 mEngLowerMap[MAP_TABLE_SIZE];
CHAR8 mEngInfoMap[MAP_TABLE_SIZE];
CHAR8 mOtherChars[] = {
'0',
@@ -106,7 +106,7 @@ InitializeUnicodeCollationEng (
//
// Initialize mapping tables for the supported languages
//
for (Index = 0; Index < 0x100; Index++) {
for (Index = 0; Index < MAP_TABLE_SIZE; Index++) {
mEngUpperMap[Index] = (CHAR8) Index;
mEngLowerMap[Index] = (CHAR8) Index;
mEngInfoMap[Index] = 0;
@@ -453,9 +453,9 @@ EngStrToFat (
if (*String != '.' && *String != ' ') {
//
// If this is a valid fat char, move it.
// Otherwise, move a '_' and flag the fact that the name needs an Lfn
// Otherwise, move a '_' and flag the fact that the name needs a long file name.
//
if (*String < 0x100 && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
if (*String < MAP_TABLE_SIZE && ((mEngInfoMap[*String] & CHAR_FAT_VALID) != 0)) {
*Fat = mEngUpperMap[*String];
} else {
*Fat = '_';

View File

@@ -19,7 +19,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Uefi.h>
#include <Protocol/UnicodeCollation.h>
#include <Library/DebugLib.h>
@@ -28,12 +27,24 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/PcdLib.h>
//
// Defines
// Bit mask to indicate the validity of character in FAT file name.
//
#define CHAR_FAT_VALID 0x01
#define TO_UPPER(a) (CHAR16) (a <= 0xFF ? mEngUpperMap[a] : a)
#define TO_LOWER(a) (CHAR16) (a <= 0xFF ? mEngLowerMap[a] : a)
//
// Maximum FAT table size.
//
#define MAP_TABLE_SIZE 0x100
//
// Macro to map character a to upper case.
//
#define TO_UPPER(a) (CHAR16) ((a) <= 0xFF ? mEngUpperMap[a] : (a))
//
// Macro to map character a to lower case.
//
#define TO_LOWER(a) (CHAR16) ((a) <= 0xFF ? mEngLowerMap[a] : (a))
//
// Prototypes

View File

@@ -1,8 +1,10 @@
#/** @file
# Module that produces EBC Interprete and EBC Debug Support protocols.
#
# This module for the EBC virtual machine implementation produces
# EBC and EBC debug support protocols.
#
# This module implements EFI Byte Code (EBC) Virtual Machine that can provide
# platformand processor-independent mechanisms for loading and executing EFI
# device drivers.
#
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
# All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License

View File

@@ -108,7 +108,7 @@ VmReadIndex64 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 8-bit value from the memory adress.
@return The 8-bit value from the memory address.
**/
UINT8
@@ -123,7 +123,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 16-bit value from the memory adress.
@return The 16-bit value from the memory address.
**/
UINT16
@@ -138,7 +138,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 32-bit value from the memory adress.
@return The 32-bit value from the memory address.
**/
UINT32
@@ -153,7 +153,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 64-bit value from the memory adress.
@return The 64-bit value from the memory address.
**/
UINT64
@@ -193,7 +193,7 @@ VmReadMemN (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -223,7 +223,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -253,7 +253,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -268,7 +268,7 @@ VmWriteMem32 (
);
/**
Reads 16-bit unsinged data from the code stream.
Reads 16-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -286,7 +286,7 @@ VmReadCode16 (
);
/**
Reads 32-bit unsinged data from the code stream.
Reads 32-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -304,7 +304,7 @@ VmReadCode32 (
);
/**
Reads 64-bit unsinged data from the code stream.
Reads 64-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -4599,7 +4599,7 @@ VmReadIndex64 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4637,7 +4637,7 @@ VmWriteMem8 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4700,7 +4700,7 @@ VmWriteMem16 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4763,7 +4763,7 @@ VmWriteMem32 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -4828,7 +4828,7 @@ VmWriteMem64 (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -5019,7 +5019,7 @@ VmReadImmed64 (
/**
Reads 16-bit unsinged data from the code stream.
Reads 16-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5059,7 +5059,7 @@ VmReadCode16 (
/**
Reads 32-bit unsinged data from the code stream.
Reads 32-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5093,7 +5093,7 @@ VmReadCode32 (
/**
Reads 64-bit unsinged data from the code stream.
Reads 64-bit unsigned data from the code stream.
This routine provides the ability to read raw unsigned data from the code
stream.
@@ -5139,7 +5139,7 @@ VmReadCode64 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 8-bit value from the memory adress.
@return The 8-bit value from the memory address.
**/
UINT8
@@ -5164,7 +5164,7 @@ VmReadMem8 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 16-bit value from the memory adress.
@return The 16-bit value from the memory address.
**/
UINT16
@@ -5195,7 +5195,7 @@ VmReadMem16 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 32-bit value from the memory adress.
@return The 32-bit value from the memory address.
**/
UINT32
@@ -5230,7 +5230,7 @@ VmReadMem32 (
@param VmPtr A pointer to VM context.
@param Addr The memory address.
@return The 64-bit value from the memory adress.
@return The 64-bit value from the memory address.
**/
UINT64

View File

@@ -270,7 +270,7 @@ GetVmVersion (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.
@@ -300,7 +300,7 @@ VmWriteMemN (
VM stack) to point into the EBC entry point arguments.
@param VmPtr A pointer to a VM context.
@param Addr Adddress to write to.
@param Addr Address to write to.
@param Data Value to write to Addr.
@retval EFI_SUCCESS The instruction is executed successfully.

View File

@@ -36,7 +36,7 @@ typedef UINT32 EXCEPTION_FLAGS;
typedef struct {
VM_REGISTER R[8]; // General purpose registers.
UINT64 Flags; // Flags register:
// 0 Set to 1 if the result of the last compare was true
// 0 Set to 1 if the result of the last compare was true
// 1 Set to 1 if stepping
// 2..63 Reserved.
VMIP Ip; // Instruction pointer.
@@ -106,7 +106,7 @@ EbcCreateThunks (
/**
Add a thunk to our list of thunks for a given image handle.
Also flush the instruction cache since we've written thunk code
Also flush the instruction cache since we have written thunk code
to memory that will be executed eventually.
@param ImageHandle The image handle to which the thunk is tied.
@@ -249,7 +249,7 @@ EbcLLGetReturnValue (
);
/**
Returns the stack index and buffer assosicated with the Handle parameter.
Returns the stack index and buffer associated with the Handle parameter.
@param Handle The EFI handle as the index to the EBC stack.
@param StackBuffer A pointer to hold the returned stack buffer.