From 511710d68f477e0210ae1830769e5d0cde4ea36a Mon Sep 17 00:00:00 2001 From: cwu11 Date: Fri, 3 Nov 2006 02:47:43 +0000 Subject: [PATCH] =?utf8?q?1.=09Add=20the=20fix=20for=20the=20following=20B?= =?utf8?q?ugs:=20i)=09BMM=5FFAKE=5FNV=5FDATA=20definition=20inconsistent?= =?utf8?q?=20in=20bm.vfr=20and=20BootMain.h=20=20=20=20=20=20=20=20=20(Edk?= =?utf8?q?Nt32Pkg\Dxe\PlatformBdsDxe\Generic\BootMaint\BootMain.h)=20ii)?= =?utf8?q?=09Change=20some=20files=E2=80=99=20EOL(end=20of=20line)=20forma?= =?utf8?q?t=20to=20DOS.=20Some=20file=20use=20even=20mixed=20style=20EOL.?= =?utf8?q?=20=20=20=20(EdkModulePkg\Universal\DevicePath\Dxe\DevicePath.c,?= =?utf8?q?=20DevicepathFromText.c,=20DevicePathUtilities.c;=20EdkModulePkg?= =?utf8?q?\Universal\Disk\DiskIo\Dxe\diskIo.c;=20MdePkg\Library\UefiLib\Ue?= =?utf8?q?fiNotTiano.c)=20iii)=20=20=20=20Change=20some=20illegal=20charac?= =?utf8?q?ters=20in=20many=20files,=20the=20problem=20is=20mainly=20connec?= =?utf8?q?ted=20with=20people=20using=20Chinese=20Input=20method=20to=20in?= =?utf8?q?put=20symbols=20such=20as=20'=20"=20-=20=3F,=20etc.=20Multiple?= =?utf8?q?=20files=20are=20influenced.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1890 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Core/Dxe/DxeMain.h | 10 +- EdkModulePkg/Core/Dxe/Hand/handle.c | 2 +- EdkModulePkg/Core/Dxe/Image/Image.c | 6 +- EdkModulePkg/Core/Pei/Memory/MemoryServices.c | 2 +- .../Include/Library/OemHookStatusCodeLib.h | 4 +- .../EdkDxeDebugLibReportStatusCode/DebugLib.c | 2 +- .../OemHookStatusCodeLibNull.c | 4 +- .../Library/EdkUefiDebugLibConOut/DebugLib.c | 2 +- .../Library/EdkUefiDebugLibStdErr/DebugLib.c | 2 +- .../EdkUefiRuntimeLib/Common/RuntimeService.c | 8 +- .../EdkUefiRuntimeLib/Ipf/RuntimeService.c | 8 +- .../Universal/DevicePath/Dxe/DevicePath.c | 178 +- .../DevicePath/Dxe/DevicePathFromText.c | 4754 ++++++++--------- .../DevicePath/Dxe/DevicePathUtilities.c | 422 +- .../Universal/Disk/DiskIo/Dxe/diskio.c | 1562 +++--- .../Dxe/Common/DxeStatusCodeCommon.c | 6 +- .../StatusCode/Dxe/DataHubStatusCodeWorker.c | 4 +- .../Universal/StatusCode/Dxe/DxeStatusCode.h | 12 +- .../StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c | 2 +- .../StatusCode/Dxe/RtMemoryStatusCodeWorker.c | 4 +- .../StatusCode/Dxe/SerialStatusCodeWorker.c | 4 +- .../StatusCode/Pei/MemoryStausCodeWorker.c | 4 +- .../Universal/StatusCode/Pei/PeiStatusCode.c | 4 +- .../Universal/StatusCode/Pei/PeiStatusCode.h | 8 +- .../StatusCode/Pei/SerialStatusCodeWorker.c | 4 +- .../UserInterface/HiiDataBase/Dxe/Forms.c | 4 +- .../PlatformBds/Generic/BootMaint/BootMaint.h | 4 +- .../Nt32OemHookStatusCodeLib.c | 4 +- MdePkg/Include/Library/BaseMemoryLib.h | 14 +- MdePkg/Include/Library/MemoryAllocationLib.h | 6 +- MdePkg/Include/Library/UefiDecompressLib.h | 2 +- MdePkg/Include/Library/UefiLib.h | 6 +- MdePkg/Include/Library/UefiRuntimeLib.h | 2 +- MdePkg/Include/Peim/PeiCis.h | 2 +- MdePkg/Include/Ppi/BlockIo.h | 2 +- MdePkg/Include/Ppi/Pcd.h | 2 +- MdePkg/Include/Ppi/ReadOnlyVariable.h | 2 +- MdePkg/Include/Ppi/Security.h | 2 +- MdePkg/Include/Protocol/Arp.h | 4 +- MdePkg/Include/Protocol/Bis.h | 22 +- MdePkg/Include/Protocol/DebugSupport.h | 6 +- MdePkg/Include/Protocol/FormBrowser.h | 6 +- MdePkg/Include/Protocol/FormCallback.h | 2 +- MdePkg/Include/Protocol/Hash.h | 4 +- MdePkg/Include/Protocol/Hii.h | 2 +- MdePkg/Include/Protocol/IdeControllerInit.h | 2 +- MdePkg/Include/Protocol/LegacyBiosPlatform.h | 2 +- MdePkg/Include/Protocol/LegacyRegion.h | 2 +- MdePkg/Include/Protocol/Mtftp4.h | 4 +- MdePkg/Include/Protocol/Pcd.h | 2 +- MdePkg/Include/Protocol/PciIo.h | 12 +- MdePkg/Include/Protocol/PciPlatform.h | 2 +- MdePkg/Include/Protocol/PciRootBridgeIo.h | 2 +- MdePkg/Include/Protocol/PxeBaseCode.h | 4 +- MdePkg/Include/Protocol/SmmSxDispatch.h | 2 +- MdePkg/Include/Protocol/TapeIo.h | 4 +- MdePkg/Include/Protocol/Tcp4.h | 4 +- MdePkg/Include/Protocol/Usb2HostController.h | 2 +- MdePkg/Include/Protocol/UsbHostController.h | 2 +- MdePkg/Include/Protocol/UsbIo.h | 4 +- MdePkg/Include/Uefi/UefiSpec.h | 34 +- MdePkg/Library/BaseDebugLibNull/DebugLib.c | 2 +- MdePkg/Library/BaseMemoryLib/MemLibGuid.c | 2 +- .../Library/BaseMemoryLib/ScanMem16Wrapper.c | 2 +- .../Library/BaseMemoryLib/ScanMem32Wrapper.c | 2 +- .../Library/BaseMemoryLib/ScanMem64Wrapper.c | 2 +- .../Library/BaseMemoryLib/ScanMem8Wrapper.c | 2 +- MdePkg/Library/BaseMemoryLib/SetMemWrapper.c | 2 +- MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c | 2 +- MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c | 2 +- .../BaseMemoryLibMmx/ScanMem16Wrapper.c | 2 +- .../BaseMemoryLibMmx/ScanMem32Wrapper.c | 2 +- .../BaseMemoryLibMmx/ScanMem64Wrapper.c | 2 +- .../BaseMemoryLibMmx/ScanMem8Wrapper.c | 2 +- .../Library/BaseMemoryLibMmx/SetMemWrapper.c | 2 +- .../Library/BaseMemoryLibMmx/ZeroMemWrapper.c | 2 +- .../Library/BaseMemoryLibRepStr/MemLibGuid.c | 2 +- .../BaseMemoryLibRepStr/ScanMem16Wrapper.c | 2 +- .../BaseMemoryLibRepStr/ScanMem32Wrapper.c | 2 +- .../BaseMemoryLibRepStr/ScanMem64Wrapper.c | 2 +- .../BaseMemoryLibRepStr/ScanMem8Wrapper.c | 2 +- .../BaseMemoryLibRepStr/SetMemWrapper.c | 2 +- .../BaseMemoryLibRepStr/ZeroMemWrapper.c | 2 +- MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c | 2 +- .../BaseMemoryLibSse2/ScanMem16Wrapper.c | 2 +- .../BaseMemoryLibSse2/ScanMem32Wrapper.c | 2 +- .../BaseMemoryLibSse2/ScanMem64Wrapper.c | 2 +- .../BaseMemoryLibSse2/ScanMem8Wrapper.c | 2 +- .../Library/BaseMemoryLibSse2/SetMemWrapper.c | 2 +- .../BaseMemoryLibSse2/ZeroMemWrapper.c | 2 +- .../BaseUefiDecompressLib.c | 2 +- MdePkg/Library/DxeCoreHobLib/HobLib.c | 2 +- MdePkg/Library/DxeHobLib/HobLib.c | 2 +- .../MemoryAllocationLib.c | 8 +- MdePkg/Library/DxeMemoryLib/MemLibGuid.c | 2 +- .../Library/DxeMemoryLib/ScanMem16Wrapper.c | 2 +- .../Library/DxeMemoryLib/ScanMem32Wrapper.c | 2 +- .../Library/DxeMemoryLib/ScanMem64Wrapper.c | 2 +- MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c | 2 +- MdePkg/Library/DxeMemoryLib/SetMemWrapper.c | 2 +- MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c | 2 +- .../PeiDxeDebugLibReportStatusCode/DebugLib.c | 2 +- MdePkg/Library/PeiHobLib/HobLib.c | 2 +- .../MemoryAllocationLib.c | 8 +- MdePkg/Library/PeiMemoryLib/MemLibGuid.c | 2 +- .../Library/PeiMemoryLib/ScanMem16Wrapper.c | 2 +- .../Library/PeiMemoryLib/ScanMem32Wrapper.c | 2 +- .../Library/PeiMemoryLib/ScanMem64Wrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/SetMemWrapper.c | 2 +- MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c | 2 +- MdePkg/Library/UefiDebugLibConOut/DebugLib.c | 2 +- MdePkg/Library/UefiDebugLibStdErr/DebugLib.c | 2 +- MdePkg/Library/UefiLib/UefiLib.c | 6 +- MdePkg/Library/UefiLib/UefiNotTiano.c | 20 +- Tools/CCode/Source/Include/Protocol/Hii.h | 2 +- 116 files changed, 3672 insertions(+), 3672 deletions(-) diff --git a/EdkModulePkg/Core/Dxe/DxeMain.h b/EdkModulePkg/Core/Dxe/DxeMain.h index 9a9ba683e7..4ff23f3b0b 100644 --- a/EdkModulePkg/Core/Dxe/DxeMain.h +++ b/EdkModulePkg/Core/Dxe/DxeMain.h @@ -1669,7 +1669,7 @@ Arguments: ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for - the image¡¯s exit. + the image's exit. Returns: @@ -1701,13 +1701,13 @@ Arguments: ImageHandle - Handle that identifies the image. This parameter is passed to the image on entry. - Status - The image¡¯s exit code. + Status - The image's exit code. ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS. ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for - the image¡¯s exit. + the image's exit. Returns: @@ -1740,8 +1740,8 @@ Arguments: Type - The type of event to create and its mode and attributes NotifyTpl - The task priority level of event notifications - NotifyFunction - Pointer to the event’s notification function - NotifyContext - Pointer to the notification function’s context; corresponds to + NotifyFunction - Pointer to the event's notification function + NotifyContext - Pointer to the notification function's context; corresponds to parameter "Context" in the notification function pEvent - Pointer to the newly created event if the call succeeds; undefined otherwise diff --git a/EdkModulePkg/Core/Dxe/Hand/handle.c b/EdkModulePkg/Core/Dxe/Hand/handle.c index 2edfdeb78b..f958bff63f 100644 --- a/EdkModulePkg/Core/Dxe/Hand/handle.c +++ b/EdkModulePkg/Core/Dxe/Hand/handle.c @@ -1325,7 +1325,7 @@ Arguments: UserHandle - The handle for the protocol interface that was previously opened with OpenProtocol(), and is now being closed. - Protocol - The published unique identifier of the protocol. It is the caller¡¯s + Protocol - The published unique identifier of the protocol. It is the caller's responsibility to pass in a valid GUID. AgentHandle - The handle of the agent that is closing the protocol interface. ControllerHandle - If the agent that opened a protocol is a driver that follows the diff --git a/EdkModulePkg/Core/Dxe/Image/Image.c b/EdkModulePkg/Core/Dxe/Image/Image.c index d77f4c4fca..9b9720d897 100644 --- a/EdkModulePkg/Core/Dxe/Image/Image.c +++ b/EdkModulePkg/Core/Dxe/Image/Image.c @@ -905,7 +905,7 @@ Arguments: ExitData - Pointer to a pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for - the image¡¯s exit. + the image's exit. Returns: @@ -1209,13 +1209,13 @@ Arguments: ImageHandle - Handle that identifies the image. This parameter is passed to the image on entry. - Status - The image¡¯s exit code. + Status - The image's exit code. ExitDataSize - The size, in bytes, of ExitData. Ignored if ExitStatus is EFI_SUCCESS. ExitData - Pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for - the image¡¯s exit. + the image's exit. Returns: diff --git a/EdkModulePkg/Core/Pei/Memory/MemoryServices.c b/EdkModulePkg/Core/Pei/Memory/MemoryServices.c index d49b7427b4..62cd59edf0 100644 --- a/EdkModulePkg/Core/Pei/Memory/MemoryServices.c +++ b/EdkModulePkg/Core/Pei/Memory/MemoryServices.c @@ -302,7 +302,7 @@ Returns: EFI_HOB_MEMORY_POOL *Hob; // - // If some ¡°post-memory¡± PEIM wishes to allocate larger pool, + // If some "post-memory" PEIM wishes to allocate larger pool, // it should use AllocatePages service instead. // ASSERT (Size < 0x10000 - sizeof (EFI_HOB_MEMORY_POOL)); diff --git a/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h b/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h index 3de7551ceb..533df317ff 100644 --- a/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h +++ b/EdkModulePkg/Include/Library/OemHookStatusCodeLib.h @@ -35,13 +35,13 @@ OemHookStatusCodeInitialize ( /** Report status code to OEM device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/DebugLib.c b/EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/DebugLib.c index fed9ba4d66..482e12e79e 100644 --- a/EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/DebugLib.c +++ b/EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/DebugLib.c @@ -225,7 +225,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c b/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c index 98c98cc9d0..7816931e96 100644 --- a/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c +++ b/EdkModulePkg/Library/EdkOemHookStatusCodeLibNull/OemHookStatusCodeLibNull.c @@ -33,13 +33,13 @@ OemHookStatusCodeInitialize ( /** Report status code to OEM device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Library/EdkUefiDebugLibConOut/DebugLib.c b/EdkModulePkg/Library/EdkUefiDebugLibConOut/DebugLib.c index 5f5f2c56ca..43d904a677 100644 --- a/EdkModulePkg/Library/EdkUefiDebugLibConOut/DebugLib.c +++ b/EdkModulePkg/Library/EdkUefiDebugLibConOut/DebugLib.c @@ -189,7 +189,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/EdkModulePkg/Library/EdkUefiDebugLibStdErr/DebugLib.c b/EdkModulePkg/Library/EdkUefiDebugLibStdErr/DebugLib.c index 2016701284..9ba70df0d6 100644 --- a/EdkModulePkg/Library/EdkUefiDebugLibStdErr/DebugLib.c +++ b/EdkModulePkg/Library/EdkUefiDebugLibStdErr/DebugLib.c @@ -189,7 +189,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeService.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeService.c index 42a872cd5a..013c3f159f 100644 --- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeService.c +++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Common/RuntimeService.c @@ -68,7 +68,7 @@ Routine Description: Arguments: Time - A pointer to storage to receive a snapshot of the current time. - Capabilities - An optional pointer to a buffer to receive the real time clock device¡¯s + Capabilities - An optional pointer to a buffer to receive the real time clock device's capabilities. Returns: @@ -180,7 +180,7 @@ Routine Description: Arguments: VariableName - A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. VendorGuid - A unique identifier for the vendor. Attributes - If not NULL, a pointer to the memory location to return the attributes bitmask for the variable. @@ -248,7 +248,7 @@ Routine Description: Arguments: VariableName - A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. VendorGuid - A unique identifier for the vendor. Attributes - Attributes bitmask to set for the variable. DataSize - The size in bytes of the Data buffer. @@ -272,7 +272,7 @@ EfiGetNextHighMonotonicCount ( Routine Description: - Returns the next high 32 bits of the platform¡¯s monotonic counter. + Returns the next high 32 bits of the platform's monotonic counter. Arguments: diff --git a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeService.c b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeService.c index 13fa9d7e0a..159a53fc0e 100644 --- a/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeService.c +++ b/EdkModulePkg/Library/EdkUefiRuntimeLib/Ipf/RuntimeService.c @@ -81,7 +81,7 @@ Routine Description: Arguments: Time - A pointer to storage to receive a snapshot of the current time. - Capabilities - An optional pointer to a buffer to receive the real time clock device¡¯s + Capabilities - An optional pointer to a buffer to receive the real time clock device's capabilities. Returns: @@ -209,7 +209,7 @@ Routine Description: Arguments: VariableName - A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. VendorGuid - A unique identifier for the vendor. Attributes - If not NULL, a pointer to the memory location to return the attributes bitmask for the variable. @@ -305,7 +305,7 @@ Routine Description: Arguments: VariableName - A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. VendorGuid - A unique identifier for the vendor. Attributes - Attributes bitmask to set for the variable. DataSize - The size in bytes of the Data buffer. @@ -343,7 +343,7 @@ EfiGetNextHighMonotonicCount ( Routine Description: - Returns the next high 32 bits of the platform¡¯s monotonic counter. + Returns the next high 32 bits of the platform's monotonic counter. Arguments: diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c index 6117a3245e..8aff74d64e 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePath.c @@ -1,43 +1,43 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - DevicePathDriver.c - -Abstract: - - Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol - and DevPathToText Protocol. - ---*/ - -#include "DevicePath.h" - -EFI_HANDLE mDevicePathHandle = NULL; - +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + DevicePathDriver.c + +Abstract: + + Device Path Driver to produce DevPathUtilities Protocol, DevPathFromText Protocol + and DevPathToText Protocol. + +--*/ + +#include "DevicePath.h" + +EFI_HANDLE mDevicePathHandle = NULL; + GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_UTILITIES_PROTOCOL mDevicePathUtilities = { - GetDevicePathSizeProtocolInterface, - DuplicateDevicePathProtocolInterface, - AppendDevicePathProtocolInterface, - AppendDeviceNodeProtocolInterface, - AppendDevicePathInstanceProtocolInterface, - GetNextDevicePathInstanceProtocolInterface, - IsDevicePathMultiInstanceProtocolInterface, - CreateDeviceNodeProtocolInterface + GetDevicePathSizeProtocolInterface, + DuplicateDevicePathProtocolInterface, + AppendDevicePathProtocolInterface, + AppendDeviceNodeProtocolInterface, + AppendDevicePathInstanceProtocolInterface, + GetNextDevicePathInstanceProtocolInterface, + IsDevicePathMultiInstanceProtocolInterface, + CreateDeviceNodeProtocolInterface }; GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_TO_TEXT_PROTOCOL mDevicePathToText = { - ConvertDeviceNodeToText, - ConvertDevicePathToText + ConvertDeviceNodeToText, + ConvertDevicePathToText }; GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePathFromText = { @@ -45,65 +45,65 @@ GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL mDevicePa ConvertTextToDevicePath }; -GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; -GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; - -EFI_STATUS -EFIAPI -DevicePathEntryPoint ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - - Routine Description: - Entry point for EFI drivers. - - Arguments: - ImageHandle - EFI_HANDLE - SystemTable - EFI_SYSTEM_TABLE - - Returns: - EFI_SUCCESS - others - ---*/ -{ - EFI_STATUS Status; - - Status = EFI_UNSUPPORTED; +GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL; +GLOBAL_REMOVE_IF_UNREFERENCED const EFI_GUID mEfiDevicePathMessagingSASGuid = DEVICE_PATH_MESSAGING_SAS; + +EFI_STATUS +EFIAPI +DevicePathEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + + Routine Description: + Entry point for EFI drivers. + + Arguments: + ImageHandle - EFI_HANDLE + SystemTable - EFI_SYSTEM_TABLE + + Returns: + EFI_SUCCESS + others + +--*/ +{ + EFI_STATUS Status; + + Status = EFI_UNSUPPORTED; if (FeaturePcdGet (PcdDevicePathSupportDevicePathToText)) { if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) { - Status = gBS->InstallMultipleProtocolInterfaces ( - &mDevicePathHandle, - &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, - &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, - &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, - NULL - ); + Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, + &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, + NULL + ); } else { - Status = gBS->InstallMultipleProtocolInterfaces ( - &mDevicePathHandle, - &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, - &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, - NULL - ); + Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathToTextProtocolGuid, &mDevicePathToText, + NULL + ); } } else { if (FeaturePcdGet (PcdDevicePathSupportDevicePathFromText)) { - Status = gBS->InstallMultipleProtocolInterfaces ( - &mDevicePathHandle, - &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, - &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, - NULL - ); + Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + &gEfiDevicePathFromTextProtocolGuid, &mDevicePathFromText, + NULL + ); } else { - Status = gBS->InstallMultipleProtocolInterfaces ( - &mDevicePathHandle, - &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, - NULL - ); + Status = gBS->InstallMultipleProtocolInterfaces ( + &mDevicePathHandle, + &gEfiDevicePathUtilitiesProtocolGuid, &mDevicePathUtilities, + NULL + ); } } - return Status; -} + return Status; +} diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c index cd49359c76..d9dcd44352 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathFromText.c @@ -1,2377 +1,2377 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - DevicePathFromText.c - -Abstract: - - DevicePathFromText protocol as defined in the UEFI 2.0 specification. - ---*/ - -#include "DevicePath.h" - -CHAR16 * -StrDuplicate ( - IN CONST CHAR16 *Src - ) -/*++ - - Routine Description: - Duplicate a string - - Arguments: - Src - Source string - - Returns: - Duplicated string - ---*/ -{ - UINTN Length; - CHAR16 *ReturnStr; - - Length = StrLen ((CHAR16 *) Src); - - ReturnStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), (VOID *) Src); - - return ReturnStr; -} - -CHAR16 * -GetParamByNodeName ( - IN CHAR16 *Str, - IN CHAR16 *NodeName - ) -/*++ - - Routine Description: - Get parameter in a pair of parentheses follow the given node name. - For example, given the "Pci(0,1)" and NodeName "Pci", it returns "0,1". - - Arguments: - Str - Device Path Text - NodeName - Name of the node - - Returns: - Parameter text for the node - ---*/ -{ - CHAR16 *ParamStr; - CHAR16 *StrPointer; - UINTN NodeNameLength; - UINTN ParameterLength; - - // - // Check whether the node name matchs - // - NodeNameLength = StrLen (NodeName); - if (CompareMem (Str, NodeName, NodeNameLength * sizeof (CHAR16)) != 0) { - return NULL; - } - - ParamStr = Str + NodeNameLength; - if (!IS_LEFT_PARENTH (*ParamStr)) { - return NULL; - } - - // - // Skip the found '(' and find first occurrence of ')' - // - ParamStr++; - ParameterLength = 0; - StrPointer = ParamStr; - while (!IS_NULL (*StrPointer)) { - if (IS_RIGHT_PARENTH (*StrPointer)) { - break; - } - StrPointer++; - ParameterLength++; - } - if (IS_NULL (*StrPointer)) { - // - // ')' not found - // - return NULL; - } - - ParamStr = AllocateCopyPool ((ParameterLength + 1) * sizeof (CHAR16), ParamStr); - if (ParamStr == NULL) { - return NULL; - } - // - // Terminate the parameter string - // - ParamStr[ParameterLength] = L'\0'; - - return ParamStr; -} - -CHAR16 * -SplitStr ( - IN OUT CHAR16 **List, - IN CHAR16 Separator - ) -/*++ - - Routine Description: - Get current sub-string from a string list, before return - the list header is moved to next sub-string. The sub-string is separated - by the specified character. For example, the separator is ',', the string - list is "2,0,3", it returns "2", the remain list move to "2,3" - - Arguments: - List - A string list separated by the specified separator - Separator - The separator character - - Returns: - pointer - The current sub-string - ---*/ -{ - CHAR16 *Str; - CHAR16 *ReturnStr; - - Str = *List; - ReturnStr = Str; - - if (IS_NULL (*Str)) { - return ReturnStr; - } - - // - // Find first occurrence of the separator - // - while (!IS_NULL (*Str)) { - if (*Str == Separator) { - break; - } - Str++; - } - - if (*Str == Separator) { - // - // Find a sub-string, terminate it - // - *Str = L'\0'; - Str++; - } - - // - // Move to next sub-string - // - *List = Str; - - return ReturnStr; -} - -CHAR16 * -GetNextParamStr ( - IN OUT CHAR16 **List - ) -{ - // - // The separator is comma - // - return SplitStr (List, L','); -} - -CHAR16 * -GetNextDeviceNodeStr ( - IN OUT CHAR16 **DevicePath, - OUT BOOLEAN *IsInstanceEnd - ) -/*++ - - Routine Description: - Get one device node from entire device path text. - - Arguments: - Str - The entire device path text string - IsInstanceEnd - This node is the end of a device path instance - - Returns: - a pointer - A device node text - NULL - No more device node available - ---*/ -{ - CHAR16 *Str; - CHAR16 *ReturnStr; - UINTN ParenthesesStack; - - Str = *DevicePath; - if (IS_NULL (*Str)) { - return NULL; - } - - // - // Skip the leading '/', '(', ')' and ',' - // - while (!IS_NULL (*Str)) { - if (!IS_SLASH (*Str) && - !IS_COMMA (*Str) && - !IS_LEFT_PARENTH (*Str) && - !IS_RIGHT_PARENTH (*Str)) { - break; - } - Str++; - } - - ReturnStr = Str; - - // - // Scan for the separator of this device node, '/' or ',' - // - ParenthesesStack = 0; - while (!IS_NULL (*Str)) { - if ((IS_COMMA (*Str) || IS_SLASH (*Str)) && (ParenthesesStack == 0)) { - break; - } - - if (IS_LEFT_PARENTH (*Str)) { - ParenthesesStack++; - } else if (IS_RIGHT_PARENTH (*Str)) { - ParenthesesStack--; - } - - Str++; - } - - if (ParenthesesStack != 0) { - // - // The '(' doesn't pair with ')', invalid device path text - // - return NULL; - } - - if (IS_COMMA (*Str)) { - *IsInstanceEnd = TRUE; - *Str = L'\0'; - Str++; - } else { - *IsInstanceEnd = FALSE; - if (!IS_NULL (*Str)) { - *Str = L'\0'; - Str++; - } - } - - *DevicePath = Str; - - return ReturnStr; -} - -BOOLEAN -IsHexDigit ( - OUT UINT8 *Digit, - IN CHAR16 Char - ) -/*++ - - Routine Description: - Determines if a Unicode character is a hexadecimal digit. - The test is case insensitive. - - Arguments: - Digit - Pointer to byte that receives the value of the hex character. - Char - Unicode character to test. - - Returns: - TRUE - If the character is a hexadecimal digit. - FALSE - Otherwise. - ---*/ -{ - if ((Char >= L'0') && (Char <= L'9')) { - *Digit = (UINT8) (Char - L'0'); - return TRUE; - } - - if ((Char >= L'A') && (Char <= L'F')) { - *Digit = (UINT8) (Char - L'A' + 0x0A); - return TRUE; - } - - if ((Char >= L'a') && (Char <= L'f')) { - *Digit = (UINT8) (Char - L'a' + 0x0A); - return TRUE; - } - - return FALSE; -} - -CHAR16 -NibbleToHexChar ( - IN UINT8 Nibble - ) -/*++ - - Routine Description: - Converts the low nibble of a byte to hex unicode character. - - Arguments: - Nibble - lower nibble of a byte. - - Returns: - Hex unicode character. - ---*/ -{ - Nibble &= 0x0F; - if (Nibble <= 0x9) { - return (CHAR16)(Nibble + L'0'); - } - - return (CHAR16)(Nibble - 0xA + L'A'); -} - -EFI_STATUS -HexStringToBuf ( - IN OUT UINT8 *Buf, - IN OUT UINTN *Len, - IN CHAR16 *Str, - OUT UINTN *ConvertedStrLen OPTIONAL - ) -/*++ - - Routine Description: - Converts Unicode string to binary buffer. - The conversion may be partial. - The first character in the string that is not hex digit stops the conversion. - At a minimum, any blob of data could be represented as a hex string. - - Arguments: - Buf - Pointer to buffer that receives the data. - Len - Length in bytes of the buffer to hold converted data. - If routine return with EFI_SUCCESS, containing length of converted data. - If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired. - Str - String to be converted from. - ConvertedStrLen - Length of the Hex String consumed. - - Returns: - EFI_SUCCESS: Routine Success. - EFI_BUFFER_TOO_SMALL: The buffer is too small to hold converted data. - EFI_ - ---*/ -{ - UINTN HexCnt; - UINTN Idx; - UINTN BufferLength; - UINT8 Digit; - UINT8 Byte; - - // - // Find out how many hex characters the string has. - // - for (Idx = 0, HexCnt = 0; IsHexDigit (&Digit, Str[Idx]); Idx++, HexCnt++); - - if (HexCnt == 0) { - *Len = 0; - return EFI_SUCCESS; - } - // - // Two Unicode characters make up 1 buffer byte. Round up. - // - BufferLength = (HexCnt + 1) / 2; - - // - // Test if buffer is passed enough. - // - if (BufferLength > (*Len)) { - *Len = BufferLength; - return EFI_BUFFER_TOO_SMALL; - } - - *Len = BufferLength; - - for (Idx = 0; Idx < HexCnt; Idx++) { - - IsHexDigit (&Digit, Str[HexCnt - 1 - Idx]); - - // - // For odd charaters, write the lower nibble for each buffer byte, - // and for even characters, the upper nibble. - // - if ((Idx & 1) == 0) { - Byte = Digit; - } else { - Byte = Buf[Idx / 2]; - Byte &= 0x0F; - Byte |= Digit << 4; - } - - Buf[Idx / 2] = Byte; - } - - if (ConvertedStrLen != NULL) { - *ConvertedStrLen = HexCnt; - } - - return EFI_SUCCESS; -} - -EFI_STATUS -BufToHexString ( - IN OUT CHAR16 *Str, - IN OUT UINTN *HexStringBufferLength, - IN UINT8 *Buf, - IN UINTN Len - ) -/*++ - - Routine Description: - Converts binary buffer to Unicode string. - At a minimum, any blob of data could be represented as a hex string. - - Arguments: - Str - Pointer to the string. - HexStringBufferLength - Length in bytes of buffer to hold the hex string. Includes tailing '\0' character. - If routine return with EFI_SUCCESS, containing length of hex string buffer. - If routine return with EFI_BUFFER_TOO_SMALL, containg length of hex string buffer desired. - Buf - Buffer to be converted from. - Len - Length in bytes of the buffer to be converted. - - Returns: - EFI_SUCCESS: Routine success. - EFI_BUFFER_TOO_SMALL: The hex string buffer is too small. - ---*/ -{ - UINTN Idx; - UINT8 Byte; - UINTN StrLen; - - // - // Make sure string is either passed or allocate enough. - // It takes 2 Unicode characters (4 bytes) to represent 1 byte of the binary buffer. - // Plus the Unicode termination character. - // - StrLen = Len * 2; - if (StrLen > ((*HexStringBufferLength) - 1)) { - *HexStringBufferLength = StrLen + 1; - return EFI_BUFFER_TOO_SMALL; - } - - *HexStringBufferLength = StrLen + 1; - // - // Ends the string. - // - Str[StrLen] = L'\0'; - - for (Idx = 0; Idx < Len; Idx++) { - - Byte = Buf[Idx]; - Str[StrLen - 1 - Idx * 2] = NibbleToHexChar (Byte); - Str[StrLen - 2 - Idx * 2] = NibbleToHexChar ((UINT8)(Byte >> 4)); - } - - return EFI_SUCCESS; -} - -CHAR16 * -TrimHexStr ( - IN CHAR16 *Str - ) -/*++ - - Routine Description: - Skip the leading white space and '0x' or '0X' of a hex string - - Arguments: - Str - The hex string - - Returns: - ---*/ -{ - // - // skip preceeding white space - // - while (*Str && *Str == ' ') { - Str += 1; - } - // - // skip preceeding zeros - // - while (*Str && *Str == '0') { - Str += 1; - } - // - // skip preceeding white space - // - if (*Str && (*Str == 'x' || *Str == 'X')) { - Str += 1; - } - - return Str; -} - -UINTN -Xtoi ( - IN CHAR16 *Str - ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ -{ - UINTN Rvalue; - UINTN Length; - - ASSERT (Str != NULL); - - // - // convert hex digits - // - Rvalue = 0; - Length = sizeof (UINTN); - HexStringToBuf ((UINT8 *) &Rvalue, &Length, TrimHexStr (Str), NULL); - - return Rvalue; -} - -VOID -Xtoi64 ( - IN CHAR16 *Str, - IN UINT64 *Data - ) -/*++ - -Routine Description: - - Convert hex string to 64 bit data. - -Arguments: - - Str - The string - -Returns: - ---*/ -{ - UINTN Length; - - *Data = 0; - Length = sizeof (UINT64); - HexStringToBuf ((UINT8 *) Data, &Length, TrimHexStr (Str), NULL); -} - -UINTN -Atoi ( - IN CHAR16 *str - ) -/*++ - -Routine Description: - - Convert decimal string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ -{ - UINTN Rvalue; - CHAR16 Char; - UINTN High; - UINTN Low; - - ASSERT (str != NULL); - - High = (UINTN) -1 / 10; - Low = (UINTN) -1 % 10; - // - // skip preceeding white space - // - while (*str && *str == ' ') { - str += 1; - } - // - // convert digits - // - Rvalue = 0; - Char = *(str++); - while (Char) { - if (Char >= '0' && Char <= '9') { - if ((Rvalue > High || Rvalue == High) && (Char - '0' > (INTN) Low)) { - return (UINTN) -1; - } - - Rvalue = (Rvalue * 10) + Char - '0'; - } else { - break; - } - - Char = *(str++); - } - - return Rvalue; -} - -EFI_STATUS -StrToBuf ( - OUT UINT8 *Buf, - IN UINTN BufferLength, - IN CHAR16 *Str - ) -{ - UINTN Index; - UINTN StrLength; - UINT8 Digit; - UINT8 Byte; - - // - // Two hex char make up one byte - // - StrLength = BufferLength * sizeof (CHAR16); - - for(Index = 0; Index < StrLength; Index++, Str++) { - - IsHexDigit (&Digit, *Str); - - // - // For odd charaters, write the upper nibble for each buffer byte, - // and for even characters, the lower nibble. - // - if ((Index & 1) == 0) { - Byte = Digit << 4; - } else { - Byte = Buf[Index / 2]; - Byte &= 0xF0; - Byte |= Digit; - } - - Buf[Index / 2] = Byte; - } - - return EFI_SUCCESS; -} - -EFI_STATUS -StrToGuid ( - IN CHAR16 *Str, - OUT EFI_GUID *Guid - ) -{ - UINTN BufferLength; - UINTN ConvertedStrLen; - EFI_STATUS Status; - - BufferLength = sizeof (Guid->Data1); - Status = HexStringToBuf ((UINT8 *) &Guid->Data1, &BufferLength, Str, &ConvertedStrLen); - if (EFI_ERROR (Status)) { - return Status; - } - Str += ConvertedStrLen; - if (IS_HYPHEN (*Str)) { - Str++; - } else { - return EFI_UNSUPPORTED; - } - - BufferLength = sizeof (Guid->Data2); - Status = HexStringToBuf ((UINT8 *) &Guid->Data2, &BufferLength, Str, &ConvertedStrLen); - if (EFI_ERROR (Status)) { - return Status; - } - Str += ConvertedStrLen; - if (IS_HYPHEN (*Str)) { - Str++; - } else { - return EFI_UNSUPPORTED; - } - - BufferLength = sizeof (Guid->Data3); - Status = HexStringToBuf ((UINT8 *) &Guid->Data3, &BufferLength, Str, &ConvertedStrLen); - if (EFI_ERROR (Status)) { - return Status; - } - Str += ConvertedStrLen; - if (IS_HYPHEN (*Str)) { - Str++; - } else { - return EFI_UNSUPPORTED; - } - - StrToBuf (&Guid->Data4[0], 2, Str); - // - // Skip 2 byte hex chars - // - Str += 2 * 2; - - if (IS_HYPHEN (*Str)) { - Str++; - } else { - return EFI_UNSUPPORTED; - } - StrToBuf (&Guid->Data4[2], 6, Str); - - return EFI_SUCCESS; -} - -VOID -StrToIPv4Addr ( - IN OUT CHAR16 **Str, - OUT EFI_IPv4_ADDRESS *IPv4Addr - ) -{ - UINTN Index; - - for (Index = 0; Index < 4; Index++) { - IPv4Addr->Addr[Index] = (UINT8) Atoi (SplitStr (Str, L'.')); - } -} - -VOID -StrToIPv6Addr ( - IN OUT CHAR16 **Str, - OUT EFI_IPv6_ADDRESS *IPv6Addr - ) -{ - UINTN Index; - UINT16 Data; - - for (Index = 0; Index < 8; Index++) { - Data = (UINT16) Xtoi (SplitStr (Str, L':')); - IPv6Addr->Addr[Index * 2] = (UINT8) (Data >> 8); - IPv6Addr->Addr[Index * 2 + 1] = (UINT8) (Data & 0xff); - } -} - -VOID -StrToAscii ( - IN CHAR16 *Str, - IN OUT CHAR8 **AsciiStr - ) -{ - CHAR8 *Dest; - - Dest = *AsciiStr; - while (!IS_NULL (*Str)) { - *(Dest++) = (CHAR8) *(Str++); - } - *Dest = 0; - - // - // Return the string next to it - // - *AsciiStr = Dest + 1; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextPci ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *FunctionStr; - CHAR16 *DeviceStr; - PCI_DEVICE_PATH *Pci; - - FunctionStr = GetNextParamStr (&TextDeviceNode); - DeviceStr = GetNextParamStr (&TextDeviceNode); - Pci = (PCI_DEVICE_PATH *) CreateDeviceNode ( - HARDWARE_DEVICE_PATH, - HW_PCI_DP, - sizeof (PCI_DEVICE_PATH) - ); - - Pci->Function = (UINT8) Xtoi (FunctionStr); - Pci->Device = (UINT8) Xtoi (DeviceStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Pci; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextPcCard ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *FunctionNumberStr; - PCCARD_DEVICE_PATH *Pccard; - - FunctionNumberStr = GetNextParamStr (&TextDeviceNode); - Pccard = (PCCARD_DEVICE_PATH *) CreateDeviceNode ( - HARDWARE_DEVICE_PATH, - HW_PCCARD_DP, - sizeof (PCCARD_DEVICE_PATH) - ); - - Pccard->FunctionNumber = (UINT8) Xtoi (FunctionNumberStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Pccard; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextMemoryMapped ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *StartingAddressStr; - CHAR16 *EndingAddressStr; - MEMMAP_DEVICE_PATH *MemMap; - - StartingAddressStr = GetNextParamStr (&TextDeviceNode); - EndingAddressStr = GetNextParamStr (&TextDeviceNode); - MemMap = (MEMMAP_DEVICE_PATH *) CreateDeviceNode ( - HARDWARE_DEVICE_PATH, - HW_MEMMAP_DP, - sizeof (MEMMAP_DEVICE_PATH) - ); - - MemMap->MemoryType = 0; - - Xtoi64 (StartingAddressStr, &MemMap->StartingAddress); - Xtoi64 (EndingAddressStr, &MemMap->EndingAddress); - - return (EFI_DEVICE_PATH_PROTOCOL *) MemMap; -} - -EFI_DEVICE_PATH_PROTOCOL * -ConvertFromTextVendor ( - IN CHAR16 *TextDeviceNode, - IN UINT8 Type, - IN UINT8 SubType - ) -{ - CHAR16 *GuidStr; - CHAR16 *DataStr; - UINTN Length; - VENDOR_DEVICE_PATH *Vendor; - - GuidStr = GetNextParamStr (&TextDeviceNode); - - DataStr = GetNextParamStr (&TextDeviceNode); - Length = StrLen (DataStr); - // - // Two hex characters make up 1 buffer byte - // - Length = (Length + 1) / 2; - - Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( - Type, - SubType, - sizeof (VENDOR_DEVICE_PATH) + (UINT16) Length - ); - - StrToGuid (GuidStr, &Vendor->Guid); - StrToBuf (((UINT8 *) Vendor) + sizeof (VENDOR_DEVICE_PATH), Length, DataStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenHw ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextVendor ( - TextDeviceNode, - HARDWARE_DEVICE_PATH, - HW_VENDOR_DP - ); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextCtrl ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *ControllerStr; - CONTROLLER_DEVICE_PATH *Controller; - - ControllerStr = GetNextParamStr (&TextDeviceNode); - Controller = (CONTROLLER_DEVICE_PATH *) CreateDeviceNode ( - HARDWARE_DEVICE_PATH, - HW_CONTROLLER_DP, - sizeof (CONTROLLER_DEVICE_PATH) - ); - Controller->ControllerNumber = (UINT32) Xtoi (ControllerStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Controller; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextAcpi ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *HIDStr; - CHAR16 *UIDStr; - ACPI_HID_DEVICE_PATH *Acpi; - - HIDStr = GetNextParamStr (&TextDeviceNode); - UIDStr = GetNextParamStr (&TextDeviceNode); - Acpi = (ACPI_HID_DEVICE_PATH *) CreateDeviceNode ( - ACPI_DEVICE_PATH, - ACPI_DP, - sizeof (ACPI_HID_DEVICE_PATH) - ); - - if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { - HIDStr += 3; - } - - Acpi->HID = EISA_PNP_ID (Xtoi (HIDStr)); - Acpi->UID = (UINT32) Xtoi (UIDStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Acpi; -} - -EFI_DEVICE_PATH_PROTOCOL * -ConvertFromTextAcpi ( - IN CHAR16 *TextDeviceNode, - IN UINT32 Hid - ) -{ - CHAR16 *UIDStr; - ACPI_HID_DEVICE_PATH *Acpi; - - UIDStr = GetNextParamStr (&TextDeviceNode); - Acpi = (ACPI_HID_DEVICE_PATH *) CreateDeviceNode ( - ACPI_DEVICE_PATH, - ACPI_DP, - sizeof (ACPI_HID_DEVICE_PATH) - ); - - Acpi->HID = Hid; - Acpi->UID = (UINT32) Xtoi (UIDStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Acpi; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextPciRoot ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextAcpi (TextDeviceNode, 0x0a0341d0); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextFloppy ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextAcpi (TextDeviceNode, 0x060441d0); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextKeyboard ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextAcpi (TextDeviceNode, 0x030141d0); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextSerial ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextAcpi (TextDeviceNode, 0x050141d0); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextParallelPort ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextAcpi (TextDeviceNode, 0x040141d0); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextAcpiEx ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *HIDStr; - CHAR16 *CIDStr; - CHAR16 *UIDStr; - CHAR16 *HIDSTRStr; - CHAR16 *CIDSTRStr; - CHAR16 *UIDSTRStr; - CHAR8 *AsciiStr; - UINT16 Length; - ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExt; - - HIDStr = GetNextParamStr (&TextDeviceNode); - CIDStr = GetNextParamStr (&TextDeviceNode); - UIDStr = GetNextParamStr (&TextDeviceNode); - HIDSTRStr = GetNextParamStr (&TextDeviceNode); - CIDSTRStr = GetNextParamStr (&TextDeviceNode); - UIDSTRStr = GetNextParamStr (&TextDeviceNode); - Length = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + - (UINT16) StrLen (HIDSTRStr) + 1 + - (UINT16) StrLen (UIDSTRStr) + 1 + - (UINT16) StrLen (CIDSTRStr) + 1; - AcpiExt = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) CreateDeviceNode ( - ACPI_DEVICE_PATH, - ACPI_EXTENDED_DP, - Length - ); - - if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { - HIDStr += 3; - AcpiExt->HID = EISA_PNP_ID (Xtoi (HIDStr)); - } else { - AcpiExt->HID = (UINT32) Xtoi (HIDStr); - } - - AcpiExt->UID = (UINT32) Xtoi (UIDStr); - AcpiExt->CID = (UINT32) Xtoi (CIDStr); - - AsciiStr = AcpiExt->HidUidCidStr; - StrToAscii (HIDSTRStr, &AsciiStr); - StrToAscii (UIDSTRStr, &AsciiStr); - StrToAscii (CIDSTRStr, &AsciiStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextAcpiExp ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *HIDStr; - CHAR16 *CIDStr; - CHAR16 *UIDSTRStr; - CHAR8 *AsciiStr; - UINT16 Length; - ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExt; - - HIDStr = GetNextParamStr (&TextDeviceNode); - CIDStr = GetNextParamStr (&TextDeviceNode); - UIDSTRStr = GetNextParamStr (&TextDeviceNode); - Length = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + (UINT16) StrLen (UIDSTRStr) + 3; - AcpiExt = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) CreateDeviceNode ( - ACPI_DEVICE_PATH, - ACPI_EXTENDED_DP, - Length - ); - - if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { - HIDStr += 3; - AcpiExt->HID = EISA_PNP_ID (Xtoi (HIDStr)); - } else { - AcpiExt->HID = (UINT32) Xtoi (HIDStr); - } - - AcpiExt->UID = 0; - AcpiExt->CID = (UINT32) Xtoi (CIDStr); - - AsciiStr = AcpiExt->HidUidCidStr; - // - // HID string is NULL - // - *AsciiStr = 0; - // - // Convert UID string - // - AsciiStr++; - StrToAscii (UIDSTRStr, &AsciiStr); - // - // CID string is NULL - // - *AsciiStr = 0; - - return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextAta ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *PrimarySecondaryStr; - CHAR16 *SlaveMasterStr; - CHAR16 *LunStr; - ATAPI_DEVICE_PATH *Atapi; - - Atapi = (ATAPI_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_ATAPI_DP, - sizeof (ATAPI_DEVICE_PATH) - ); - - PrimarySecondaryStr = GetNextParamStr (&TextDeviceNode); - SlaveMasterStr = GetNextParamStr (&TextDeviceNode); - LunStr = GetNextParamStr (&TextDeviceNode); - - Atapi->PrimarySecondary = (StrCmp (PrimarySecondaryStr, L"Primary") == 0) ? (UINT8) 0 : (UINT8) 1; - Atapi->SlaveMaster = (StrCmp (SlaveMasterStr, L"Master") == 0) ? (UINT8) 0 : (UINT8) 1; - Atapi->Lun = (UINT16) Xtoi (LunStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Atapi; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextScsi ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *PunStr; - CHAR16 *LunStr; - SCSI_DEVICE_PATH *Scsi; - - PunStr = GetNextParamStr (&TextDeviceNode); - LunStr = GetNextParamStr (&TextDeviceNode); - Scsi = (SCSI_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_SCSI_DP, - sizeof (SCSI_DEVICE_PATH) - ); - - Scsi->Pun = (UINT16) Xtoi (PunStr); - Scsi->Lun = (UINT16) Xtoi (LunStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Scsi; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextFibre ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *WWNStr; - CHAR16 *LunStr; - FIBRECHANNEL_DEVICE_PATH *Fibre; - - WWNStr = GetNextParamStr (&TextDeviceNode); - LunStr = GetNextParamStr (&TextDeviceNode); - Fibre = (FIBRECHANNEL_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_FIBRECHANNEL_DP, - sizeof (FIBRECHANNEL_DEVICE_PATH) - ); - - Fibre->Reserved = 0; - Xtoi64 (WWNStr, &Fibre->WWN); - Xtoi64 (LunStr, &Fibre->Lun); - - return (EFI_DEVICE_PATH_PROTOCOL *) Fibre; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromText1394 ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *GuidStr; - F1394_DEVICE_PATH *F1394; - - GuidStr = GetNextParamStr (&TextDeviceNode); - F1394 = (F1394_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_1394_DP, - sizeof (F1394_DEVICE_PATH) - ); - - F1394->Reserved = 0; - Xtoi64 (GuidStr, &F1394->Guid); - - return (EFI_DEVICE_PATH_PROTOCOL *) F1394; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsb ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *PortStr; - CHAR16 *InterfaceStr; - USB_DEVICE_PATH *Usb; - - PortStr = GetNextParamStr (&TextDeviceNode); - InterfaceStr = GetNextParamStr (&TextDeviceNode); - Usb = (USB_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_USB_DP, - sizeof (USB_DEVICE_PATH) - ); - - Usb->ParentPortNumber = (UINT8) Xtoi (PortStr); - Usb->InterfaceNumber = (UINT8) Xtoi (InterfaceStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Usb; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextI2O ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *TIDStr; - I2O_DEVICE_PATH *I2O; - - TIDStr = GetNextParamStr (&TextDeviceNode); - I2O = (I2O_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_I2O_DP, - sizeof (I2O_DEVICE_PATH) - ); - - I2O->Tid = (UINT32) Xtoi (TIDStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) I2O; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextInfiniband ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *FlagsStr; - CHAR16 *GuidStr; - CHAR16 *SidStr; - CHAR16 *TidStr; - CHAR16 *DidStr; - EFI_GUID PortGid; - INFINIBAND_DEVICE_PATH *InfiniBand; - - FlagsStr = GetNextParamStr (&TextDeviceNode); - GuidStr = GetNextParamStr (&TextDeviceNode); - SidStr = GetNextParamStr (&TextDeviceNode); - TidStr = GetNextParamStr (&TextDeviceNode); - DidStr = GetNextParamStr (&TextDeviceNode); - InfiniBand = (INFINIBAND_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_INFINIBAND_DP, - sizeof (INFINIBAND_DEVICE_PATH) - ); - - InfiniBand->ResourceFlags = (UINT32) Xtoi (FlagsStr); - StrToGuid (GuidStr, &PortGid); - CopyMem (InfiniBand->PortGid, &PortGid, sizeof (EFI_GUID)); - Xtoi64 (SidStr, &InfiniBand->ServiceId); - Xtoi64 (TidStr, &InfiniBand->TargetPortId); - Xtoi64 (DidStr, &InfiniBand->DeviceId); - - return (EFI_DEVICE_PATH_PROTOCOL *) InfiniBand; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenMsg ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextVendor ( - TextDeviceNode, - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP - ); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenPcAnsi ( - IN CHAR16 *TextDeviceNode - ) -{ - VENDOR_DEVICE_PATH *Vendor; - - Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (VENDOR_DEVICE_PATH)); - CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenVt100 ( - IN CHAR16 *TextDeviceNode - ) -{ - VENDOR_DEVICE_PATH *Vendor; - - Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (VENDOR_DEVICE_PATH)); - CopyGuid (&Vendor->Guid, &gEfiVT100Guid); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenVt100Plus ( - IN CHAR16 *TextDeviceNode - ) -{ - VENDOR_DEVICE_PATH *Vendor; - - Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (VENDOR_DEVICE_PATH)); - CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenUtf8 ( - IN CHAR16 *TextDeviceNode - ) -{ - VENDOR_DEVICE_PATH *Vendor; - - Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (VENDOR_DEVICE_PATH)); - CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUartFlowCtrl ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *ValueStr; - UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl; - - ValueStr = GetNextParamStr (&TextDeviceNode); - UartFlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (UART_FLOW_CONTROL_DEVICE_PATH) - ); - - CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid); - if (StrCmp (ValueStr, L"XonXoff") == 0) { - UartFlowControl->FlowControlMap = 2; - } else if (StrCmp (ValueStr, L"Hardware") == 0) { - UartFlowControl->FlowControlMap = 1; - } else { - UartFlowControl->FlowControlMap = 0; - } - - return (EFI_DEVICE_PATH_PROTOCOL *) UartFlowControl; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextSAS ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *AddressStr; - CHAR16 *LunStr; - CHAR16 *RTPStr; - CHAR16 *SASSATAStr; - CHAR16 *LocationStr; - CHAR16 *ConnectStr; - CHAR16 *DriveBayStr; - CHAR16 *ReservedStr; - UINT16 Info; - SAS_DEVICE_PATH *Sas; - - AddressStr = GetNextParamStr (&TextDeviceNode); - LunStr = GetNextParamStr (&TextDeviceNode); - RTPStr = GetNextParamStr (&TextDeviceNode); - SASSATAStr = GetNextParamStr (&TextDeviceNode); - LocationStr = GetNextParamStr (&TextDeviceNode); - ConnectStr = GetNextParamStr (&TextDeviceNode); - DriveBayStr = GetNextParamStr (&TextDeviceNode); - ReservedStr = GetNextParamStr (&TextDeviceNode); - Info = 0x0000; - Sas = (SAS_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (SAS_DEVICE_PATH) - ); - - CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid); - Xtoi64 (AddressStr, &Sas->SasAddress); - Xtoi64 (LunStr, &Sas->Lun); - Sas->RelativeTargetPort = (UINT16) Xtoi (RTPStr); - if (StrCmp (SASSATAStr, L"NoTopology") == 0) - ; - else { - if (StrCmp (DriveBayStr, L"0") == 0) { - Info |= 0x0001; - } else { - Info |= 0x0002; - Info |= (Xtoi (DriveBayStr) << 8); - } - - if (StrCmp (SASSATAStr, L"SATA") == 0) { - Info |= 0x0010; - } - - if (StrCmp (LocationStr, L"External") == 0) { - Info |= 0x0020; - } - - if (StrCmp (ConnectStr, L"Expanded") == 0) { - Info |= 0x0040; - } - } - - Sas->DeviceTopology = Info; - Sas->Reserved = (UINT32) Xtoi (ReservedStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Sas; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextDebugPort ( - IN CHAR16 *TextDeviceNode - ) -{ - VENDOR_DEFINED_MESSAGING_DEVICE_PATH *Vend; - - Vend = (VENDOR_DEFINED_MESSAGING_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_VENDOR_DP, - sizeof (VENDOR_DEFINED_MESSAGING_DEVICE_PATH) - ); - - CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid); - - return (EFI_DEVICE_PATH_PROTOCOL *) Vend; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextMAC ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *AddressStr; - CHAR16 *IfTypeStr; - UINTN Length; - MAC_ADDR_DEVICE_PATH *MAC; - - AddressStr = GetNextParamStr (&TextDeviceNode); - IfTypeStr = GetNextParamStr (&TextDeviceNode); - MAC = (MAC_ADDR_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_MAC_ADDR_DP, - sizeof (MAC_ADDR_DEVICE_PATH) - ); - - MAC->IfType = (UINT8) Xtoi (IfTypeStr); - - Length = sizeof (EFI_MAC_ADDRESS); - StrToBuf (&MAC->MacAddress.Addr[0], Length, AddressStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) MAC; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextIPv4 ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *RemoteIPStr; - CHAR16 *ProtocolStr; - CHAR16 *TypeStr; - CHAR16 *LocalIPStr; - IPv4_DEVICE_PATH *IPv4; - - RemoteIPStr = GetNextParamStr (&TextDeviceNode); - ProtocolStr = GetNextParamStr (&TextDeviceNode); - TypeStr = GetNextParamStr (&TextDeviceNode); - LocalIPStr = GetNextParamStr (&TextDeviceNode); - IPv4 = (IPv4_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_IPv4_DP, - sizeof (IPv4_DEVICE_PATH) - ); - - StrToIPv4Addr (&RemoteIPStr, &IPv4->RemoteIpAddress); - IPv4->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1; - if (StrCmp (TypeStr, L"Static") == 0) { - IPv4->StaticIpAddress = TRUE; - } else { - IPv4->StaticIpAddress = FALSE; - } - - StrToIPv4Addr (&LocalIPStr, &IPv4->LocalIpAddress); - - IPv4->LocalPort = 0; - IPv4->RemotePort = 0; - - return (EFI_DEVICE_PATH_PROTOCOL *) IPv4; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextIPv6 ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *RemoteIPStr; - CHAR16 *ProtocolStr; - CHAR16 *TypeStr; - CHAR16 *LocalIPStr; - IPv6_DEVICE_PATH *IPv6; - - RemoteIPStr = GetNextParamStr (&TextDeviceNode); - ProtocolStr = GetNextParamStr (&TextDeviceNode); - TypeStr = GetNextParamStr (&TextDeviceNode); - LocalIPStr = GetNextParamStr (&TextDeviceNode); - IPv6 = (IPv6_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_IPv6_DP, - sizeof (IPv6_DEVICE_PATH) - ); - - StrToIPv6Addr (&RemoteIPStr, &IPv6->RemoteIpAddress); - IPv6->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1; - if (StrCmp (TypeStr, L"Static") == 0) { - IPv6->StaticIpAddress = TRUE; - } else { - IPv6->StaticIpAddress = FALSE; - } - - StrToIPv6Addr (&LocalIPStr, &IPv6->LocalIpAddress); - - IPv6->LocalPort = 0; - IPv6->RemotePort = 0; - - return (EFI_DEVICE_PATH_PROTOCOL *) IPv6; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUart ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *BaudStr; - CHAR16 *DataBitsStr; - CHAR16 *ParityStr; - CHAR16 *StopBitsStr; - UART_DEVICE_PATH *Uart; - - BaudStr = GetNextParamStr (&TextDeviceNode); - DataBitsStr = GetNextParamStr (&TextDeviceNode); - ParityStr = GetNextParamStr (&TextDeviceNode); - StopBitsStr = GetNextParamStr (&TextDeviceNode); - Uart = (UART_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_UART_DP, - sizeof (UART_DEVICE_PATH) - ); - - Uart->BaudRate = (StrCmp (BaudStr, L"DEFAULT") == 0) ? 115200 : Atoi (BaudStr); - Uart->DataBits = (StrCmp (DataBitsStr, L"DEFAULT") == 0) ? (UINT8) 8 : (UINT8) Atoi (DataBitsStr); - switch (*ParityStr) { - case L'D': - Uart->Parity = 0; - break; - - case L'N': - Uart->Parity = 1; - break; - - case L'E': - Uart->Parity = 2; - break; - - case L'O': - Uart->Parity = 3; - break; - - case L'M': - Uart->Parity = 4; - break; - - case L'S': - Uart->Parity = 5; - - default: - Uart->Parity = 0xff; - } - - if (StrCmp (StopBitsStr, L"D") == 0) { - Uart->StopBits = (UINT8) 0; - } else if (StrCmp (StopBitsStr, L"1") == 0) { - Uart->StopBits = (UINT8) 1; - } else if (StrCmp (StopBitsStr, L"1.5") == 0) { - Uart->StopBits = (UINT8) 2; - } else if (StrCmp (StopBitsStr, L"2") == 0) { - Uart->StopBits = (UINT8) 3; - } else { - Uart->StopBits = 0xff; - } - - return (EFI_DEVICE_PATH_PROTOCOL *) Uart; -} - -EFI_DEVICE_PATH_PROTOCOL * -ConvertFromTextUsbClass ( - IN CHAR16 *TextDeviceNode, - IN USB_CLASS_TEXT *UsbClassText - ) -{ - CHAR16 *VIDStr; - CHAR16 *PIDStr; - CHAR16 *ClassStr; - CHAR16 *SubClassStr; - CHAR16 *ProtocolStr; - USB_CLASS_DEVICE_PATH *UsbClass; - - UsbClass = (USB_CLASS_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_USB_CLASS_DP, - sizeof (USB_CLASS_DEVICE_PATH) - ); - - VIDStr = GetNextParamStr (&TextDeviceNode); - PIDStr = GetNextParamStr (&TextDeviceNode); - if (UsbClassText->ClassExist) { - ClassStr = GetNextParamStr (&TextDeviceNode); - UsbClass->DeviceClass = (UINT8) Xtoi (ClassStr); - } else { - UsbClass->DeviceClass = UsbClassText->Class; - } - if (UsbClassText->SubClassExist) { - SubClassStr = GetNextParamStr (&TextDeviceNode); - UsbClass->DeviceSubClass = (UINT8) Xtoi (SubClassStr); - } else { - UsbClass->DeviceSubClass = UsbClassText->SubClass; - } - - ProtocolStr = GetNextParamStr (&TextDeviceNode); - - UsbClass->VendorId = (UINT16) Xtoi (VIDStr); - UsbClass->ProductId = (UINT16) Xtoi (PIDStr); - UsbClass->DeviceProtocol = (UINT8) Xtoi (ProtocolStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) UsbClass; -} - - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbClass ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = TRUE; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbAudio ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_AUDIO; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbCDCControl ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_CDCCONTROL; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbHID ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_HID; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbImage ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_IMAGE; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbPrinter ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_PRINTER; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbMassStorage ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_MASS_STORAGE; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbHub ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_HUB; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbCDCData ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_CDCDATA; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbSmartCard ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_SMART_CARD; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbVideo ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_VIDEO; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbDiagnostic ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_DIAGNOSTIC; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbWireless ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_WIRELESS; - UsbClassText.SubClassExist = TRUE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbDeviceFirmwareUpdate ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_RESERVE; - UsbClassText.SubClassExist = FALSE; - UsbClassText.SubClass = USB_SUBCLASS_FW_UPDATE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbIrdaBridge ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_RESERVE; - UsbClassText.SubClassExist = FALSE; - UsbClassText.SubClass = USB_SUBCLASS_IRDA_BRIDGE; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbTestAndMeasurement ( - IN CHAR16 *TextDeviceNode - ) -{ - USB_CLASS_TEXT UsbClassText; - - UsbClassText.ClassExist = FALSE; - UsbClassText.Class = USB_CLASS_RESERVE; - UsbClassText.SubClassExist = FALSE; - UsbClassText.SubClass = USB_SUBCLASS_TEST; - - return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUsbWwid ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *VIDStr; - CHAR16 *PIDStr; - CHAR16 *InterfaceNumStr; - USB_WWID_DEVICE_PATH *UsbWwid; - - VIDStr = GetNextParamStr (&TextDeviceNode); - PIDStr = GetNextParamStr (&TextDeviceNode); - InterfaceNumStr = GetNextParamStr (&TextDeviceNode); - UsbWwid = (USB_WWID_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_USB_WWID_DP, - sizeof (USB_WWID_DEVICE_PATH) - ); - - UsbWwid->VendorId = (UINT16) Xtoi (VIDStr); - UsbWwid->ProductId = (UINT16) Xtoi (PIDStr); - UsbWwid->InterfaceNumber = (UINT16) Xtoi (InterfaceNumStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) UsbWwid; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextUnit ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *LunStr; - DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; - - LunStr = GetNextParamStr (&TextDeviceNode); - LogicalUnit = (DEVICE_LOGICAL_UNIT_DEVICE_PATH *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_DEVICE_LOGICAL_UNIT_DP, - sizeof (DEVICE_LOGICAL_UNIT_DEVICE_PATH) - ); - - LogicalUnit->Lun = (UINT8) Xtoi (LunStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) LogicalUnit; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextiSCSI ( - IN CHAR16 *TextDeviceNode - ) -{ - UINT16 Options; - CHAR16 *NameStr; - CHAR16 *PortalGroupStr; - CHAR16 *LunStr; - CHAR16 *HeaderDigestStr; - CHAR16 *DataDigestStr; - CHAR16 *AuthenticationStr; - CHAR16 *ProtocolStr; - ISCSI_DEVICE_PATH_WITH_NAME *iSCSI; - - NameStr = GetNextParamStr (&TextDeviceNode); - PortalGroupStr = GetNextParamStr (&TextDeviceNode); - LunStr = GetNextParamStr (&TextDeviceNode); - HeaderDigestStr = GetNextParamStr (&TextDeviceNode); - DataDigestStr = GetNextParamStr (&TextDeviceNode); - AuthenticationStr = GetNextParamStr (&TextDeviceNode); - ProtocolStr = GetNextParamStr (&TextDeviceNode); - iSCSI = (ISCSI_DEVICE_PATH_WITH_NAME *) CreateDeviceNode ( - MESSAGING_DEVICE_PATH, - MSG_ISCSI_DP, - sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + (UINT16) (StrLen (NameStr) * 2) - ); - - StrCpy (iSCSI->iSCSITargetName, NameStr); - iSCSI->TargetPortalGroupTag = (UINT16) Xtoi (PortalGroupStr); - Xtoi64 (LunStr, &iSCSI->Lun); - - Options = 0x0000; - if (StrCmp (HeaderDigestStr, L"CRC32C") == 0) { - Options |= 0x0002; - } - - if (StrCmp (DataDigestStr, L"CRC32C") == 0) { - Options |= 0x0008; - } - - if (StrCmp (AuthenticationStr, L"None") == 0) { - Options |= 0x0800; - } - - if (StrCmp (AuthenticationStr, L"CHAP_UNI") == 0) { - Options |= 0x1000; - } - - iSCSI->LoginOption = (UINT16) Options; - - iSCSI->NetworkProtocol = (UINT16) StrCmp (ProtocolStr, L"TCP"); - iSCSI->Reserved = (UINT16) 0; - - return (EFI_DEVICE_PATH_PROTOCOL *) iSCSI; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextHD ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *PartitionStr; - CHAR16 *TypeStr; - CHAR16 *SignatureStr; - CHAR16 *StartStr; - CHAR16 *SizeStr; - UINT32 Signature32; - EFI_GUID SignatureGuid; - HARDDRIVE_DEVICE_PATH *Hd; - - PartitionStr = GetNextParamStr (&TextDeviceNode); - TypeStr = GetNextParamStr (&TextDeviceNode); - SignatureStr = GetNextParamStr (&TextDeviceNode); - StartStr = GetNextParamStr (&TextDeviceNode); - SizeStr = GetNextParamStr (&TextDeviceNode); - Hd = (HARDDRIVE_DEVICE_PATH *) CreateDeviceNode ( - MEDIA_DEVICE_PATH, - MEDIA_HARDDRIVE_DP, - sizeof (HARDDRIVE_DEVICE_PATH) - ); - - Hd->PartitionNumber = (UINT32) Atoi (PartitionStr); - - ZeroMem (Hd->Signature, 16); - Hd->MBRType = (UINT8) 0; - - if (StrCmp (TypeStr, L"None") == 0) { - Hd->SignatureType = (UINT8) 0; - } else if (StrCmp (TypeStr, L"MBR") == 0) { - Hd->SignatureType = SIGNATURE_TYPE_MBR; - Hd->MBRType = 0x01; - - Signature32 = (UINT32) Xtoi (SignatureStr); - CopyMem (Hd->Signature, &Signature32, sizeof (UINT32)); - } else if (StrCmp (TypeStr, L"GUID") == 0) { - Hd->SignatureType = SIGNATURE_TYPE_GUID; - Hd->MBRType = 0x02; - - StrToGuid (SignatureStr, &SignatureGuid); - CopyMem (Hd->Signature, &SignatureGuid, sizeof (EFI_GUID)); - } else { - Hd->SignatureType = 0xff; - - } - - Xtoi64 (StartStr, &Hd->PartitionStart); - Xtoi64 (SizeStr, &Hd->PartitionSize); - - return (EFI_DEVICE_PATH_PROTOCOL *) Hd; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextCDROM ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *EntryStr; - CHAR16 *StartStr; - CHAR16 *SizeStr; - CDROM_DEVICE_PATH *CDROM; - - EntryStr = GetNextParamStr (&TextDeviceNode); - StartStr = GetNextParamStr (&TextDeviceNode); - SizeStr = GetNextParamStr (&TextDeviceNode); - CDROM = (CDROM_DEVICE_PATH *) CreateDeviceNode ( - MEDIA_DEVICE_PATH, - MEDIA_CDROM_DP, - sizeof (CDROM_DEVICE_PATH) - ); - - CDROM->BootEntry = (UINT32) Xtoi (EntryStr); - Xtoi64 (StartStr, &CDROM->PartitionStart); - Xtoi64 (SizeStr, &CDROM->PartitionSize); - - return (EFI_DEVICE_PATH_PROTOCOL *) CDROM; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextVenMEDIA ( - IN CHAR16 *TextDeviceNode - ) -{ - return ConvertFromTextVendor ( - TextDeviceNode, - MEDIA_DEVICE_PATH, - MEDIA_VENDOR_DP - ); -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextFilePath ( - IN CHAR16 *TextDeviceNode - ) -{ - FILEPATH_DEVICE_PATH *File; - - File = (FILEPATH_DEVICE_PATH *) CreateDeviceNode ( - MEDIA_DEVICE_PATH, - MEDIA_FILEPATH_DP, - sizeof (FILEPATH_DEVICE_PATH) + (UINT16) (StrLen (TextDeviceNode) * 2) - ); - - StrCpy (File->PathName, TextDeviceNode); - - return (EFI_DEVICE_PATH_PROTOCOL *) File; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextMedia ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *GuidStr; - MEDIA_PROTOCOL_DEVICE_PATH *Media; - - GuidStr = GetNextParamStr (&TextDeviceNode); - Media = (MEDIA_PROTOCOL_DEVICE_PATH *) CreateDeviceNode ( - MEDIA_DEVICE_PATH, - MEDIA_PROTOCOL_DP, - sizeof (MEDIA_PROTOCOL_DEVICE_PATH) - ); - - StrToGuid (GuidStr, &Media->Protocol); - - return (EFI_DEVICE_PATH_PROTOCOL *) Media; -} - -EFI_DEVICE_PATH_PROTOCOL * -DevPathFromTextBBS ( - IN CHAR16 *TextDeviceNode - ) -{ - CHAR16 *TypeStr; - CHAR16 *IdStr; - CHAR16 *FlagsStr; - UINT8 *AsciiStr; - BBS_BBS_DEVICE_PATH *Bbs; - - TypeStr = GetNextParamStr (&TextDeviceNode); - IdStr = GetNextParamStr (&TextDeviceNode); - FlagsStr = GetNextParamStr (&TextDeviceNode); - Bbs = (BBS_BBS_DEVICE_PATH *) CreateDeviceNode ( - BBS_DEVICE_PATH, - BBS_BBS_DP, - sizeof (BBS_BBS_DEVICE_PATH) + (UINT16) (StrLen (IdStr)) - ); - - if (StrCmp (TypeStr, L"Floppy") == 0) { - Bbs->DeviceType = BBS_TYPE_FLOPPY; - } else if (StrCmp (TypeStr, L"HD") == 0) { - Bbs->DeviceType = BBS_TYPE_HARDDRIVE; - } else if (StrCmp (TypeStr, L"CDROM") == 0) { - Bbs->DeviceType = BBS_TYPE_CDROM; - } else if (StrCmp (TypeStr, L"PCMCIA") == 0) { - Bbs->DeviceType = BBS_TYPE_PCMCIA; - } else if (StrCmp (TypeStr, L"USB") == 0) { - Bbs->DeviceType = BBS_TYPE_USB; - } else if (StrCmp (TypeStr, L"Network") == 0) { - Bbs->DeviceType = BBS_TYPE_EMBEDDED_NETWORK; - } else { - Bbs->DeviceType = BBS_TYPE_UNKNOWN; - } - - AsciiStr = (UINT8 *) Bbs->String; - StrToAscii (IdStr, (CHAR8 **) &AsciiStr); - - Bbs->StatusFlag = (UINT16) Xtoi (FlagsStr); - - return (EFI_DEVICE_PATH_PROTOCOL *) Bbs; -} - -GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[] = { - {L"Pci", DevPathFromTextPci}, - {L"PcCard", DevPathFromTextPcCard}, - {L"MemoryMapped", DevPathFromTextMemoryMapped}, - {L"VenHw", DevPathFromTextVenHw}, - {L"Ctrl", DevPathFromTextCtrl}, - {L"Acpi", DevPathFromTextAcpi}, - {L"PciRoot", DevPathFromTextPciRoot}, - {L"Floppy", DevPathFromTextFloppy}, - {L"Keyboard", DevPathFromTextKeyboard}, - {L"Serial", DevPathFromTextSerial}, - {L"ParallelPort", DevPathFromTextParallelPort}, - {L"AcpiEx", DevPathFromTextAcpiEx}, - {L"AcpiExp", DevPathFromTextAcpiExp}, - {L"Ata", DevPathFromTextAta}, - {L"Scsi", DevPathFromTextScsi}, - {L"Fibre", DevPathFromTextFibre}, - {L"I1394", DevPathFromText1394}, - {L"USB", DevPathFromTextUsb}, - {L"I2O", DevPathFromTextI2O}, - {L"Infiniband", DevPathFromTextInfiniband}, - {L"VenMsg", DevPathFromTextVenMsg}, - {L"VenPcAnsi", DevPathFromTextVenPcAnsi}, - {L"VenVt100", DevPathFromTextVenVt100}, - {L"VenVt100Plus", DevPathFromTextVenVt100Plus}, - {L"VenUtf8", DevPathFromTextVenUtf8}, - {L"UartFlowCtrl", DevPathFromTextUartFlowCtrl}, - {L"SAS", DevPathFromTextSAS}, - {L"DebugPort", DevPathFromTextDebugPort}, - {L"MAC", DevPathFromTextMAC}, - {L"IPv4", DevPathFromTextIPv4}, - {L"IPv6", DevPathFromTextIPv6}, - {L"Uart", DevPathFromTextUart}, - {L"UsbClass", DevPathFromTextUsbClass}, - {L"UsbAudio", DevPathFromTextUsbAudio}, - {L"UsbCDCControl", DevPathFromTextUsbCDCControl}, - {L"UsbHID", DevPathFromTextUsbHID}, - {L"UsbImage", DevPathFromTextUsbImage}, - {L"UsbPrinter", DevPathFromTextUsbPrinter}, - {L"UsbMassStorage", DevPathFromTextUsbMassStorage}, - {L"UsbHub", DevPathFromTextUsbHub}, - {L"UsbCDCData", DevPathFromTextUsbCDCData}, - {L"UsbSmartCard", DevPathFromTextUsbSmartCard}, - {L"UsbVideo", DevPathFromTextUsbVideo}, - {L"UsbDiagnostic", DevPathFromTextUsbDiagnostic}, - {L"UsbWireless", DevPathFromTextUsbWireless}, - {L"UsbDeviceFirmwareUpdate", DevPathFromTextUsbDeviceFirmwareUpdate}, - {L"UsbIrdaBridge", DevPathFromTextUsbIrdaBridge}, - {L"UsbTestAndMeasurement", DevPathFromTextUsbTestAndMeasurement}, - {L"UsbWwid", DevPathFromTextUsbWwid}, - {L"Unit", DevPathFromTextUnit}, - {L"iSCSI", DevPathFromTextiSCSI}, - {L"HD", DevPathFromTextHD}, - {L"CDROM", DevPathFromTextCDROM}, - {L"VenMEDIA", DevPathFromTextVenMEDIA}, - {L"Media", DevPathFromTextMedia}, - {L"BBS", DevPathFromTextBBS}, - {NULL, NULL} -}; - -EFI_DEVICE_PATH_PROTOCOL * -ConvertTextToDeviceNode ( - IN CONST CHAR16 *TextDeviceNode - ) -/*++ - - Routine Description: - Convert text to the binary representation of a device node. - - Arguments: - TextDeviceNode - TextDeviceNode points to the text representation of a device - node. Conversion starts with the first character and continues - until the first non-device node character. - - Returns: - A pointer - Pointer to the EFI device node. - NULL - If TextDeviceNode is NULL or there was insufficient memory or text unsupported. - ---*/ -{ - EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *); - CHAR16 *ParamStr; - EFI_DEVICE_PATH_PROTOCOL *DeviceNode; - CHAR16 *DeviceNodeStr; - UINTN Index; - - if ((TextDeviceNode == NULL) || (IS_NULL (*TextDeviceNode))) { - return NULL; - } - - ParamStr = NULL; - DumpNode = NULL; - DeviceNodeStr = StrDuplicate (TextDeviceNode); - - for (Index = 0; DevPathFromTextTable[Index].Function; Index++) { - ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText); - if (ParamStr != NULL) { - DumpNode = DevPathFromTextTable[Index].Function; - break; - } - } - - if (DumpNode == NULL) { - // - // A file path - // - DumpNode = DevPathFromTextFilePath; - DeviceNode = DumpNode (DeviceNodeStr); - } else { - DeviceNode = DumpNode (ParamStr); - gBS->FreePool (ParamStr); - } - - gBS->FreePool (DeviceNodeStr); - - return DeviceNode; -} - -EFI_DEVICE_PATH_PROTOCOL * -ConvertTextToDevicePath ( - IN CONST CHAR16 *TextDevicePath - ) -/*++ - - Routine Description: - Convert text to the binary representation of a device path. - - Arguments: - TextDevicePath - TextDevicePath points to the text representation of a device - path. Conversion starts with the first character and continues - until the first non-device node character. - - Returns: - A pointer - Pointer to the allocated device path. - NULL - If TextDeviceNode is NULL or there was insufficient memory. - ---*/ -{ - EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *); - CHAR16 *ParamStr; - EFI_DEVICE_PATH_PROTOCOL *DeviceNode; - UINTN Index; - EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; - CHAR16 *DevicePathStr; - CHAR16 *Str; - CHAR16 *DeviceNodeStr; - UINT8 IsInstanceEnd; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - if ((TextDevicePath == NULL) || (IS_NULL (*TextDevicePath))) { - return NULL; - } - - DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); - SetDevicePathEndNode (DevicePath); - - ParamStr = NULL; - DeviceNodeStr = NULL; - DevicePathStr = StrDuplicate (TextDevicePath); - - Str = DevicePathStr; - while ((DeviceNodeStr = GetNextDeviceNodeStr (&Str, &IsInstanceEnd)) != NULL) { - DumpNode = NULL; - for (Index = 0; DevPathFromTextTable[Index].Function; Index++) { - ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText); - if (ParamStr != NULL) { - DumpNode = DevPathFromTextTable[Index].Function; - break; - } - } - - if (DumpNode == NULL) { - // - // A file path - // - DumpNode = DevPathFromTextFilePath; - DeviceNode = DumpNode (DeviceNodeStr); - } else { - DeviceNode = DumpNode (ParamStr); - gBS->FreePool (ParamStr); - } - - NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); - gBS->FreePool (DevicePath); - gBS->FreePool (DeviceNode); - DevicePath = NewDevicePath; - - if (IsInstanceEnd) { - DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); - SetDevicePathInstanceEndNode (DeviceNode); - - NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); - gBS->FreePool (DevicePath); - gBS->FreePool (DeviceNode); - DevicePath = NewDevicePath; - } - } - - gBS->FreePool (DevicePathStr); - return DevicePath; -} +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + DevicePathFromText.c + +Abstract: + + DevicePathFromText protocol as defined in the UEFI 2.0 specification. + +--*/ + +#include "DevicePath.h" + +CHAR16 * +StrDuplicate ( + IN CONST CHAR16 *Src + ) +/*++ + + Routine Description: + Duplicate a string + + Arguments: + Src - Source string + + Returns: + Duplicated string + +--*/ +{ + UINTN Length; + CHAR16 *ReturnStr; + + Length = StrLen ((CHAR16 *) Src); + + ReturnStr = AllocateCopyPool ((Length + 1) * sizeof (CHAR16), (VOID *) Src); + + return ReturnStr; +} + +CHAR16 * +GetParamByNodeName ( + IN CHAR16 *Str, + IN CHAR16 *NodeName + ) +/*++ + + Routine Description: + Get parameter in a pair of parentheses follow the given node name. + For example, given the "Pci(0,1)" and NodeName "Pci", it returns "0,1". + + Arguments: + Str - Device Path Text + NodeName - Name of the node + + Returns: + Parameter text for the node + +--*/ +{ + CHAR16 *ParamStr; + CHAR16 *StrPointer; + UINTN NodeNameLength; + UINTN ParameterLength; + + // + // Check whether the node name matchs + // + NodeNameLength = StrLen (NodeName); + if (CompareMem (Str, NodeName, NodeNameLength * sizeof (CHAR16)) != 0) { + return NULL; + } + + ParamStr = Str + NodeNameLength; + if (!IS_LEFT_PARENTH (*ParamStr)) { + return NULL; + } + + // + // Skip the found '(' and find first occurrence of ')' + // + ParamStr++; + ParameterLength = 0; + StrPointer = ParamStr; + while (!IS_NULL (*StrPointer)) { + if (IS_RIGHT_PARENTH (*StrPointer)) { + break; + } + StrPointer++; + ParameterLength++; + } + if (IS_NULL (*StrPointer)) { + // + // ')' not found + // + return NULL; + } + + ParamStr = AllocateCopyPool ((ParameterLength + 1) * sizeof (CHAR16), ParamStr); + if (ParamStr == NULL) { + return NULL; + } + // + // Terminate the parameter string + // + ParamStr[ParameterLength] = L'\0'; + + return ParamStr; +} + +CHAR16 * +SplitStr ( + IN OUT CHAR16 **List, + IN CHAR16 Separator + ) +/*++ + + Routine Description: + Get current sub-string from a string list, before return + the list header is moved to next sub-string. The sub-string is separated + by the specified character. For example, the separator is ',', the string + list is "2,0,3", it returns "2", the remain list move to "2,3" + + Arguments: + List - A string list separated by the specified separator + Separator - The separator character + + Returns: + pointer - The current sub-string + +--*/ +{ + CHAR16 *Str; + CHAR16 *ReturnStr; + + Str = *List; + ReturnStr = Str; + + if (IS_NULL (*Str)) { + return ReturnStr; + } + + // + // Find first occurrence of the separator + // + while (!IS_NULL (*Str)) { + if (*Str == Separator) { + break; + } + Str++; + } + + if (*Str == Separator) { + // + // Find a sub-string, terminate it + // + *Str = L'\0'; + Str++; + } + + // + // Move to next sub-string + // + *List = Str; + + return ReturnStr; +} + +CHAR16 * +GetNextParamStr ( + IN OUT CHAR16 **List + ) +{ + // + // The separator is comma + // + return SplitStr (List, L','); +} + +CHAR16 * +GetNextDeviceNodeStr ( + IN OUT CHAR16 **DevicePath, + OUT BOOLEAN *IsInstanceEnd + ) +/*++ + + Routine Description: + Get one device node from entire device path text. + + Arguments: + Str - The entire device path text string + IsInstanceEnd - This node is the end of a device path instance + + Returns: + a pointer - A device node text + NULL - No more device node available + +--*/ +{ + CHAR16 *Str; + CHAR16 *ReturnStr; + UINTN ParenthesesStack; + + Str = *DevicePath; + if (IS_NULL (*Str)) { + return NULL; + } + + // + // Skip the leading '/', '(', ')' and ',' + // + while (!IS_NULL (*Str)) { + if (!IS_SLASH (*Str) && + !IS_COMMA (*Str) && + !IS_LEFT_PARENTH (*Str) && + !IS_RIGHT_PARENTH (*Str)) { + break; + } + Str++; + } + + ReturnStr = Str; + + // + // Scan for the separator of this device node, '/' or ',' + // + ParenthesesStack = 0; + while (!IS_NULL (*Str)) { + if ((IS_COMMA (*Str) || IS_SLASH (*Str)) && (ParenthesesStack == 0)) { + break; + } + + if (IS_LEFT_PARENTH (*Str)) { + ParenthesesStack++; + } else if (IS_RIGHT_PARENTH (*Str)) { + ParenthesesStack--; + } + + Str++; + } + + if (ParenthesesStack != 0) { + // + // The '(' doesn't pair with ')', invalid device path text + // + return NULL; + } + + if (IS_COMMA (*Str)) { + *IsInstanceEnd = TRUE; + *Str = L'\0'; + Str++; + } else { + *IsInstanceEnd = FALSE; + if (!IS_NULL (*Str)) { + *Str = L'\0'; + Str++; + } + } + + *DevicePath = Str; + + return ReturnStr; +} + +BOOLEAN +IsHexDigit ( + OUT UINT8 *Digit, + IN CHAR16 Char + ) +/*++ + + Routine Description: + Determines if a Unicode character is a hexadecimal digit. + The test is case insensitive. + + Arguments: + Digit - Pointer to byte that receives the value of the hex character. + Char - Unicode character to test. + + Returns: + TRUE - If the character is a hexadecimal digit. + FALSE - Otherwise. + +--*/ +{ + if ((Char >= L'0') && (Char <= L'9')) { + *Digit = (UINT8) (Char - L'0'); + return TRUE; + } + + if ((Char >= L'A') && (Char <= L'F')) { + *Digit = (UINT8) (Char - L'A' + 0x0A); + return TRUE; + } + + if ((Char >= L'a') && (Char <= L'f')) { + *Digit = (UINT8) (Char - L'a' + 0x0A); + return TRUE; + } + + return FALSE; +} + +CHAR16 +NibbleToHexChar ( + IN UINT8 Nibble + ) +/*++ + + Routine Description: + Converts the low nibble of a byte to hex unicode character. + + Arguments: + Nibble - lower nibble of a byte. + + Returns: + Hex unicode character. + +--*/ +{ + Nibble &= 0x0F; + if (Nibble <= 0x9) { + return (CHAR16)(Nibble + L'0'); + } + + return (CHAR16)(Nibble - 0xA + L'A'); +} + +EFI_STATUS +HexStringToBuf ( + IN OUT UINT8 *Buf, + IN OUT UINTN *Len, + IN CHAR16 *Str, + OUT UINTN *ConvertedStrLen OPTIONAL + ) +/*++ + + Routine Description: + Converts Unicode string to binary buffer. + The conversion may be partial. + The first character in the string that is not hex digit stops the conversion. + At a minimum, any blob of data could be represented as a hex string. + + Arguments: + Buf - Pointer to buffer that receives the data. + Len - Length in bytes of the buffer to hold converted data. + If routine return with EFI_SUCCESS, containing length of converted data. + If routine return with EFI_BUFFER_TOO_SMALL, containg length of buffer desired. + Str - String to be converted from. + ConvertedStrLen - Length of the Hex String consumed. + + Returns: + EFI_SUCCESS: Routine Success. + EFI_BUFFER_TOO_SMALL: The buffer is too small to hold converted data. + EFI_ + +--*/ +{ + UINTN HexCnt; + UINTN Idx; + UINTN BufferLength; + UINT8 Digit; + UINT8 Byte; + + // + // Find out how many hex characters the string has. + // + for (Idx = 0, HexCnt = 0; IsHexDigit (&Digit, Str[Idx]); Idx++, HexCnt++); + + if (HexCnt == 0) { + *Len = 0; + return EFI_SUCCESS; + } + // + // Two Unicode characters make up 1 buffer byte. Round up. + // + BufferLength = (HexCnt + 1) / 2; + + // + // Test if buffer is passed enough. + // + if (BufferLength > (*Len)) { + *Len = BufferLength; + return EFI_BUFFER_TOO_SMALL; + } + + *Len = BufferLength; + + for (Idx = 0; Idx < HexCnt; Idx++) { + + IsHexDigit (&Digit, Str[HexCnt - 1 - Idx]); + + // + // For odd charaters, write the lower nibble for each buffer byte, + // and for even characters, the upper nibble. + // + if ((Idx & 1) == 0) { + Byte = Digit; + } else { + Byte = Buf[Idx / 2]; + Byte &= 0x0F; + Byte |= Digit << 4; + } + + Buf[Idx / 2] = Byte; + } + + if (ConvertedStrLen != NULL) { + *ConvertedStrLen = HexCnt; + } + + return EFI_SUCCESS; +} + +EFI_STATUS +BufToHexString ( + IN OUT CHAR16 *Str, + IN OUT UINTN *HexStringBufferLength, + IN UINT8 *Buf, + IN UINTN Len + ) +/*++ + + Routine Description: + Converts binary buffer to Unicode string. + At a minimum, any blob of data could be represented as a hex string. + + Arguments: + Str - Pointer to the string. + HexStringBufferLength - Length in bytes of buffer to hold the hex string. Includes tailing '\0' character. + If routine return with EFI_SUCCESS, containing length of hex string buffer. + If routine return with EFI_BUFFER_TOO_SMALL, containg length of hex string buffer desired. + Buf - Buffer to be converted from. + Len - Length in bytes of the buffer to be converted. + + Returns: + EFI_SUCCESS: Routine success. + EFI_BUFFER_TOO_SMALL: The hex string buffer is too small. + +--*/ +{ + UINTN Idx; + UINT8 Byte; + UINTN StrLen; + + // + // Make sure string is either passed or allocate enough. + // It takes 2 Unicode characters (4 bytes) to represent 1 byte of the binary buffer. + // Plus the Unicode termination character. + // + StrLen = Len * 2; + if (StrLen > ((*HexStringBufferLength) - 1)) { + *HexStringBufferLength = StrLen + 1; + return EFI_BUFFER_TOO_SMALL; + } + + *HexStringBufferLength = StrLen + 1; + // + // Ends the string. + // + Str[StrLen] = L'\0'; + + for (Idx = 0; Idx < Len; Idx++) { + + Byte = Buf[Idx]; + Str[StrLen - 1 - Idx * 2] = NibbleToHexChar (Byte); + Str[StrLen - 2 - Idx * 2] = NibbleToHexChar ((UINT8)(Byte >> 4)); + } + + return EFI_SUCCESS; +} + +CHAR16 * +TrimHexStr ( + IN CHAR16 *Str + ) +/*++ + + Routine Description: + Skip the leading white space and '0x' or '0X' of a hex string + + Arguments: + Str - The hex string + + Returns: + +--*/ +{ + // + // skip preceeding white space + // + while (*Str && *Str == ' ') { + Str += 1; + } + // + // skip preceeding zeros + // + while (*Str && *Str == '0') { + Str += 1; + } + // + // skip preceeding white space + // + if (*Str && (*Str == 'x' || *Str == 'X')) { + Str += 1; + } + + return Str; +} + +UINTN +Xtoi ( + IN CHAR16 *Str + ) +/*++ + +Routine Description: + + Convert hex string to uint + +Arguments: + + Str - The string + +Returns: + +--*/ +{ + UINTN Rvalue; + UINTN Length; + + ASSERT (Str != NULL); + + // + // convert hex digits + // + Rvalue = 0; + Length = sizeof (UINTN); + HexStringToBuf ((UINT8 *) &Rvalue, &Length, TrimHexStr (Str), NULL); + + return Rvalue; +} + +VOID +Xtoi64 ( + IN CHAR16 *Str, + IN UINT64 *Data + ) +/*++ + +Routine Description: + + Convert hex string to 64 bit data. + +Arguments: + + Str - The string + +Returns: + +--*/ +{ + UINTN Length; + + *Data = 0; + Length = sizeof (UINT64); + HexStringToBuf ((UINT8 *) Data, &Length, TrimHexStr (Str), NULL); +} + +UINTN +Atoi ( + IN CHAR16 *str + ) +/*++ + +Routine Description: + + Convert decimal string to uint + +Arguments: + + Str - The string + +Returns: + +--*/ +{ + UINTN Rvalue; + CHAR16 Char; + UINTN High; + UINTN Low; + + ASSERT (str != NULL); + + High = (UINTN) -1 / 10; + Low = (UINTN) -1 % 10; + // + // skip preceeding white space + // + while (*str && *str == ' ') { + str += 1; + } + // + // convert digits + // + Rvalue = 0; + Char = *(str++); + while (Char) { + if (Char >= '0' && Char <= '9') { + if ((Rvalue > High || Rvalue == High) && (Char - '0' > (INTN) Low)) { + return (UINTN) -1; + } + + Rvalue = (Rvalue * 10) + Char - '0'; + } else { + break; + } + + Char = *(str++); + } + + return Rvalue; +} + +EFI_STATUS +StrToBuf ( + OUT UINT8 *Buf, + IN UINTN BufferLength, + IN CHAR16 *Str + ) +{ + UINTN Index; + UINTN StrLength; + UINT8 Digit; + UINT8 Byte; + + // + // Two hex char make up one byte + // + StrLength = BufferLength * sizeof (CHAR16); + + for(Index = 0; Index < StrLength; Index++, Str++) { + + IsHexDigit (&Digit, *Str); + + // + // For odd charaters, write the upper nibble for each buffer byte, + // and for even characters, the lower nibble. + // + if ((Index & 1) == 0) { + Byte = Digit << 4; + } else { + Byte = Buf[Index / 2]; + Byte &= 0xF0; + Byte |= Digit; + } + + Buf[Index / 2] = Byte; + } + + return EFI_SUCCESS; +} + +EFI_STATUS +StrToGuid ( + IN CHAR16 *Str, + OUT EFI_GUID *Guid + ) +{ + UINTN BufferLength; + UINTN ConvertedStrLen; + EFI_STATUS Status; + + BufferLength = sizeof (Guid->Data1); + Status = HexStringToBuf ((UINT8 *) &Guid->Data1, &BufferLength, Str, &ConvertedStrLen); + if (EFI_ERROR (Status)) { + return Status; + } + Str += ConvertedStrLen; + if (IS_HYPHEN (*Str)) { + Str++; + } else { + return EFI_UNSUPPORTED; + } + + BufferLength = sizeof (Guid->Data2); + Status = HexStringToBuf ((UINT8 *) &Guid->Data2, &BufferLength, Str, &ConvertedStrLen); + if (EFI_ERROR (Status)) { + return Status; + } + Str += ConvertedStrLen; + if (IS_HYPHEN (*Str)) { + Str++; + } else { + return EFI_UNSUPPORTED; + } + + BufferLength = sizeof (Guid->Data3); + Status = HexStringToBuf ((UINT8 *) &Guid->Data3, &BufferLength, Str, &ConvertedStrLen); + if (EFI_ERROR (Status)) { + return Status; + } + Str += ConvertedStrLen; + if (IS_HYPHEN (*Str)) { + Str++; + } else { + return EFI_UNSUPPORTED; + } + + StrToBuf (&Guid->Data4[0], 2, Str); + // + // Skip 2 byte hex chars + // + Str += 2 * 2; + + if (IS_HYPHEN (*Str)) { + Str++; + } else { + return EFI_UNSUPPORTED; + } + StrToBuf (&Guid->Data4[2], 6, Str); + + return EFI_SUCCESS; +} + +VOID +StrToIPv4Addr ( + IN OUT CHAR16 **Str, + OUT EFI_IPv4_ADDRESS *IPv4Addr + ) +{ + UINTN Index; + + for (Index = 0; Index < 4; Index++) { + IPv4Addr->Addr[Index] = (UINT8) Atoi (SplitStr (Str, L'.')); + } +} + +VOID +StrToIPv6Addr ( + IN OUT CHAR16 **Str, + OUT EFI_IPv6_ADDRESS *IPv6Addr + ) +{ + UINTN Index; + UINT16 Data; + + for (Index = 0; Index < 8; Index++) { + Data = (UINT16) Xtoi (SplitStr (Str, L':')); + IPv6Addr->Addr[Index * 2] = (UINT8) (Data >> 8); + IPv6Addr->Addr[Index * 2 + 1] = (UINT8) (Data & 0xff); + } +} + +VOID +StrToAscii ( + IN CHAR16 *Str, + IN OUT CHAR8 **AsciiStr + ) +{ + CHAR8 *Dest; + + Dest = *AsciiStr; + while (!IS_NULL (*Str)) { + *(Dest++) = (CHAR8) *(Str++); + } + *Dest = 0; + + // + // Return the string next to it + // + *AsciiStr = Dest + 1; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextPci ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *FunctionStr; + CHAR16 *DeviceStr; + PCI_DEVICE_PATH *Pci; + + FunctionStr = GetNextParamStr (&TextDeviceNode); + DeviceStr = GetNextParamStr (&TextDeviceNode); + Pci = (PCI_DEVICE_PATH *) CreateDeviceNode ( + HARDWARE_DEVICE_PATH, + HW_PCI_DP, + sizeof (PCI_DEVICE_PATH) + ); + + Pci->Function = (UINT8) Xtoi (FunctionStr); + Pci->Device = (UINT8) Xtoi (DeviceStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Pci; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextPcCard ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *FunctionNumberStr; + PCCARD_DEVICE_PATH *Pccard; + + FunctionNumberStr = GetNextParamStr (&TextDeviceNode); + Pccard = (PCCARD_DEVICE_PATH *) CreateDeviceNode ( + HARDWARE_DEVICE_PATH, + HW_PCCARD_DP, + sizeof (PCCARD_DEVICE_PATH) + ); + + Pccard->FunctionNumber = (UINT8) Xtoi (FunctionNumberStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Pccard; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextMemoryMapped ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *StartingAddressStr; + CHAR16 *EndingAddressStr; + MEMMAP_DEVICE_PATH *MemMap; + + StartingAddressStr = GetNextParamStr (&TextDeviceNode); + EndingAddressStr = GetNextParamStr (&TextDeviceNode); + MemMap = (MEMMAP_DEVICE_PATH *) CreateDeviceNode ( + HARDWARE_DEVICE_PATH, + HW_MEMMAP_DP, + sizeof (MEMMAP_DEVICE_PATH) + ); + + MemMap->MemoryType = 0; + + Xtoi64 (StartingAddressStr, &MemMap->StartingAddress); + Xtoi64 (EndingAddressStr, &MemMap->EndingAddress); + + return (EFI_DEVICE_PATH_PROTOCOL *) MemMap; +} + +EFI_DEVICE_PATH_PROTOCOL * +ConvertFromTextVendor ( + IN CHAR16 *TextDeviceNode, + IN UINT8 Type, + IN UINT8 SubType + ) +{ + CHAR16 *GuidStr; + CHAR16 *DataStr; + UINTN Length; + VENDOR_DEVICE_PATH *Vendor; + + GuidStr = GetNextParamStr (&TextDeviceNode); + + DataStr = GetNextParamStr (&TextDeviceNode); + Length = StrLen (DataStr); + // + // Two hex characters make up 1 buffer byte + // + Length = (Length + 1) / 2; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + Type, + SubType, + sizeof (VENDOR_DEVICE_PATH) + (UINT16) Length + ); + + StrToGuid (GuidStr, &Vendor->Guid); + StrToBuf (((UINT8 *) Vendor) + sizeof (VENDOR_DEVICE_PATH), Length, DataStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenHw ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextVendor ( + TextDeviceNode, + HARDWARE_DEVICE_PATH, + HW_VENDOR_DP + ); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextCtrl ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *ControllerStr; + CONTROLLER_DEVICE_PATH *Controller; + + ControllerStr = GetNextParamStr (&TextDeviceNode); + Controller = (CONTROLLER_DEVICE_PATH *) CreateDeviceNode ( + HARDWARE_DEVICE_PATH, + HW_CONTROLLER_DP, + sizeof (CONTROLLER_DEVICE_PATH) + ); + Controller->ControllerNumber = (UINT32) Xtoi (ControllerStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Controller; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextAcpi ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *HIDStr; + CHAR16 *UIDStr; + ACPI_HID_DEVICE_PATH *Acpi; + + HIDStr = GetNextParamStr (&TextDeviceNode); + UIDStr = GetNextParamStr (&TextDeviceNode); + Acpi = (ACPI_HID_DEVICE_PATH *) CreateDeviceNode ( + ACPI_DEVICE_PATH, + ACPI_DP, + sizeof (ACPI_HID_DEVICE_PATH) + ); + + if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { + HIDStr += 3; + } + + Acpi->HID = EISA_PNP_ID (Xtoi (HIDStr)); + Acpi->UID = (UINT32) Xtoi (UIDStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Acpi; +} + +EFI_DEVICE_PATH_PROTOCOL * +ConvertFromTextAcpi ( + IN CHAR16 *TextDeviceNode, + IN UINT32 Hid + ) +{ + CHAR16 *UIDStr; + ACPI_HID_DEVICE_PATH *Acpi; + + UIDStr = GetNextParamStr (&TextDeviceNode); + Acpi = (ACPI_HID_DEVICE_PATH *) CreateDeviceNode ( + ACPI_DEVICE_PATH, + ACPI_DP, + sizeof (ACPI_HID_DEVICE_PATH) + ); + + Acpi->HID = Hid; + Acpi->UID = (UINT32) Xtoi (UIDStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Acpi; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextPciRoot ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextAcpi (TextDeviceNode, 0x0a0341d0); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextFloppy ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextAcpi (TextDeviceNode, 0x060441d0); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextKeyboard ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextAcpi (TextDeviceNode, 0x030141d0); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextSerial ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextAcpi (TextDeviceNode, 0x050141d0); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextParallelPort ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextAcpi (TextDeviceNode, 0x040141d0); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextAcpiEx ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *HIDStr; + CHAR16 *CIDStr; + CHAR16 *UIDStr; + CHAR16 *HIDSTRStr; + CHAR16 *CIDSTRStr; + CHAR16 *UIDSTRStr; + CHAR8 *AsciiStr; + UINT16 Length; + ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExt; + + HIDStr = GetNextParamStr (&TextDeviceNode); + CIDStr = GetNextParamStr (&TextDeviceNode); + UIDStr = GetNextParamStr (&TextDeviceNode); + HIDSTRStr = GetNextParamStr (&TextDeviceNode); + CIDSTRStr = GetNextParamStr (&TextDeviceNode); + UIDSTRStr = GetNextParamStr (&TextDeviceNode); + Length = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + + (UINT16) StrLen (HIDSTRStr) + 1 + + (UINT16) StrLen (UIDSTRStr) + 1 + + (UINT16) StrLen (CIDSTRStr) + 1; + AcpiExt = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) CreateDeviceNode ( + ACPI_DEVICE_PATH, + ACPI_EXTENDED_DP, + Length + ); + + if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { + HIDStr += 3; + AcpiExt->HID = EISA_PNP_ID (Xtoi (HIDStr)); + } else { + AcpiExt->HID = (UINT32) Xtoi (HIDStr); + } + + AcpiExt->UID = (UINT32) Xtoi (UIDStr); + AcpiExt->CID = (UINT32) Xtoi (CIDStr); + + AsciiStr = AcpiExt->HidUidCidStr; + StrToAscii (HIDSTRStr, &AsciiStr); + StrToAscii (UIDSTRStr, &AsciiStr); + StrToAscii (CIDSTRStr, &AsciiStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextAcpiExp ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *HIDStr; + CHAR16 *CIDStr; + CHAR16 *UIDSTRStr; + CHAR8 *AsciiStr; + UINT16 Length; + ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *AcpiExt; + + HIDStr = GetNextParamStr (&TextDeviceNode); + CIDStr = GetNextParamStr (&TextDeviceNode); + UIDSTRStr = GetNextParamStr (&TextDeviceNode); + Length = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH) + (UINT16) StrLen (UIDSTRStr) + 3; + AcpiExt = (ACPI_EXTENDED_HID_DEVICE_PATH_WITH_STR *) CreateDeviceNode ( + ACPI_DEVICE_PATH, + ACPI_EXTENDED_DP, + Length + ); + + if ((HIDStr[0] == L'P') && (HIDStr[1] == L'N') && (HIDStr[2] == L'P')) { + HIDStr += 3; + AcpiExt->HID = EISA_PNP_ID (Xtoi (HIDStr)); + } else { + AcpiExt->HID = (UINT32) Xtoi (HIDStr); + } + + AcpiExt->UID = 0; + AcpiExt->CID = (UINT32) Xtoi (CIDStr); + + AsciiStr = AcpiExt->HidUidCidStr; + // + // HID string is NULL + // + *AsciiStr = 0; + // + // Convert UID string + // + AsciiStr++; + StrToAscii (UIDSTRStr, &AsciiStr); + // + // CID string is NULL + // + *AsciiStr = 0; + + return (EFI_DEVICE_PATH_PROTOCOL *) AcpiExt; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextAta ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *PrimarySecondaryStr; + CHAR16 *SlaveMasterStr; + CHAR16 *LunStr; + ATAPI_DEVICE_PATH *Atapi; + + Atapi = (ATAPI_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_ATAPI_DP, + sizeof (ATAPI_DEVICE_PATH) + ); + + PrimarySecondaryStr = GetNextParamStr (&TextDeviceNode); + SlaveMasterStr = GetNextParamStr (&TextDeviceNode); + LunStr = GetNextParamStr (&TextDeviceNode); + + Atapi->PrimarySecondary = (StrCmp (PrimarySecondaryStr, L"Primary") == 0) ? (UINT8) 0 : (UINT8) 1; + Atapi->SlaveMaster = (StrCmp (SlaveMasterStr, L"Master") == 0) ? (UINT8) 0 : (UINT8) 1; + Atapi->Lun = (UINT16) Xtoi (LunStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Atapi; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextScsi ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *PunStr; + CHAR16 *LunStr; + SCSI_DEVICE_PATH *Scsi; + + PunStr = GetNextParamStr (&TextDeviceNode); + LunStr = GetNextParamStr (&TextDeviceNode); + Scsi = (SCSI_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_SCSI_DP, + sizeof (SCSI_DEVICE_PATH) + ); + + Scsi->Pun = (UINT16) Xtoi (PunStr); + Scsi->Lun = (UINT16) Xtoi (LunStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Scsi; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextFibre ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *WWNStr; + CHAR16 *LunStr; + FIBRECHANNEL_DEVICE_PATH *Fibre; + + WWNStr = GetNextParamStr (&TextDeviceNode); + LunStr = GetNextParamStr (&TextDeviceNode); + Fibre = (FIBRECHANNEL_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_FIBRECHANNEL_DP, + sizeof (FIBRECHANNEL_DEVICE_PATH) + ); + + Fibre->Reserved = 0; + Xtoi64 (WWNStr, &Fibre->WWN); + Xtoi64 (LunStr, &Fibre->Lun); + + return (EFI_DEVICE_PATH_PROTOCOL *) Fibre; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromText1394 ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *GuidStr; + F1394_DEVICE_PATH *F1394; + + GuidStr = GetNextParamStr (&TextDeviceNode); + F1394 = (F1394_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_1394_DP, + sizeof (F1394_DEVICE_PATH) + ); + + F1394->Reserved = 0; + Xtoi64 (GuidStr, &F1394->Guid); + + return (EFI_DEVICE_PATH_PROTOCOL *) F1394; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsb ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *PortStr; + CHAR16 *InterfaceStr; + USB_DEVICE_PATH *Usb; + + PortStr = GetNextParamStr (&TextDeviceNode); + InterfaceStr = GetNextParamStr (&TextDeviceNode); + Usb = (USB_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_USB_DP, + sizeof (USB_DEVICE_PATH) + ); + + Usb->ParentPortNumber = (UINT8) Xtoi (PortStr); + Usb->InterfaceNumber = (UINT8) Xtoi (InterfaceStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Usb; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextI2O ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *TIDStr; + I2O_DEVICE_PATH *I2O; + + TIDStr = GetNextParamStr (&TextDeviceNode); + I2O = (I2O_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_I2O_DP, + sizeof (I2O_DEVICE_PATH) + ); + + I2O->Tid = (UINT32) Xtoi (TIDStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) I2O; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextInfiniband ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *FlagsStr; + CHAR16 *GuidStr; + CHAR16 *SidStr; + CHAR16 *TidStr; + CHAR16 *DidStr; + EFI_GUID PortGid; + INFINIBAND_DEVICE_PATH *InfiniBand; + + FlagsStr = GetNextParamStr (&TextDeviceNode); + GuidStr = GetNextParamStr (&TextDeviceNode); + SidStr = GetNextParamStr (&TextDeviceNode); + TidStr = GetNextParamStr (&TextDeviceNode); + DidStr = GetNextParamStr (&TextDeviceNode); + InfiniBand = (INFINIBAND_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_INFINIBAND_DP, + sizeof (INFINIBAND_DEVICE_PATH) + ); + + InfiniBand->ResourceFlags = (UINT32) Xtoi (FlagsStr); + StrToGuid (GuidStr, &PortGid); + CopyMem (InfiniBand->PortGid, &PortGid, sizeof (EFI_GUID)); + Xtoi64 (SidStr, &InfiniBand->ServiceId); + Xtoi64 (TidStr, &InfiniBand->TargetPortId); + Xtoi64 (DidStr, &InfiniBand->DeviceId); + + return (EFI_DEVICE_PATH_PROTOCOL *) InfiniBand; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenMsg ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextVendor ( + TextDeviceNode, + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP + ); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenPcAnsi ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEVICE_PATH *Vendor; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (VENDOR_DEVICE_PATH)); + CopyGuid (&Vendor->Guid, &gEfiPcAnsiGuid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenVt100 ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEVICE_PATH *Vendor; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (VENDOR_DEVICE_PATH)); + CopyGuid (&Vendor->Guid, &gEfiVT100Guid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenVt100Plus ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEVICE_PATH *Vendor; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (VENDOR_DEVICE_PATH)); + CopyGuid (&Vendor->Guid, &gEfiVT100PlusGuid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenUtf8 ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEVICE_PATH *Vendor; + + Vendor = (VENDOR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (VENDOR_DEVICE_PATH)); + CopyGuid (&Vendor->Guid, &gEfiVTUTF8Guid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vendor; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUartFlowCtrl ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *ValueStr; + UART_FLOW_CONTROL_DEVICE_PATH *UartFlowControl; + + ValueStr = GetNextParamStr (&TextDeviceNode); + UartFlowControl = (UART_FLOW_CONTROL_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (UART_FLOW_CONTROL_DEVICE_PATH) + ); + + CopyGuid (&UartFlowControl->Guid, &mEfiDevicePathMessagingUartFlowControlGuid); + if (StrCmp (ValueStr, L"XonXoff") == 0) { + UartFlowControl->FlowControlMap = 2; + } else if (StrCmp (ValueStr, L"Hardware") == 0) { + UartFlowControl->FlowControlMap = 1; + } else { + UartFlowControl->FlowControlMap = 0; + } + + return (EFI_DEVICE_PATH_PROTOCOL *) UartFlowControl; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextSAS ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *AddressStr; + CHAR16 *LunStr; + CHAR16 *RTPStr; + CHAR16 *SASSATAStr; + CHAR16 *LocationStr; + CHAR16 *ConnectStr; + CHAR16 *DriveBayStr; + CHAR16 *ReservedStr; + UINT16 Info; + SAS_DEVICE_PATH *Sas; + + AddressStr = GetNextParamStr (&TextDeviceNode); + LunStr = GetNextParamStr (&TextDeviceNode); + RTPStr = GetNextParamStr (&TextDeviceNode); + SASSATAStr = GetNextParamStr (&TextDeviceNode); + LocationStr = GetNextParamStr (&TextDeviceNode); + ConnectStr = GetNextParamStr (&TextDeviceNode); + DriveBayStr = GetNextParamStr (&TextDeviceNode); + ReservedStr = GetNextParamStr (&TextDeviceNode); + Info = 0x0000; + Sas = (SAS_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (SAS_DEVICE_PATH) + ); + + CopyGuid (&Sas->Guid, &mEfiDevicePathMessagingSASGuid); + Xtoi64 (AddressStr, &Sas->SasAddress); + Xtoi64 (LunStr, &Sas->Lun); + Sas->RelativeTargetPort = (UINT16) Xtoi (RTPStr); + if (StrCmp (SASSATAStr, L"NoTopology") == 0) + ; + else { + if (StrCmp (DriveBayStr, L"0") == 0) { + Info |= 0x0001; + } else { + Info |= 0x0002; + Info |= (Xtoi (DriveBayStr) << 8); + } + + if (StrCmp (SASSATAStr, L"SATA") == 0) { + Info |= 0x0010; + } + + if (StrCmp (LocationStr, L"External") == 0) { + Info |= 0x0020; + } + + if (StrCmp (ConnectStr, L"Expanded") == 0) { + Info |= 0x0040; + } + } + + Sas->DeviceTopology = Info; + Sas->Reserved = (UINT32) Xtoi (ReservedStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Sas; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextDebugPort ( + IN CHAR16 *TextDeviceNode + ) +{ + VENDOR_DEFINED_MESSAGING_DEVICE_PATH *Vend; + + Vend = (VENDOR_DEFINED_MESSAGING_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_VENDOR_DP, + sizeof (VENDOR_DEFINED_MESSAGING_DEVICE_PATH) + ); + + CopyGuid (&Vend->Guid, &gEfiDebugPortProtocolGuid); + + return (EFI_DEVICE_PATH_PROTOCOL *) Vend; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextMAC ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *AddressStr; + CHAR16 *IfTypeStr; + UINTN Length; + MAC_ADDR_DEVICE_PATH *MAC; + + AddressStr = GetNextParamStr (&TextDeviceNode); + IfTypeStr = GetNextParamStr (&TextDeviceNode); + MAC = (MAC_ADDR_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_MAC_ADDR_DP, + sizeof (MAC_ADDR_DEVICE_PATH) + ); + + MAC->IfType = (UINT8) Xtoi (IfTypeStr); + + Length = sizeof (EFI_MAC_ADDRESS); + StrToBuf (&MAC->MacAddress.Addr[0], Length, AddressStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) MAC; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextIPv4 ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *RemoteIPStr; + CHAR16 *ProtocolStr; + CHAR16 *TypeStr; + CHAR16 *LocalIPStr; + IPv4_DEVICE_PATH *IPv4; + + RemoteIPStr = GetNextParamStr (&TextDeviceNode); + ProtocolStr = GetNextParamStr (&TextDeviceNode); + TypeStr = GetNextParamStr (&TextDeviceNode); + LocalIPStr = GetNextParamStr (&TextDeviceNode); + IPv4 = (IPv4_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_IPv4_DP, + sizeof (IPv4_DEVICE_PATH) + ); + + StrToIPv4Addr (&RemoteIPStr, &IPv4->RemoteIpAddress); + IPv4->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1; + if (StrCmp (TypeStr, L"Static") == 0) { + IPv4->StaticIpAddress = TRUE; + } else { + IPv4->StaticIpAddress = FALSE; + } + + StrToIPv4Addr (&LocalIPStr, &IPv4->LocalIpAddress); + + IPv4->LocalPort = 0; + IPv4->RemotePort = 0; + + return (EFI_DEVICE_PATH_PROTOCOL *) IPv4; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextIPv6 ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *RemoteIPStr; + CHAR16 *ProtocolStr; + CHAR16 *TypeStr; + CHAR16 *LocalIPStr; + IPv6_DEVICE_PATH *IPv6; + + RemoteIPStr = GetNextParamStr (&TextDeviceNode); + ProtocolStr = GetNextParamStr (&TextDeviceNode); + TypeStr = GetNextParamStr (&TextDeviceNode); + LocalIPStr = GetNextParamStr (&TextDeviceNode); + IPv6 = (IPv6_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_IPv6_DP, + sizeof (IPv6_DEVICE_PATH) + ); + + StrToIPv6Addr (&RemoteIPStr, &IPv6->RemoteIpAddress); + IPv6->Protocol = (StrCmp (ProtocolStr, L"UDP") == 0) ? (UINT16) 0 : (UINT16) 1; + if (StrCmp (TypeStr, L"Static") == 0) { + IPv6->StaticIpAddress = TRUE; + } else { + IPv6->StaticIpAddress = FALSE; + } + + StrToIPv6Addr (&LocalIPStr, &IPv6->LocalIpAddress); + + IPv6->LocalPort = 0; + IPv6->RemotePort = 0; + + return (EFI_DEVICE_PATH_PROTOCOL *) IPv6; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUart ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *BaudStr; + CHAR16 *DataBitsStr; + CHAR16 *ParityStr; + CHAR16 *StopBitsStr; + UART_DEVICE_PATH *Uart; + + BaudStr = GetNextParamStr (&TextDeviceNode); + DataBitsStr = GetNextParamStr (&TextDeviceNode); + ParityStr = GetNextParamStr (&TextDeviceNode); + StopBitsStr = GetNextParamStr (&TextDeviceNode); + Uart = (UART_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_UART_DP, + sizeof (UART_DEVICE_PATH) + ); + + Uart->BaudRate = (StrCmp (BaudStr, L"DEFAULT") == 0) ? 115200 : Atoi (BaudStr); + Uart->DataBits = (StrCmp (DataBitsStr, L"DEFAULT") == 0) ? (UINT8) 8 : (UINT8) Atoi (DataBitsStr); + switch (*ParityStr) { + case L'D': + Uart->Parity = 0; + break; + + case L'N': + Uart->Parity = 1; + break; + + case L'E': + Uart->Parity = 2; + break; + + case L'O': + Uart->Parity = 3; + break; + + case L'M': + Uart->Parity = 4; + break; + + case L'S': + Uart->Parity = 5; + + default: + Uart->Parity = 0xff; + } + + if (StrCmp (StopBitsStr, L"D") == 0) { + Uart->StopBits = (UINT8) 0; + } else if (StrCmp (StopBitsStr, L"1") == 0) { + Uart->StopBits = (UINT8) 1; + } else if (StrCmp (StopBitsStr, L"1.5") == 0) { + Uart->StopBits = (UINT8) 2; + } else if (StrCmp (StopBitsStr, L"2") == 0) { + Uart->StopBits = (UINT8) 3; + } else { + Uart->StopBits = 0xff; + } + + return (EFI_DEVICE_PATH_PROTOCOL *) Uart; +} + +EFI_DEVICE_PATH_PROTOCOL * +ConvertFromTextUsbClass ( + IN CHAR16 *TextDeviceNode, + IN USB_CLASS_TEXT *UsbClassText + ) +{ + CHAR16 *VIDStr; + CHAR16 *PIDStr; + CHAR16 *ClassStr; + CHAR16 *SubClassStr; + CHAR16 *ProtocolStr; + USB_CLASS_DEVICE_PATH *UsbClass; + + UsbClass = (USB_CLASS_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_USB_CLASS_DP, + sizeof (USB_CLASS_DEVICE_PATH) + ); + + VIDStr = GetNextParamStr (&TextDeviceNode); + PIDStr = GetNextParamStr (&TextDeviceNode); + if (UsbClassText->ClassExist) { + ClassStr = GetNextParamStr (&TextDeviceNode); + UsbClass->DeviceClass = (UINT8) Xtoi (ClassStr); + } else { + UsbClass->DeviceClass = UsbClassText->Class; + } + if (UsbClassText->SubClassExist) { + SubClassStr = GetNextParamStr (&TextDeviceNode); + UsbClass->DeviceSubClass = (UINT8) Xtoi (SubClassStr); + } else { + UsbClass->DeviceSubClass = UsbClassText->SubClass; + } + + ProtocolStr = GetNextParamStr (&TextDeviceNode); + + UsbClass->VendorId = (UINT16) Xtoi (VIDStr); + UsbClass->ProductId = (UINT16) Xtoi (PIDStr); + UsbClass->DeviceProtocol = (UINT8) Xtoi (ProtocolStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) UsbClass; +} + + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbClass ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = TRUE; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbAudio ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_AUDIO; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbCDCControl ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_CDCCONTROL; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbHID ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_HID; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbImage ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_IMAGE; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbPrinter ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_PRINTER; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbMassStorage ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_MASS_STORAGE; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbHub ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_HUB; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbCDCData ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_CDCDATA; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbSmartCard ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_SMART_CARD; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbVideo ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_VIDEO; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbDiagnostic ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_DIAGNOSTIC; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbWireless ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_WIRELESS; + UsbClassText.SubClassExist = TRUE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbDeviceFirmwareUpdate ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_RESERVE; + UsbClassText.SubClassExist = FALSE; + UsbClassText.SubClass = USB_SUBCLASS_FW_UPDATE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbIrdaBridge ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_RESERVE; + UsbClassText.SubClassExist = FALSE; + UsbClassText.SubClass = USB_SUBCLASS_IRDA_BRIDGE; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbTestAndMeasurement ( + IN CHAR16 *TextDeviceNode + ) +{ + USB_CLASS_TEXT UsbClassText; + + UsbClassText.ClassExist = FALSE; + UsbClassText.Class = USB_CLASS_RESERVE; + UsbClassText.SubClassExist = FALSE; + UsbClassText.SubClass = USB_SUBCLASS_TEST; + + return ConvertFromTextUsbClass (TextDeviceNode, &UsbClassText); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUsbWwid ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *VIDStr; + CHAR16 *PIDStr; + CHAR16 *InterfaceNumStr; + USB_WWID_DEVICE_PATH *UsbWwid; + + VIDStr = GetNextParamStr (&TextDeviceNode); + PIDStr = GetNextParamStr (&TextDeviceNode); + InterfaceNumStr = GetNextParamStr (&TextDeviceNode); + UsbWwid = (USB_WWID_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_USB_WWID_DP, + sizeof (USB_WWID_DEVICE_PATH) + ); + + UsbWwid->VendorId = (UINT16) Xtoi (VIDStr); + UsbWwid->ProductId = (UINT16) Xtoi (PIDStr); + UsbWwid->InterfaceNumber = (UINT16) Xtoi (InterfaceNumStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) UsbWwid; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextUnit ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *LunStr; + DEVICE_LOGICAL_UNIT_DEVICE_PATH *LogicalUnit; + + LunStr = GetNextParamStr (&TextDeviceNode); + LogicalUnit = (DEVICE_LOGICAL_UNIT_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_DEVICE_LOGICAL_UNIT_DP, + sizeof (DEVICE_LOGICAL_UNIT_DEVICE_PATH) + ); + + LogicalUnit->Lun = (UINT8) Xtoi (LunStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) LogicalUnit; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextiSCSI ( + IN CHAR16 *TextDeviceNode + ) +{ + UINT16 Options; + CHAR16 *NameStr; + CHAR16 *PortalGroupStr; + CHAR16 *LunStr; + CHAR16 *HeaderDigestStr; + CHAR16 *DataDigestStr; + CHAR16 *AuthenticationStr; + CHAR16 *ProtocolStr; + ISCSI_DEVICE_PATH_WITH_NAME *iSCSI; + + NameStr = GetNextParamStr (&TextDeviceNode); + PortalGroupStr = GetNextParamStr (&TextDeviceNode); + LunStr = GetNextParamStr (&TextDeviceNode); + HeaderDigestStr = GetNextParamStr (&TextDeviceNode); + DataDigestStr = GetNextParamStr (&TextDeviceNode); + AuthenticationStr = GetNextParamStr (&TextDeviceNode); + ProtocolStr = GetNextParamStr (&TextDeviceNode); + iSCSI = (ISCSI_DEVICE_PATH_WITH_NAME *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_ISCSI_DP, + sizeof (ISCSI_DEVICE_PATH_WITH_NAME) + (UINT16) (StrLen (NameStr) * 2) + ); + + StrCpy (iSCSI->iSCSITargetName, NameStr); + iSCSI->TargetPortalGroupTag = (UINT16) Xtoi (PortalGroupStr); + Xtoi64 (LunStr, &iSCSI->Lun); + + Options = 0x0000; + if (StrCmp (HeaderDigestStr, L"CRC32C") == 0) { + Options |= 0x0002; + } + + if (StrCmp (DataDigestStr, L"CRC32C") == 0) { + Options |= 0x0008; + } + + if (StrCmp (AuthenticationStr, L"None") == 0) { + Options |= 0x0800; + } + + if (StrCmp (AuthenticationStr, L"CHAP_UNI") == 0) { + Options |= 0x1000; + } + + iSCSI->LoginOption = (UINT16) Options; + + iSCSI->NetworkProtocol = (UINT16) StrCmp (ProtocolStr, L"TCP"); + iSCSI->Reserved = (UINT16) 0; + + return (EFI_DEVICE_PATH_PROTOCOL *) iSCSI; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextHD ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *PartitionStr; + CHAR16 *TypeStr; + CHAR16 *SignatureStr; + CHAR16 *StartStr; + CHAR16 *SizeStr; + UINT32 Signature32; + EFI_GUID SignatureGuid; + HARDDRIVE_DEVICE_PATH *Hd; + + PartitionStr = GetNextParamStr (&TextDeviceNode); + TypeStr = GetNextParamStr (&TextDeviceNode); + SignatureStr = GetNextParamStr (&TextDeviceNode); + StartStr = GetNextParamStr (&TextDeviceNode); + SizeStr = GetNextParamStr (&TextDeviceNode); + Hd = (HARDDRIVE_DEVICE_PATH *) CreateDeviceNode ( + MEDIA_DEVICE_PATH, + MEDIA_HARDDRIVE_DP, + sizeof (HARDDRIVE_DEVICE_PATH) + ); + + Hd->PartitionNumber = (UINT32) Atoi (PartitionStr); + + ZeroMem (Hd->Signature, 16); + Hd->MBRType = (UINT8) 0; + + if (StrCmp (TypeStr, L"None") == 0) { + Hd->SignatureType = (UINT8) 0; + } else if (StrCmp (TypeStr, L"MBR") == 0) { + Hd->SignatureType = SIGNATURE_TYPE_MBR; + Hd->MBRType = 0x01; + + Signature32 = (UINT32) Xtoi (SignatureStr); + CopyMem (Hd->Signature, &Signature32, sizeof (UINT32)); + } else if (StrCmp (TypeStr, L"GUID") == 0) { + Hd->SignatureType = SIGNATURE_TYPE_GUID; + Hd->MBRType = 0x02; + + StrToGuid (SignatureStr, &SignatureGuid); + CopyMem (Hd->Signature, &SignatureGuid, sizeof (EFI_GUID)); + } else { + Hd->SignatureType = 0xff; + + } + + Xtoi64 (StartStr, &Hd->PartitionStart); + Xtoi64 (SizeStr, &Hd->PartitionSize); + + return (EFI_DEVICE_PATH_PROTOCOL *) Hd; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextCDROM ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *EntryStr; + CHAR16 *StartStr; + CHAR16 *SizeStr; + CDROM_DEVICE_PATH *CDROM; + + EntryStr = GetNextParamStr (&TextDeviceNode); + StartStr = GetNextParamStr (&TextDeviceNode); + SizeStr = GetNextParamStr (&TextDeviceNode); + CDROM = (CDROM_DEVICE_PATH *) CreateDeviceNode ( + MEDIA_DEVICE_PATH, + MEDIA_CDROM_DP, + sizeof (CDROM_DEVICE_PATH) + ); + + CDROM->BootEntry = (UINT32) Xtoi (EntryStr); + Xtoi64 (StartStr, &CDROM->PartitionStart); + Xtoi64 (SizeStr, &CDROM->PartitionSize); + + return (EFI_DEVICE_PATH_PROTOCOL *) CDROM; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextVenMEDIA ( + IN CHAR16 *TextDeviceNode + ) +{ + return ConvertFromTextVendor ( + TextDeviceNode, + MEDIA_DEVICE_PATH, + MEDIA_VENDOR_DP + ); +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextFilePath ( + IN CHAR16 *TextDeviceNode + ) +{ + FILEPATH_DEVICE_PATH *File; + + File = (FILEPATH_DEVICE_PATH *) CreateDeviceNode ( + MEDIA_DEVICE_PATH, + MEDIA_FILEPATH_DP, + sizeof (FILEPATH_DEVICE_PATH) + (UINT16) (StrLen (TextDeviceNode) * 2) + ); + + StrCpy (File->PathName, TextDeviceNode); + + return (EFI_DEVICE_PATH_PROTOCOL *) File; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextMedia ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *GuidStr; + MEDIA_PROTOCOL_DEVICE_PATH *Media; + + GuidStr = GetNextParamStr (&TextDeviceNode); + Media = (MEDIA_PROTOCOL_DEVICE_PATH *) CreateDeviceNode ( + MEDIA_DEVICE_PATH, + MEDIA_PROTOCOL_DP, + sizeof (MEDIA_PROTOCOL_DEVICE_PATH) + ); + + StrToGuid (GuidStr, &Media->Protocol); + + return (EFI_DEVICE_PATH_PROTOCOL *) Media; +} + +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextBBS ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *TypeStr; + CHAR16 *IdStr; + CHAR16 *FlagsStr; + UINT8 *AsciiStr; + BBS_BBS_DEVICE_PATH *Bbs; + + TypeStr = GetNextParamStr (&TextDeviceNode); + IdStr = GetNextParamStr (&TextDeviceNode); + FlagsStr = GetNextParamStr (&TextDeviceNode); + Bbs = (BBS_BBS_DEVICE_PATH *) CreateDeviceNode ( + BBS_DEVICE_PATH, + BBS_BBS_DP, + sizeof (BBS_BBS_DEVICE_PATH) + (UINT16) (StrLen (IdStr)) + ); + + if (StrCmp (TypeStr, L"Floppy") == 0) { + Bbs->DeviceType = BBS_TYPE_FLOPPY; + } else if (StrCmp (TypeStr, L"HD") == 0) { + Bbs->DeviceType = BBS_TYPE_HARDDRIVE; + } else if (StrCmp (TypeStr, L"CDROM") == 0) { + Bbs->DeviceType = BBS_TYPE_CDROM; + } else if (StrCmp (TypeStr, L"PCMCIA") == 0) { + Bbs->DeviceType = BBS_TYPE_PCMCIA; + } else if (StrCmp (TypeStr, L"USB") == 0) { + Bbs->DeviceType = BBS_TYPE_USB; + } else if (StrCmp (TypeStr, L"Network") == 0) { + Bbs->DeviceType = BBS_TYPE_EMBEDDED_NETWORK; + } else { + Bbs->DeviceType = BBS_TYPE_UNKNOWN; + } + + AsciiStr = (UINT8 *) Bbs->String; + StrToAscii (IdStr, (CHAR8 **) &AsciiStr); + + Bbs->StatusFlag = (UINT16) Xtoi (FlagsStr); + + return (EFI_DEVICE_PATH_PROTOCOL *) Bbs; +} + +GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE DevPathFromTextTable[] = { + {L"Pci", DevPathFromTextPci}, + {L"PcCard", DevPathFromTextPcCard}, + {L"MemoryMapped", DevPathFromTextMemoryMapped}, + {L"VenHw", DevPathFromTextVenHw}, + {L"Ctrl", DevPathFromTextCtrl}, + {L"Acpi", DevPathFromTextAcpi}, + {L"PciRoot", DevPathFromTextPciRoot}, + {L"Floppy", DevPathFromTextFloppy}, + {L"Keyboard", DevPathFromTextKeyboard}, + {L"Serial", DevPathFromTextSerial}, + {L"ParallelPort", DevPathFromTextParallelPort}, + {L"AcpiEx", DevPathFromTextAcpiEx}, + {L"AcpiExp", DevPathFromTextAcpiExp}, + {L"Ata", DevPathFromTextAta}, + {L"Scsi", DevPathFromTextScsi}, + {L"Fibre", DevPathFromTextFibre}, + {L"I1394", DevPathFromText1394}, + {L"USB", DevPathFromTextUsb}, + {L"I2O", DevPathFromTextI2O}, + {L"Infiniband", DevPathFromTextInfiniband}, + {L"VenMsg", DevPathFromTextVenMsg}, + {L"VenPcAnsi", DevPathFromTextVenPcAnsi}, + {L"VenVt100", DevPathFromTextVenVt100}, + {L"VenVt100Plus", DevPathFromTextVenVt100Plus}, + {L"VenUtf8", DevPathFromTextVenUtf8}, + {L"UartFlowCtrl", DevPathFromTextUartFlowCtrl}, + {L"SAS", DevPathFromTextSAS}, + {L"DebugPort", DevPathFromTextDebugPort}, + {L"MAC", DevPathFromTextMAC}, + {L"IPv4", DevPathFromTextIPv4}, + {L"IPv6", DevPathFromTextIPv6}, + {L"Uart", DevPathFromTextUart}, + {L"UsbClass", DevPathFromTextUsbClass}, + {L"UsbAudio", DevPathFromTextUsbAudio}, + {L"UsbCDCControl", DevPathFromTextUsbCDCControl}, + {L"UsbHID", DevPathFromTextUsbHID}, + {L"UsbImage", DevPathFromTextUsbImage}, + {L"UsbPrinter", DevPathFromTextUsbPrinter}, + {L"UsbMassStorage", DevPathFromTextUsbMassStorage}, + {L"UsbHub", DevPathFromTextUsbHub}, + {L"UsbCDCData", DevPathFromTextUsbCDCData}, + {L"UsbSmartCard", DevPathFromTextUsbSmartCard}, + {L"UsbVideo", DevPathFromTextUsbVideo}, + {L"UsbDiagnostic", DevPathFromTextUsbDiagnostic}, + {L"UsbWireless", DevPathFromTextUsbWireless}, + {L"UsbDeviceFirmwareUpdate", DevPathFromTextUsbDeviceFirmwareUpdate}, + {L"UsbIrdaBridge", DevPathFromTextUsbIrdaBridge}, + {L"UsbTestAndMeasurement", DevPathFromTextUsbTestAndMeasurement}, + {L"UsbWwid", DevPathFromTextUsbWwid}, + {L"Unit", DevPathFromTextUnit}, + {L"iSCSI", DevPathFromTextiSCSI}, + {L"HD", DevPathFromTextHD}, + {L"CDROM", DevPathFromTextCDROM}, + {L"VenMEDIA", DevPathFromTextVenMEDIA}, + {L"Media", DevPathFromTextMedia}, + {L"BBS", DevPathFromTextBBS}, + {NULL, NULL} +}; + +EFI_DEVICE_PATH_PROTOCOL * +ConvertTextToDeviceNode ( + IN CONST CHAR16 *TextDeviceNode + ) +/*++ + + Routine Description: + Convert text to the binary representation of a device node. + + Arguments: + TextDeviceNode - TextDeviceNode points to the text representation of a device + node. Conversion starts with the first character and continues + until the first non-device node character. + + Returns: + A pointer - Pointer to the EFI device node. + NULL - If TextDeviceNode is NULL or there was insufficient memory or text unsupported. + +--*/ +{ + EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *); + CHAR16 *ParamStr; + EFI_DEVICE_PATH_PROTOCOL *DeviceNode; + CHAR16 *DeviceNodeStr; + UINTN Index; + + if ((TextDeviceNode == NULL) || (IS_NULL (*TextDeviceNode))) { + return NULL; + } + + ParamStr = NULL; + DumpNode = NULL; + DeviceNodeStr = StrDuplicate (TextDeviceNode); + + for (Index = 0; DevPathFromTextTable[Index].Function; Index++) { + ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText); + if (ParamStr != NULL) { + DumpNode = DevPathFromTextTable[Index].Function; + break; + } + } + + if (DumpNode == NULL) { + // + // A file path + // + DumpNode = DevPathFromTextFilePath; + DeviceNode = DumpNode (DeviceNodeStr); + } else { + DeviceNode = DumpNode (ParamStr); + gBS->FreePool (ParamStr); + } + + gBS->FreePool (DeviceNodeStr); + + return DeviceNode; +} + +EFI_DEVICE_PATH_PROTOCOL * +ConvertTextToDevicePath ( + IN CONST CHAR16 *TextDevicePath + ) +/*++ + + Routine Description: + Convert text to the binary representation of a device path. + + Arguments: + TextDevicePath - TextDevicePath points to the text representation of a device + path. Conversion starts with the first character and continues + until the first non-device node character. + + Returns: + A pointer - Pointer to the allocated device path. + NULL - If TextDeviceNode is NULL or there was insufficient memory. + +--*/ +{ + EFI_DEVICE_PATH_PROTOCOL * (*DumpNode) (CHAR16 *); + CHAR16 *ParamStr; + EFI_DEVICE_PATH_PROTOCOL *DeviceNode; + UINTN Index; + EFI_DEVICE_PATH_PROTOCOL *NewDevicePath; + CHAR16 *DevicePathStr; + CHAR16 *Str; + CHAR16 *DeviceNodeStr; + UINT8 IsInstanceEnd; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + + if ((TextDevicePath == NULL) || (IS_NULL (*TextDevicePath))) { + return NULL; + } + + DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); + SetDevicePathEndNode (DevicePath); + + ParamStr = NULL; + DeviceNodeStr = NULL; + DevicePathStr = StrDuplicate (TextDevicePath); + + Str = DevicePathStr; + while ((DeviceNodeStr = GetNextDeviceNodeStr (&Str, &IsInstanceEnd)) != NULL) { + DumpNode = NULL; + for (Index = 0; DevPathFromTextTable[Index].Function; Index++) { + ParamStr = GetParamByNodeName (DeviceNodeStr, DevPathFromTextTable[Index].DevicePathNodeText); + if (ParamStr != NULL) { + DumpNode = DevPathFromTextTable[Index].Function; + break; + } + } + + if (DumpNode == NULL) { + // + // A file path + // + DumpNode = DevPathFromTextFilePath; + DeviceNode = DumpNode (DeviceNodeStr); + } else { + DeviceNode = DumpNode (ParamStr); + gBS->FreePool (ParamStr); + } + + NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); + gBS->FreePool (DevicePath); + gBS->FreePool (DeviceNode); + DevicePath = NewDevicePath; + + if (IsInstanceEnd) { + DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool (END_DEVICE_PATH_LENGTH); + SetDevicePathInstanceEndNode (DeviceNode); + + NewDevicePath = AppendDeviceNodeProtocolInterface (DevicePath, DeviceNode); + gBS->FreePool (DevicePath); + gBS->FreePool (DeviceNode); + DevicePath = NewDevicePath; + } + } + + gBS->FreePool (DevicePathStr); + return DevicePath; +} diff --git a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c index a702595225..548a5349a8 100644 --- a/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c +++ b/EdkModulePkg/Universal/DevicePath/Dxe/DevicePathUtilities.c @@ -1,211 +1,211 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - DevicePathUtilities.c - -Abstract: - - Implementation file for Device Path Utilities Protocol - ---*/ - -#include "DevicePath.h" - -UINTN -GetDevicePathSizeProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -/*++ - - Routine Description: - Returns the size of the device path, in bytes. - - Arguments: - DevicePath - Points to the start of the EFI device path. - - Returns: - Size - Size of the specified device path, in bytes, including the end-of-path tag. - ---*/ -{ - return GetDevicePathSize (DevicePath); -} - -EFI_DEVICE_PATH_PROTOCOL * -DuplicateDevicePathProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -/*++ - - Routine Description: - Create a duplicate of the specified path. - - Arguments: - DevicePath - Points to the source EFI device path. - - Returns: - Pointer - A pointer to the duplicate device path. - NULL - Insufficient memory. - ---*/ -{ - return DuplicateDevicePath (DevicePath); -} - -EFI_DEVICE_PATH_PROTOCOL * -AppendDevicePathProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1, - IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2 - ) -/*++ - - Routine Description: - Create a new path by appending the second device path to the first. - - Arguments: - Src1 - Points to the first device path. If NULL, then it is ignored. - Src2 - Points to the second device path. If NULL, then it is ignored. - - Returns: - Pointer - A pointer to the newly created device path. - NULL - Memory could not be allocated - or either DevicePath or DeviceNode is NULL. - ---*/ -{ - return AppendDevicePath (Src1, Src2); -} - -EFI_DEVICE_PATH_PROTOCOL * -AppendDeviceNodeProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode - ) -/*++ - - Routine Description: - Creates a new path by appending the device node to the device path. - - Arguments: - DevicePath - Points to the device path. - DeviceNode - Points to the device node. - - Returns: - Pointer - A pointer to the allocated device node. - NULL - Memory could not be allocated - or either DevicePath or DeviceNode is NULL. - ---*/ -{ - return AppendDevicePathNode (DevicePath, DeviceNode); -} - -EFI_DEVICE_PATH_PROTOCOL * -AppendDevicePathInstanceProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance - ) -/*++ - - Routine Description: - Creates a new path by appending the specified device path instance to the specified device path. - - Arguments: - DevicePath - Points to the device path. If NULL, then ignored. - DevicePathInstance - Points to the device path instance. - - Returns: - Pointer - A pointer to the newly created device path - NULL - Memory could not be allocated or DevicePathInstance is NULL. - ---*/ -{ - return AppendDevicePathInstance (DevicePath, DevicePathInstance); -} - -EFI_DEVICE_PATH_PROTOCOL * -GetNextDevicePathInstanceProtocolInterface ( - IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance, - OUT UINTN *DevicePathInstanceSize - ) -/*++ - - Routine Description: - Creates a copy of the current device path instance and returns a pointer to the next device path instance. - - Arguments: - DevicePathInstance - On input, this holds the pointer to the current device path - instance. On output, this holds the pointer to the next - device path instance or NULL if there are no more device - path instances in the device path. - DevicePathInstanceSize - On output, this holds the size of the device path instance, - in bytes or zero, if DevicePathInstance is zero. - - Returns: - Pointer - A pointer to the copy of the current device path instance. - NULL - DevicePathInstace was NULL on entry or there was insufficient memory. - ---*/ -{ - return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize); -} - -BOOLEAN -IsDevicePathMultiInstanceProtocolInterface ( - IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath - ) -/*++ - - Routine Description: - Returns whether a device path is multi-instance. - - Arguments: - DevicePath - Points to the device path. If NULL, then ignored. - - Returns: - TRUE - The device path has more than one instance - FALSE - The device path is empty or contains only a single instance. - ---*/ -{ - return IsDevicePathMultiInstance (DevicePath); -} - -EFI_DEVICE_PATH_PROTOCOL * -CreateDeviceNodeProtocolInterface ( - IN UINT8 NodeType, - IN UINT8 NodeSubType, - IN UINT16 NodeLength - ) -/*++ - - Routine Description: - Creates a device node - - Arguments: - NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for - the new device node. - NodeSubType - NodeSubType is the device node sub-type - EFI_DEVICE_PATH.SubType) for the new device node. - NodeLength - NodeLength is the length of the device node - (EFI_DEVICE_PATH.Length) for the new device node. - - Returns: - Pointer - A pointer to the newly created device node. - NULL - NodeLength is less than - the size of the header or there was insufficient memory. - ---*/ -{ - return CreateDeviceNode (NodeType, NodeSubType, NodeLength); -} +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + DevicePathUtilities.c + +Abstract: + + Implementation file for Device Path Utilities Protocol + +--*/ + +#include "DevicePath.h" + +UINTN +GetDevicePathSizeProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +/*++ + + Routine Description: + Returns the size of the device path, in bytes. + + Arguments: + DevicePath - Points to the start of the EFI device path. + + Returns: + Size - Size of the specified device path, in bytes, including the end-of-path tag. + +--*/ +{ + return GetDevicePathSize (DevicePath); +} + +EFI_DEVICE_PATH_PROTOCOL * +DuplicateDevicePathProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +/*++ + + Routine Description: + Create a duplicate of the specified path. + + Arguments: + DevicePath - Points to the source EFI device path. + + Returns: + Pointer - A pointer to the duplicate device path. + NULL - Insufficient memory. + +--*/ +{ + return DuplicateDevicePath (DevicePath); +} + +EFI_DEVICE_PATH_PROTOCOL * +AppendDevicePathProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *Src1, + IN CONST EFI_DEVICE_PATH_PROTOCOL *Src2 + ) +/*++ + + Routine Description: + Create a new path by appending the second device path to the first. + + Arguments: + Src1 - Points to the first device path. If NULL, then it is ignored. + Src2 - Points to the second device path. If NULL, then it is ignored. + + Returns: + Pointer - A pointer to the newly created device path. + NULL - Memory could not be allocated + or either DevicePath or DeviceNode is NULL. + +--*/ +{ + return AppendDevicePath (Src1, Src2); +} + +EFI_DEVICE_PATH_PROTOCOL * +AppendDeviceNodeProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN CONST EFI_DEVICE_PATH_PROTOCOL *DeviceNode + ) +/*++ + + Routine Description: + Creates a new path by appending the device node to the device path. + + Arguments: + DevicePath - Points to the device path. + DeviceNode - Points to the device node. + + Returns: + Pointer - A pointer to the allocated device node. + NULL - Memory could not be allocated + or either DevicePath or DeviceNode is NULL. + +--*/ +{ + return AppendDevicePathNode (DevicePath, DeviceNode); +} + +EFI_DEVICE_PATH_PROTOCOL * +AppendDevicePathInstanceProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePathInstance + ) +/*++ + + Routine Description: + Creates a new path by appending the specified device path instance to the specified device path. + + Arguments: + DevicePath - Points to the device path. If NULL, then ignored. + DevicePathInstance - Points to the device path instance. + + Returns: + Pointer - A pointer to the newly created device path + NULL - Memory could not be allocated or DevicePathInstance is NULL. + +--*/ +{ + return AppendDevicePathInstance (DevicePath, DevicePathInstance); +} + +EFI_DEVICE_PATH_PROTOCOL * +GetNextDevicePathInstanceProtocolInterface ( + IN OUT EFI_DEVICE_PATH_PROTOCOL **DevicePathInstance, + OUT UINTN *DevicePathInstanceSize + ) +/*++ + + Routine Description: + Creates a copy of the current device path instance and returns a pointer to the next device path instance. + + Arguments: + DevicePathInstance - On input, this holds the pointer to the current device path + instance. On output, this holds the pointer to the next + device path instance or NULL if there are no more device + path instances in the device path. + DevicePathInstanceSize - On output, this holds the size of the device path instance, + in bytes or zero, if DevicePathInstance is zero. + + Returns: + Pointer - A pointer to the copy of the current device path instance. + NULL - DevicePathInstace was NULL on entry or there was insufficient memory. + +--*/ +{ + return GetNextDevicePathInstance (DevicePathInstance, DevicePathInstanceSize); +} + +BOOLEAN +IsDevicePathMultiInstanceProtocolInterface ( + IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath + ) +/*++ + + Routine Description: + Returns whether a device path is multi-instance. + + Arguments: + DevicePath - Points to the device path. If NULL, then ignored. + + Returns: + TRUE - The device path has more than one instance + FALSE - The device path is empty or contains only a single instance. + +--*/ +{ + return IsDevicePathMultiInstance (DevicePath); +} + +EFI_DEVICE_PATH_PROTOCOL * +CreateDeviceNodeProtocolInterface ( + IN UINT8 NodeType, + IN UINT8 NodeSubType, + IN UINT16 NodeLength + ) +/*++ + + Routine Description: + Creates a device node + + Arguments: + NodeType - NodeType is the device node type (EFI_DEVICE_PATH.Type) for + the new device node. + NodeSubType - NodeSubType is the device node sub-type + EFI_DEVICE_PATH.SubType) for the new device node. + NodeLength - NodeLength is the length of the device node + (EFI_DEVICE_PATH.Length) for the new device node. + + Returns: + Pointer - A pointer to the newly created device node. + NULL - NodeLength is less than + the size of the header or there was insufficient memory. + +--*/ +{ + return CreateDeviceNode (NodeType, NodeSubType, NodeLength); +} diff --git a/EdkModulePkg/Universal/Disk/DiskIo/Dxe/diskio.c b/EdkModulePkg/Universal/Disk/DiskIo/Dxe/diskio.c index 35d2a19be2..1cb26fe976 100644 --- a/EdkModulePkg/Universal/Disk/DiskIo/Dxe/diskio.c +++ b/EdkModulePkg/Universal/Disk/DiskIo/Dxe/diskio.c @@ -1,781 +1,781 @@ -/*++ - -Copyright (c) 2006, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -Module Name: - - DiskIo.c - -Abstract: - - DiskIo driver that layers it's self on every Block IO protocol in the system. - DiskIo converts a block oriented device to a byte oriented device. - - ReadDisk may have to do reads that are not aligned on sector boundaries. - There are three cases: - - UnderRun - The first byte is not on a sector boundary or the read request is - less than a sector in length. - - Aligned - A read of N contiguous sectors. - - OverRun - The last byte is not on a sector boundary. - ---*/ - -#include "DiskIo.h" - -// -// Prototypes -// Driver model protocol interface -// -EFI_STATUS -EFIAPI -DiskIoDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - -EFI_STATUS -EFIAPI -DiskIoDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - -EFI_STATUS -EFIAPI -DiskIoDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ); - -// -// Disk I/O Protocol Interface -// -EFI_STATUS -EFIAPI -DiskIoReadDisk ( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - OUT VOID *Buffer - ); - -EFI_STATUS -EFIAPI -DiskIoWriteDisk ( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - IN VOID *Buffer - ); - -EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding = { - DiskIoDriverBindingSupported, - DiskIoDriverBindingStart, - DiskIoDriverBindingStop, - 0x10, - NULL, - NULL -}; - -DISK_IO_PRIVATE_DATA gDiskIoPrivateDataTemplate = { - DISK_IO_PRIVATE_DATA_SIGNATURE, - { - EFI_DISK_IO_PROTOCOL_REVISION, - DiskIoReadDisk, - DiskIoWriteDisk - }, - NULL -}; - -EFI_STATUS -EFIAPI -DiskIoDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL - ) -/*++ - - Routine Description: - Test to see if this driver supports ControllerHandle. Any ControllerHandle - than contains a BlockIo protocol can be supported. - - Arguments: - This - Protocol instance pointer. - ControllerHandle - Handle of device to test. - RemainingDevicePath - Not used. - - Returns: - EFI_SUCCESS - This driver supports this device. - EFI_ALREADY_STARTED - This driver is already running on this device. - other - This driver does not support this device. - ---*/ -{ - EFI_STATUS Status; - EFI_BLOCK_IO_PROTOCOL *BlockIo; - - // - // Open the IO Abstraction(s) needed to perform the supported test. - // - Status = gBS->OpenProtocol ( - ControllerHandle, - &gEfiBlockIoProtocolGuid, - (VOID **) &BlockIo, - This->DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - return Status; - } - // - // Close the I/O Abstraction(s) used to perform the supported test. - // - gBS->CloseProtocol ( - ControllerHandle, - &gEfiBlockIoProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - return EFI_SUCCESS; -} - -EFI_STATUS -EFIAPI -DiskIoDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL - ) -/*++ - - Routine Description: - Start this driver on ControllerHandle by opening a Block IO protocol and - installing a Disk IO protocol on ControllerHandle. - - Arguments: - This - Protocol instance pointer. - ControllerHandle - Handle of device to bind driver to. - RemainingDevicePath - Not used, always produce all possible children. - - Returns: - EFI_SUCCESS - This driver is added to ControllerHandle. - EFI_ALREADY_STARTED - This driver is already running on ControllerHandle. - other - This driver does not support this device. - ---*/ -{ - EFI_STATUS Status; - DISK_IO_PRIVATE_DATA *Private; - - Private = NULL; - - // - // Connect to the Block IO interface on ControllerHandle. - // - Status = gBS->OpenProtocol ( - ControllerHandle, - &gEfiBlockIoProtocolGuid, - (VOID **) &gDiskIoPrivateDataTemplate.BlockIo, - This->DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - return Status; - } - // - // Initialize the Disk IO device instance. - // - Private = AllocateCopyPool (sizeof (DISK_IO_PRIVATE_DATA), &gDiskIoPrivateDataTemplate); - if (Private == NULL) { - Status = EFI_OUT_OF_RESOURCES; - goto ErrorExit; - } - // - // Install protocol interfaces for the Disk IO device. - // - Status = gBS->InstallProtocolInterface ( - &ControllerHandle, - &gEfiDiskIoProtocolGuid, - EFI_NATIVE_INTERFACE, - &Private->DiskIo - ); - -ErrorExit: - if (EFI_ERROR (Status)) { - - if (Private != NULL) { - gBS->FreePool (Private); - } - - gBS->CloseProtocol ( - ControllerHandle, - &gEfiBlockIoProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - } - - return Status; -} - -EFI_STATUS -EFIAPI -DiskIoDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ) -/*++ - - Routine Description: - Stop this driver on ControllerHandle by removing Disk IO protocol and closing - the Block IO protocol on ControllerHandle. - - Arguments: - This - Protocol instance pointer. - ControllerHandle - Handle of device to stop driver on. - NumberOfChildren - Not used. - ChildHandleBuffer - Not used. - - Returns: - EFI_SUCCESS - This driver is removed ControllerHandle. - other - This driver was not removed from this device. - EFI_UNSUPPORTED - ---*/ -{ - EFI_STATUS Status; - EFI_DISK_IO_PROTOCOL *DiskIo; - DISK_IO_PRIVATE_DATA *Private; - - // - // Get our context back. - // - Status = gBS->OpenProtocol ( - ControllerHandle, - &gEfiDiskIoProtocolGuid, - (VOID **) &DiskIo, - This->DriverBindingHandle, - ControllerHandle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - - Private = DISK_IO_PRIVATE_DATA_FROM_THIS (DiskIo); - - Status = gBS->UninstallProtocolInterface ( - ControllerHandle, - &gEfiDiskIoProtocolGuid, - &Private->DiskIo - ); - if (!EFI_ERROR (Status)) { - - Status = gBS->CloseProtocol ( - ControllerHandle, - &gEfiBlockIoProtocolGuid, - This->DriverBindingHandle, - ControllerHandle - ); - } - - if (!EFI_ERROR (Status)) { - gBS->FreePool (Private); - } - - return Status; -} - -EFI_STATUS -EFIAPI -DiskIoReadDisk ( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - OUT VOID *Buffer - ) -/*++ - - Routine Description: - Read BufferSize bytes from Offset into Buffer. - - Reads may support reads that are not aligned on - sector boundaries. There are three cases: - - UnderRun - The first byte is not on a sector boundary or the read request is - less than a sector in length. - - Aligned - A read of N contiguous sectors. - - OverRun - The last byte is not on a sector boundary. - - - Arguments: - This - Protocol instance pointer. - MediaId - Id of the media, changes every time the media is replaced. - Offset - The starting byte offset to read from. - BufferSize - Size of Buffer. - Buffer - Buffer containing read data. - - Returns: - EFI_SUCCESS - The data was read correctly from the device. - EFI_DEVICE_ERROR - The device reported an error while performing the read. - EFI_NO_MEDIA - There is no media in the device. - EFI_MEDIA_CHNAGED - The MediaId does not matched the current device. - EFI_INVALID_PARAMETER - The read request contains device addresses that are not - valid for the device. - EFI_OUT_OF_RESOURCES - ---*/ -{ - EFI_STATUS Status; - DISK_IO_PRIVATE_DATA *Private; - EFI_BLOCK_IO_PROTOCOL *BlockIo; - EFI_BLOCK_IO_MEDIA *Media; - UINT32 BlockSize; - UINT64 Lba; - UINT64 OverRunLba; - UINT32 UnderRun; - UINT32 OverRun; - BOOLEAN TransactionComplete; - UINTN WorkingBufferSize; - UINT8 *WorkingBuffer; - UINTN Length; - UINT8 *Data; - UINT8 *PreData; - UINTN IsBufferAligned; - UINTN DataBufferSize; - BOOLEAN LastRead; - - Private = DISK_IO_PRIVATE_DATA_FROM_THIS (This); - - BlockIo = Private->BlockIo; - Media = BlockIo->Media; - BlockSize = Media->BlockSize; - - if (Media->MediaId != MediaId) { - return EFI_MEDIA_CHANGED; - } - - WorkingBuffer = Buffer; - WorkingBufferSize = BufferSize; - - // - // Allocate a temporary buffer for operation - // - DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM; - - if (Media->IoAlign > 1) { - PreData = AllocatePool (DataBufferSize + Media->IoAlign); - Data = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign; - } else { - PreData = AllocatePool (DataBufferSize); - Data = PreData; - } - - if (PreData == NULL) { - return EFI_OUT_OF_RESOURCES; - } - - Lba = DivU64x32Remainder (Offset, BlockSize, &UnderRun); - - Length = BlockSize - UnderRun; - TransactionComplete = FALSE; - - Status = EFI_SUCCESS; - if (UnderRun != 0) { - // - // Offset starts in the middle of an Lba, so read the entire block. - // - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - Lba, - BlockSize, - Data - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - if (Length > BufferSize) { - Length = BufferSize; - TransactionComplete = TRUE; - } - - CopyMem (WorkingBuffer, Data + UnderRun, Length); - - WorkingBuffer += Length; - - WorkingBufferSize -= Length; - if (WorkingBufferSize == 0) { - goto Done; - } - - Lba += 1; - } - - OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun); - - if (!TransactionComplete && WorkingBufferSize >= BlockSize) { - // - // If the DiskIo maps directly to a BlockIo device do the read. - // - if (OverRun != 0) { - WorkingBufferSize -= OverRun; - } - // - // Check buffer alignment - // - IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1); - - if (Media->IoAlign <= 1 || IsBufferAligned == 0) { - // - // Alignment is satisfied, so read them together - // - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - Lba, - WorkingBufferSize, - WorkingBuffer - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - WorkingBuffer += WorkingBufferSize; - - } else { - // - // Use the allocated buffer instead of the original buffer - // to avoid alignment issue. - // Here, the allocated buffer (8-byte align) can satisfy the alignment - // - LastRead = FALSE; - do { - if (WorkingBufferSize <= DataBufferSize) { - // - // It is the last calling to readblocks in this loop - // - DataBufferSize = WorkingBufferSize; - LastRead = TRUE; - } - - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - Lba, - DataBufferSize, - Data - ); - if (EFI_ERROR (Status)) { - goto Done; - } - - CopyMem (WorkingBuffer, Data, DataBufferSize); - WorkingBufferSize -= DataBufferSize; - WorkingBuffer += DataBufferSize; - Lba += DATA_BUFFER_BLOCK_NUM; - } while (!LastRead); - } - } - - if (!TransactionComplete && OverRun != 0) { - // - // Last read is not a complete block. - // - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - OverRunLba, - BlockSize, - Data - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - CopyMem (WorkingBuffer, Data, OverRun); - } - -Done: - if (PreData != NULL) { - gBS->FreePool (PreData); - } - - return Status; -} - -EFI_STATUS -EFIAPI -DiskIoWriteDisk ( - IN EFI_DISK_IO_PROTOCOL *This, - IN UINT32 MediaId, - IN UINT64 Offset, - IN UINTN BufferSize, - IN VOID *Buffer - ) -/*++ - - Routine Description: - Read BufferSize bytes from Offset into Buffer. - - Writes may require a read modify write to support writes that are not - aligned on sector boundaries. There are three cases: - - UnderRun - The first byte is not on a sector boundary or the write request - is less than a sector in length. Read modify write is required. - - Aligned - A write of N contiguous sectors. - - OverRun - The last byte is not on a sector boundary. Read modified write - required. - - Arguments: - This - Protocol instance pointer. - MediaId - Id of the media, changes every time the media is replaced. - Offset - The starting byte offset to read from. - BufferSize - Size of Buffer. - Buffer - Buffer containing read data. - - Returns: - EFI_SUCCESS - The data was written correctly to the device. - EFI_WRITE_PROTECTED - The device can not be written to. - EFI_DEVICE_ERROR - The device reported an error while performing the write. - EFI_NO_MEDIA - There is no media in the device. - EFI_MEDIA_CHNAGED - The MediaId does not matched the current device. - EFI_INVALID_PARAMETER - The write request contains device addresses that are not - valid for the device. - EFI_OUT_OF_RESOURCES - ---*/ -{ - EFI_STATUS Status; - DISK_IO_PRIVATE_DATA *Private; - EFI_BLOCK_IO_PROTOCOL *BlockIo; - EFI_BLOCK_IO_MEDIA *Media; - UINT32 BlockSize; - UINT64 Lba; - UINT64 OverRunLba; - UINT32 UnderRun; - UINT32 OverRun; - BOOLEAN TransactionComplete; - UINTN WorkingBufferSize; - UINT8 *WorkingBuffer; - UINTN Length; - UINT8 *Data; - UINT8 *PreData; - UINTN IsBufferAligned; - UINTN DataBufferSize; - BOOLEAN LastWrite; - - Private = DISK_IO_PRIVATE_DATA_FROM_THIS (This); - - BlockIo = Private->BlockIo; - Media = BlockIo->Media; - BlockSize = Media->BlockSize; - - if (Media->ReadOnly) { - return EFI_WRITE_PROTECTED; - } - - if (Media->MediaId != MediaId) { - return EFI_MEDIA_CHANGED; - } - - DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM; - - if (Media->IoAlign > 1) { - PreData = AllocatePool (DataBufferSize + Media->IoAlign); - Data = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign; - } else { - PreData = AllocatePool (DataBufferSize); - Data = PreData; - } - - if (PreData == NULL) { - return EFI_OUT_OF_RESOURCES; - } - - WorkingBuffer = Buffer; - WorkingBufferSize = BufferSize; - - Lba = DivU64x32Remainder (Offset, BlockSize, &UnderRun); - - Length = BlockSize - UnderRun; - TransactionComplete = FALSE; - - Status = EFI_SUCCESS; - if (UnderRun != 0) { - // - // Offset starts in the middle of an Lba, so do read modify write. - // - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - Lba, - BlockSize, - Data - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - if (Length > BufferSize) { - Length = BufferSize; - TransactionComplete = TRUE; - } - - CopyMem (Data + UnderRun, WorkingBuffer, Length); - - Status = BlockIo->WriteBlocks ( - BlockIo, - MediaId, - Lba, - BlockSize, - Data - ); - if (EFI_ERROR (Status)) { - goto Done; - } - - WorkingBuffer += Length; - WorkingBufferSize -= Length; - if (WorkingBufferSize == 0) { - goto Done; - } - - Lba += 1; - } - - OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun); - - if (!TransactionComplete && WorkingBufferSize >= BlockSize) { - // - // If the DiskIo maps directly to a BlockIo device do the write. - // - if (OverRun != 0) { - WorkingBufferSize -= OverRun; - } - // - // Check buffer alignment - // - IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1); - - if (Media->IoAlign <= 1 || IsBufferAligned == 0) { - // - // Alignment is satisfied, so write them together - // - Status = BlockIo->WriteBlocks ( - BlockIo, - MediaId, - Lba, - WorkingBufferSize, - WorkingBuffer - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - WorkingBuffer += WorkingBufferSize; - - } else { - // - // The buffer parameter is not aligned with the request - // So use the allocated instead. - // It can fit almost all the cases. - // - LastWrite = FALSE; - do { - if (WorkingBufferSize <= DataBufferSize) { - // - // It is the last calling to writeblocks in this loop - // - DataBufferSize = WorkingBufferSize; - LastWrite = TRUE; - } - - CopyMem (Data, WorkingBuffer, DataBufferSize); - Status = BlockIo->WriteBlocks ( - BlockIo, - MediaId, - Lba, - DataBufferSize, - Data - ); - if (EFI_ERROR (Status)) { - goto Done; - } - - WorkingBufferSize -= DataBufferSize; - WorkingBuffer += DataBufferSize; - Lba += DATA_BUFFER_BLOCK_NUM; - } while (!LastWrite); - } - } - - if (!TransactionComplete && OverRun != 0) { - // - // Last bit is not a complete block, so do a read modify write. - // - Status = BlockIo->ReadBlocks ( - BlockIo, - MediaId, - OverRunLba, - BlockSize, - Data - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - - CopyMem (Data, WorkingBuffer, OverRun); - - Status = BlockIo->WriteBlocks ( - BlockIo, - MediaId, - OverRunLba, - BlockSize, - Data - ); - if (EFI_ERROR (Status)) { - goto Done; - } - } - -Done: - if (PreData != NULL) { - gBS->FreePool (PreData); - } - - return Status; -} +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + DiskIo.c + +Abstract: + + DiskIo driver that layers it's self on every Block IO protocol in the system. + DiskIo converts a block oriented device to a byte oriented device. + + ReadDisk may have to do reads that are not aligned on sector boundaries. + There are three cases: + + UnderRun - The first byte is not on a sector boundary or the read request is + less than a sector in length. + + Aligned - A read of N contiguous sectors. + + OverRun - The last byte is not on a sector boundary. + +--*/ + +#include "DiskIo.h" + +// +// Prototypes +// Driver model protocol interface +// +EFI_STATUS +EFIAPI +DiskIoDriverBindingSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); + +EFI_STATUS +EFIAPI +DiskIoDriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); + +EFI_STATUS +EFIAPI +DiskIoDriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ); + +// +// Disk I/O Protocol Interface +// +EFI_STATUS +EFIAPI +DiskIoReadDisk ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + OUT VOID *Buffer + ); + +EFI_STATUS +EFIAPI +DiskIoWriteDisk ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + IN VOID *Buffer + ); + +EFI_DRIVER_BINDING_PROTOCOL gDiskIoDriverBinding = { + DiskIoDriverBindingSupported, + DiskIoDriverBindingStart, + DiskIoDriverBindingStop, + 0x10, + NULL, + NULL +}; + +DISK_IO_PRIVATE_DATA gDiskIoPrivateDataTemplate = { + DISK_IO_PRIVATE_DATA_SIGNATURE, + { + EFI_DISK_IO_PROTOCOL_REVISION, + DiskIoReadDisk, + DiskIoWriteDisk + }, + NULL +}; + +EFI_STATUS +EFIAPI +DiskIoDriverBindingSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +/*++ + + Routine Description: + Test to see if this driver supports ControllerHandle. Any ControllerHandle + than contains a BlockIo protocol can be supported. + + Arguments: + This - Protocol instance pointer. + ControllerHandle - Handle of device to test. + RemainingDevicePath - Not used. + + Returns: + EFI_SUCCESS - This driver supports this device. + EFI_ALREADY_STARTED - This driver is already running on this device. + other - This driver does not support this device. + +--*/ +{ + EFI_STATUS Status; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + + // + // Open the IO Abstraction(s) needed to perform the supported test. + // + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEfiBlockIoProtocolGuid, + (VOID **) &BlockIo, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + if (EFI_ERROR (Status)) { + return Status; + } + // + // Close the I/O Abstraction(s) used to perform the supported test. + // + gBS->CloseProtocol ( + ControllerHandle, + &gEfiBlockIoProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +DiskIoDriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL + ) +/*++ + + Routine Description: + Start this driver on ControllerHandle by opening a Block IO protocol and + installing a Disk IO protocol on ControllerHandle. + + Arguments: + This - Protocol instance pointer. + ControllerHandle - Handle of device to bind driver to. + RemainingDevicePath - Not used, always produce all possible children. + + Returns: + EFI_SUCCESS - This driver is added to ControllerHandle. + EFI_ALREADY_STARTED - This driver is already running on ControllerHandle. + other - This driver does not support this device. + +--*/ +{ + EFI_STATUS Status; + DISK_IO_PRIVATE_DATA *Private; + + Private = NULL; + + // + // Connect to the Block IO interface on ControllerHandle. + // + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEfiBlockIoProtocolGuid, + (VOID **) &gDiskIoPrivateDataTemplate.BlockIo, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_BY_DRIVER + ); + if (EFI_ERROR (Status)) { + return Status; + } + // + // Initialize the Disk IO device instance. + // + Private = AllocateCopyPool (sizeof (DISK_IO_PRIVATE_DATA), &gDiskIoPrivateDataTemplate); + if (Private == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ErrorExit; + } + // + // Install protocol interfaces for the Disk IO device. + // + Status = gBS->InstallProtocolInterface ( + &ControllerHandle, + &gEfiDiskIoProtocolGuid, + EFI_NATIVE_INTERFACE, + &Private->DiskIo + ); + +ErrorExit: + if (EFI_ERROR (Status)) { + + if (Private != NULL) { + gBS->FreePool (Private); + } + + gBS->CloseProtocol ( + ControllerHandle, + &gEfiBlockIoProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); + } + + return Status; +} + +EFI_STATUS +EFIAPI +DiskIoDriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ) +/*++ + + Routine Description: + Stop this driver on ControllerHandle by removing Disk IO protocol and closing + the Block IO protocol on ControllerHandle. + + Arguments: + This - Protocol instance pointer. + ControllerHandle - Handle of device to stop driver on. + NumberOfChildren - Not used. + ChildHandleBuffer - Not used. + + Returns: + EFI_SUCCESS - This driver is removed ControllerHandle. + other - This driver was not removed from this device. + EFI_UNSUPPORTED + +--*/ +{ + EFI_STATUS Status; + EFI_DISK_IO_PROTOCOL *DiskIo; + DISK_IO_PRIVATE_DATA *Private; + + // + // Get our context back. + // + Status = gBS->OpenProtocol ( + ControllerHandle, + &gEfiDiskIoProtocolGuid, + (VOID **) &DiskIo, + This->DriverBindingHandle, + ControllerHandle, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + if (EFI_ERROR (Status)) { + return EFI_UNSUPPORTED; + } + + Private = DISK_IO_PRIVATE_DATA_FROM_THIS (DiskIo); + + Status = gBS->UninstallProtocolInterface ( + ControllerHandle, + &gEfiDiskIoProtocolGuid, + &Private->DiskIo + ); + if (!EFI_ERROR (Status)) { + + Status = gBS->CloseProtocol ( + ControllerHandle, + &gEfiBlockIoProtocolGuid, + This->DriverBindingHandle, + ControllerHandle + ); + } + + if (!EFI_ERROR (Status)) { + gBS->FreePool (Private); + } + + return Status; +} + +EFI_STATUS +EFIAPI +DiskIoReadDisk ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + OUT VOID *Buffer + ) +/*++ + + Routine Description: + Read BufferSize bytes from Offset into Buffer. + + Reads may support reads that are not aligned on + sector boundaries. There are three cases: + + UnderRun - The first byte is not on a sector boundary or the read request is + less than a sector in length. + + Aligned - A read of N contiguous sectors. + + OverRun - The last byte is not on a sector boundary. + + + Arguments: + This - Protocol instance pointer. + MediaId - Id of the media, changes every time the media is replaced. + Offset - The starting byte offset to read from. + BufferSize - Size of Buffer. + Buffer - Buffer containing read data. + + Returns: + EFI_SUCCESS - The data was read correctly from the device. + EFI_DEVICE_ERROR - The device reported an error while performing the read. + EFI_NO_MEDIA - There is no media in the device. + EFI_MEDIA_CHNAGED - The MediaId does not matched the current device. + EFI_INVALID_PARAMETER - The read request contains device addresses that are not + valid for the device. + EFI_OUT_OF_RESOURCES + +--*/ +{ + EFI_STATUS Status; + DISK_IO_PRIVATE_DATA *Private; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + EFI_BLOCK_IO_MEDIA *Media; + UINT32 BlockSize; + UINT64 Lba; + UINT64 OverRunLba; + UINT32 UnderRun; + UINT32 OverRun; + BOOLEAN TransactionComplete; + UINTN WorkingBufferSize; + UINT8 *WorkingBuffer; + UINTN Length; + UINT8 *Data; + UINT8 *PreData; + UINTN IsBufferAligned; + UINTN DataBufferSize; + BOOLEAN LastRead; + + Private = DISK_IO_PRIVATE_DATA_FROM_THIS (This); + + BlockIo = Private->BlockIo; + Media = BlockIo->Media; + BlockSize = Media->BlockSize; + + if (Media->MediaId != MediaId) { + return EFI_MEDIA_CHANGED; + } + + WorkingBuffer = Buffer; + WorkingBufferSize = BufferSize; + + // + // Allocate a temporary buffer for operation + // + DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM; + + if (Media->IoAlign > 1) { + PreData = AllocatePool (DataBufferSize + Media->IoAlign); + Data = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign; + } else { + PreData = AllocatePool (DataBufferSize); + Data = PreData; + } + + if (PreData == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Lba = DivU64x32Remainder (Offset, BlockSize, &UnderRun); + + Length = BlockSize - UnderRun; + TransactionComplete = FALSE; + + Status = EFI_SUCCESS; + if (UnderRun != 0) { + // + // Offset starts in the middle of an Lba, so read the entire block. + // + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + Lba, + BlockSize, + Data + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + if (Length > BufferSize) { + Length = BufferSize; + TransactionComplete = TRUE; + } + + CopyMem (WorkingBuffer, Data + UnderRun, Length); + + WorkingBuffer += Length; + + WorkingBufferSize -= Length; + if (WorkingBufferSize == 0) { + goto Done; + } + + Lba += 1; + } + + OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun); + + if (!TransactionComplete && WorkingBufferSize >= BlockSize) { + // + // If the DiskIo maps directly to a BlockIo device do the read. + // + if (OverRun != 0) { + WorkingBufferSize -= OverRun; + } + // + // Check buffer alignment + // + IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1); + + if (Media->IoAlign <= 1 || IsBufferAligned == 0) { + // + // Alignment is satisfied, so read them together + // + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + Lba, + WorkingBufferSize, + WorkingBuffer + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + WorkingBuffer += WorkingBufferSize; + + } else { + // + // Use the allocated buffer instead of the original buffer + // to avoid alignment issue. + // Here, the allocated buffer (8-byte align) can satisfy the alignment + // + LastRead = FALSE; + do { + if (WorkingBufferSize <= DataBufferSize) { + // + // It is the last calling to readblocks in this loop + // + DataBufferSize = WorkingBufferSize; + LastRead = TRUE; + } + + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + Lba, + DataBufferSize, + Data + ); + if (EFI_ERROR (Status)) { + goto Done; + } + + CopyMem (WorkingBuffer, Data, DataBufferSize); + WorkingBufferSize -= DataBufferSize; + WorkingBuffer += DataBufferSize; + Lba += DATA_BUFFER_BLOCK_NUM; + } while (!LastRead); + } + } + + if (!TransactionComplete && OverRun != 0) { + // + // Last read is not a complete block. + // + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + OverRunLba, + BlockSize, + Data + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + CopyMem (WorkingBuffer, Data, OverRun); + } + +Done: + if (PreData != NULL) { + gBS->FreePool (PreData); + } + + return Status; +} + +EFI_STATUS +EFIAPI +DiskIoWriteDisk ( + IN EFI_DISK_IO_PROTOCOL *This, + IN UINT32 MediaId, + IN UINT64 Offset, + IN UINTN BufferSize, + IN VOID *Buffer + ) +/*++ + + Routine Description: + Read BufferSize bytes from Offset into Buffer. + + Writes may require a read modify write to support writes that are not + aligned on sector boundaries. There are three cases: + + UnderRun - The first byte is not on a sector boundary or the write request + is less than a sector in length. Read modify write is required. + + Aligned - A write of N contiguous sectors. + + OverRun - The last byte is not on a sector boundary. Read modified write + required. + + Arguments: + This - Protocol instance pointer. + MediaId - Id of the media, changes every time the media is replaced. + Offset - The starting byte offset to read from. + BufferSize - Size of Buffer. + Buffer - Buffer containing read data. + + Returns: + EFI_SUCCESS - The data was written correctly to the device. + EFI_WRITE_PROTECTED - The device can not be written to. + EFI_DEVICE_ERROR - The device reported an error while performing the write. + EFI_NO_MEDIA - There is no media in the device. + EFI_MEDIA_CHNAGED - The MediaId does not matched the current device. + EFI_INVALID_PARAMETER - The write request contains device addresses that are not + valid for the device. + EFI_OUT_OF_RESOURCES + +--*/ +{ + EFI_STATUS Status; + DISK_IO_PRIVATE_DATA *Private; + EFI_BLOCK_IO_PROTOCOL *BlockIo; + EFI_BLOCK_IO_MEDIA *Media; + UINT32 BlockSize; + UINT64 Lba; + UINT64 OverRunLba; + UINT32 UnderRun; + UINT32 OverRun; + BOOLEAN TransactionComplete; + UINTN WorkingBufferSize; + UINT8 *WorkingBuffer; + UINTN Length; + UINT8 *Data; + UINT8 *PreData; + UINTN IsBufferAligned; + UINTN DataBufferSize; + BOOLEAN LastWrite; + + Private = DISK_IO_PRIVATE_DATA_FROM_THIS (This); + + BlockIo = Private->BlockIo; + Media = BlockIo->Media; + BlockSize = Media->BlockSize; + + if (Media->ReadOnly) { + return EFI_WRITE_PROTECTED; + } + + if (Media->MediaId != MediaId) { + return EFI_MEDIA_CHANGED; + } + + DataBufferSize = BlockSize * DATA_BUFFER_BLOCK_NUM; + + if (Media->IoAlign > 1) { + PreData = AllocatePool (DataBufferSize + Media->IoAlign); + Data = PreData - ((UINTN) PreData & (Media->IoAlign - 1)) + Media->IoAlign; + } else { + PreData = AllocatePool (DataBufferSize); + Data = PreData; + } + + if (PreData == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + WorkingBuffer = Buffer; + WorkingBufferSize = BufferSize; + + Lba = DivU64x32Remainder (Offset, BlockSize, &UnderRun); + + Length = BlockSize - UnderRun; + TransactionComplete = FALSE; + + Status = EFI_SUCCESS; + if (UnderRun != 0) { + // + // Offset starts in the middle of an Lba, so do read modify write. + // + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + Lba, + BlockSize, + Data + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + if (Length > BufferSize) { + Length = BufferSize; + TransactionComplete = TRUE; + } + + CopyMem (Data + UnderRun, WorkingBuffer, Length); + + Status = BlockIo->WriteBlocks ( + BlockIo, + MediaId, + Lba, + BlockSize, + Data + ); + if (EFI_ERROR (Status)) { + goto Done; + } + + WorkingBuffer += Length; + WorkingBufferSize -= Length; + if (WorkingBufferSize == 0) { + goto Done; + } + + Lba += 1; + } + + OverRunLba = Lba + DivU64x32Remainder (WorkingBufferSize, BlockSize, &OverRun); + + if (!TransactionComplete && WorkingBufferSize >= BlockSize) { + // + // If the DiskIo maps directly to a BlockIo device do the write. + // + if (OverRun != 0) { + WorkingBufferSize -= OverRun; + } + // + // Check buffer alignment + // + IsBufferAligned = (UINTN) WorkingBuffer & (UINTN) (Media->IoAlign - 1); + + if (Media->IoAlign <= 1 || IsBufferAligned == 0) { + // + // Alignment is satisfied, so write them together + // + Status = BlockIo->WriteBlocks ( + BlockIo, + MediaId, + Lba, + WorkingBufferSize, + WorkingBuffer + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + WorkingBuffer += WorkingBufferSize; + + } else { + // + // The buffer parameter is not aligned with the request + // So use the allocated instead. + // It can fit almost all the cases. + // + LastWrite = FALSE; + do { + if (WorkingBufferSize <= DataBufferSize) { + // + // It is the last calling to writeblocks in this loop + // + DataBufferSize = WorkingBufferSize; + LastWrite = TRUE; + } + + CopyMem (Data, WorkingBuffer, DataBufferSize); + Status = BlockIo->WriteBlocks ( + BlockIo, + MediaId, + Lba, + DataBufferSize, + Data + ); + if (EFI_ERROR (Status)) { + goto Done; + } + + WorkingBufferSize -= DataBufferSize; + WorkingBuffer += DataBufferSize; + Lba += DATA_BUFFER_BLOCK_NUM; + } while (!LastWrite); + } + } + + if (!TransactionComplete && OverRun != 0) { + // + // Last bit is not a complete block, so do a read modify write. + // + Status = BlockIo->ReadBlocks ( + BlockIo, + MediaId, + OverRunLba, + BlockSize, + Data + ); + + if (EFI_ERROR (Status)) { + goto Done; + } + + CopyMem (Data, WorkingBuffer, OverRun); + + Status = BlockIo->WriteBlocks ( + BlockIo, + MediaId, + OverRunLba, + BlockSize, + Data + ); + if (EFI_ERROR (Status)) { + goto Done; + } + } + +Done: + if (PreData != NULL) { + gBS->FreePool (PreData); + } + + return Status; +} diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c b/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c index 5bb54a201e..43fe3fdfda 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/Common/DxeStatusCodeCommon.c @@ -27,7 +27,7 @@ This includes information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. A system may contain multiple entities that match a class/subclass pairing. @@ -122,7 +122,7 @@ DxeStatusCodeDriverEntry ( This includes information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. A system may contain multiple entities that match a class/subclass pairing. @@ -206,7 +206,7 @@ ReportDispatcher ( to virtual address. @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function¡¯s context, which is + @param Context Pointer to the notification function's context, which is always zero in current implementation. **/ diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c index 1598397209..c5da3220ce 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/DataHubStatusCodeWorker.c @@ -88,13 +88,13 @@ FreeRecordBuffer ( /** Report status code into DataHub. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h index 16fa3e8097..e03dc37241 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h +++ b/EdkModulePkg/Universal/StatusCode/Dxe/DxeStatusCode.h @@ -102,13 +102,13 @@ EfiSerialStatusCodeInitializeWorker ( /** Convert status code value and extended data to readable ASCII string, send string to serial I/O device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. @@ -155,13 +155,13 @@ RtMemoryStatusCodeInitializeWorker ( @param RtMemoryStatusCodeTable Point to Runtime memory table header. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. @@ -196,13 +196,13 @@ DataHubStatusCodeInitializeWorker ( /** Report status code into DataHub. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c b/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c index 3838069bb5..614ad5094e 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c @@ -178,7 +178,7 @@ DxeStatusCodeDriverEntry ( virtual mode. @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function¡¯s context, which is + @param Context Pointer to the notification function's context, which is always zero in current implementation. **/ diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c index c0c9edd939..532ea819ec 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/RtMemoryStatusCodeWorker.c @@ -58,13 +58,13 @@ RtMemoryStatusCodeInitializeWorker ( @param RtMemoryStatusCodeTable Point to Runtime memory table header. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c index 69e3e10757..d4912836bc 100644 --- a/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c @@ -46,13 +46,13 @@ EfiSerialStatusCodeInitializeWorker ( /** Convert status code value and extended data to readable ASCII string, send string to serial I/O device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c index 5614d80c6a..9b703878fd 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/MemoryStausCodeWorker.c @@ -76,13 +76,13 @@ MemoryStatusCodeInitializeWorker ( /** Report status code into GUID'ed HOB.. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c index 29db86d4d3..0671201233 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.c @@ -29,7 +29,7 @@ This includes information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. A system may contain multiple entities that match a class/subclass pairing. @@ -80,7 +80,7 @@ EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = { This includes information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. A system may contain multiple entities that match a class/subclass pairing. diff --git a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h index f27ae88fcf..88ea9ce260 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h +++ b/EdkModulePkg/Universal/StatusCode/Pei/PeiStatusCode.h @@ -22,13 +22,13 @@ /** Convert status code value and extended data to readable ASCII string, send string to serial I/O device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. @@ -73,13 +73,13 @@ MemoryStatusCodeInitializeWorker ( /** Report status code into GUID'ed HOB. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c index b63692a68d..3cd072ca2c 100644 --- a/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c +++ b/EdkModulePkg/Universal/StatusCode/Pei/SerialStatusCodeWorker.c @@ -18,13 +18,13 @@ /** Convert status code value and extended data to readable ASCII string, send string to serial I/O device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c index a0a9619197..2c625fe86e 100644 --- a/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c +++ b/EdkModulePkg/Universal/UserInterface/HiiDataBase/Dxe/Forms.c @@ -144,11 +144,11 @@ Routine Description: Arguments: - DataTable ¨C On input, this parameter point to the EFI_HII_DATA_TABLE structure + DataTable - On input, this parameter point to the EFI_HII_DATA_TABLE structure of the final data buffer for the EFI_HII_EXPORT interface. This function update the NumberOfVariableData attribute. IfrData - It points to a staring address of a EFI_HII_IFR_PACK structure. - ExportBufferPtr ¨C On input, it points the starting address of the data buffer to + ExportBufferPtr - On input, it points the starting address of the data buffer to host the variable pack. On output, it is the starting address of data buffer for the next extraction operation. Returns: diff --git a/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootMaint.h b/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootMaint.h index 8352b10172..d2a3e3d30e 100644 --- a/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootMaint.h +++ b/EdkNt32Pkg/Dxe/PlatformBds/Generic/BootMaint/BootMaint.h @@ -346,8 +346,8 @@ typedef struct { // // Driver Option Add Handle page storage // - UINT16 DriverAddHandleDesc[75]; - UINT16 DriverAddHandleOptionalData[75]; + UINT16 DriverAddHandleDesc[100]; + UINT16 DriverAddHandleOptionalData[100]; UINT8 DriverAddActive; UINT8 DriverAddForceReconnect; diff --git a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c index e226027392..25f2c3c81e 100644 --- a/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c +++ b/EdkNt32Pkg/Library/Nt32OemHookStatusCodeLib/Nt32OemHookStatusCodeLib.c @@ -79,13 +79,13 @@ OemHookStatusCodeInitialize ( /** Report status code to OEM device. - @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below. + @param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below. @param Value Describes the current status of a hardware or software entity. This included information about the class and subclass that is used to classify the entity as well as an operation. For progress codes, the operation is the current activity. For error codes, it is the exception. For debug codes, it is not defined at this time. - Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below. + Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below. Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification. @param Instance The enumeration of a hardware or software entity within the system. diff --git a/MdePkg/Include/Library/BaseMemoryLib.h b/MdePkg/Include/Library/BaseMemoryLib.h index af3e1ecfaf..66051525ec 100644 --- a/MdePkg/Include/Library/BaseMemoryLib.h +++ b/MdePkg/Include/Library/BaseMemoryLib.h @@ -45,7 +45,7 @@ CopyMem ( Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. @@ -148,7 +148,7 @@ SetMem64 ( This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. @@ -201,7 +201,7 @@ CompareMem ( then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. @@ -229,7 +229,7 @@ ScanMem8 ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. @@ -257,7 +257,7 @@ ScanMem16 ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. @@ -285,7 +285,7 @@ ScanMem32 ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. @@ -357,7 +357,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h index d8bbe38387..a2aafcfd7a 100644 --- a/MdePkg/Include/Library/MemoryAllocationLib.h +++ b/MdePkg/Include/Library/MemoryAllocationLib.h @@ -306,7 +306,7 @@ AllocateReservedZeroPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -329,7 +329,7 @@ AllocateCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -352,7 +352,7 @@ AllocateRuntimeCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. diff --git a/MdePkg/Include/Library/UefiDecompressLib.h b/MdePkg/Include/Library/UefiDecompressLib.h index f744abc7eb..d08a6eb3a0 100644 --- a/MdePkg/Include/Library/UefiDecompressLib.h +++ b/MdePkg/Include/Library/UefiDecompressLib.h @@ -64,7 +64,7 @@ UefiDecompressGetInfo ( This function is designed so that the decompression algorithm can be implemented without using any memory services. As a result, this function is not allowed to - call any memory allocation services in its implementation. It is the caller¡¯s r + call any memory allocation services in its implementation. It is the caller's r esponsibility to allocate and free the Destination and Scratch buffers. If the compressed source data specified by Source is sucessfully decompressed into Destination, then RETURN_SUCCESS is returned. If the compressed source data diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index dd27078396..18be1b6347 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -189,7 +189,7 @@ EfiInitializeLock ( /** - This function raises the system¡¯s current task priority level to the task + This function raises the system's current task priority level to the task priority level of the mutual exclusion lock. Then, it places the lock in the acquired state. @@ -203,7 +203,7 @@ EfiAcquireLock ( ); /** - This function raises the system¡¯s current task priority level to the task + This function raises the system's current task priority level to the task priority level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state. @@ -221,7 +221,7 @@ EfiAcquireLockOrFail ( /** This function transitions a mutual exclusion lock from the acquired state to - the released state, and restores the system¡¯s task priority level to its + the released state, and restores the system's task priority level to its previous level. @param Lock A pointer to the lock to release. diff --git a/MdePkg/Include/Library/UefiRuntimeLib.h b/MdePkg/Include/Library/UefiRuntimeLib.h index 921b959548..b1d6af43da 100644 --- a/MdePkg/Include/Library/UefiRuntimeLib.h +++ b/MdePkg/Include/Library/UefiRuntimeLib.h @@ -55,7 +55,7 @@ EfiGoneVirtual ( capabilities of hardware platform. @param Time A pointer to storage to receive a snapshot of the current time. - @param Capabilities An optional pointer to a buffer to receive the real time clock device¡¯s + @param Capabilities An optional pointer to a buffer to receive the real time clock device's capabilities. @retval EFI_SUCCESS Success to execute the function. diff --git a/MdePkg/Include/Peim/PeiCis.h b/MdePkg/Include/Peim/PeiCis.h index 5578648a9c..5bf71eb6b9 100644 --- a/MdePkg/Include/Peim/PeiCis.h +++ b/MdePkg/Include/Peim/PeiCis.h @@ -259,7 +259,7 @@ EFI_STATUS ); /** - This service published by the PEI Foundation abstracts the creation of a Hand-Off Block's (HOB¡¯s) headers. + This service published by the PEI Foundation abstracts the creation of a Hand-Off Block's (HOB's) headers. @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. @param Type The type of HOB to be installed. diff --git a/MdePkg/Include/Ppi/BlockIo.h b/MdePkg/Include/Ppi/BlockIo.h index 4bb029ff43..5809c478e2 100644 --- a/MdePkg/Include/Ppi/BlockIo.h +++ b/MdePkg/Include/Ppi/BlockIo.h @@ -64,7 +64,7 @@ EFI_STATUS ); /** - Gets a block device¡¯s media information. + Gets a block device's media information. @param PeiServices General-purpose services that are available to every PEIM @param This Indicates the EFI_PEI_RECOVERY_BLOCK_IO_PPI instance. diff --git a/MdePkg/Include/Ppi/Pcd.h b/MdePkg/Include/Ppi/Pcd.h index d87b351a28..38b04bfc98 100644 --- a/MdePkg/Include/Ppi/Pcd.h +++ b/MdePkg/Include/Ppi/Pcd.h @@ -767,7 +767,7 @@ EFI_STATUS @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. @param[in, out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. If the input token namespace or token number does not exist on the platform, an error is - returned and the value of *TokenNumber is undefined. To retrieve the ¡°first¡± token, + returned and the value of *TokenNumber is undefined. To retrieve the "first" token, have the pointer reference a TokenNumber value of 0. If the input token number is 0 and there is no valid token number for this token namespace, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid diff --git a/MdePkg/Include/Ppi/ReadOnlyVariable.h b/MdePkg/Include/Ppi/ReadOnlyVariable.h index e730ce8493..ee00e14147 100644 --- a/MdePkg/Include/Ppi/ReadOnlyVariable.h +++ b/MdePkg/Include/Ppi/ReadOnlyVariable.h @@ -40,7 +40,7 @@ typedef struct _EFI_PEI_READ_ONLY_VARIABLE_PPI EFI_PEI_READ_ONLY_VARIABLE_PPI; Get Variable value by Name and GUID pair @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation. - @param VariableName A NULL-terminated Unicode string that is the name of the vendor¡¯s variable. + @param VariableName A NULL-terminated Unicode string that is the name of the vendor's variable. @param VendorGuid A unique identifier for the vendor. @param Attributes If not NULL, a pointer to the memory location to return the attributes bitmask for the variable. diff --git a/MdePkg/Include/Ppi/Security.h b/MdePkg/Include/Ppi/Security.h index b0f0626406..0be9b4a32d 100644 --- a/MdePkg/Include/Ppi/Security.h +++ b/MdePkg/Include/Ppi/Security.h @@ -56,7 +56,7 @@ EFI_STATUS /** @par Ppi Description: This PPI is installed by some platform PEIM that abstracts the security - policy to the PEI Foundation, namely the case of a PEIM¡¯s authentication + policy to the PEI Foundation, namely the case of a PEIM's authentication state being returned during the PEI section extraction process. @param AuthenticationState diff --git a/MdePkg/Include/Protocol/Arp.h b/MdePkg/Include/Protocol/Arp.h index 7394f3fb6a..ddcc740eb4 100644 --- a/MdePkg/Include/Protocol/Arp.h +++ b/MdePkg/Include/Protocol/Arp.h @@ -73,8 +73,8 @@ EFI_STATUS Inserts an entry to the ARP cache. @param This A pointer to the EFI_ARP_PROTOCOL instance. - @param DenyFlag Set to TRUE if this entry is a ¡°deny¡± entry. Set to FALSE if this - entry is a ¡°normal¡± entry. + @param DenyFlag Set to TRUE if this entry is a "deny" entry. Set to FALSE if this + entry is a "normal" entry. @param TargetSwAddress Pointer to a protocol address to add (or deny). May be set to NULL if DenyFlag is TRUE. @param TargetHwAddress Pointer to a hardware address to add (or deny). May be set to diff --git a/MdePkg/Include/Protocol/Bis.h b/MdePkg/Include/Protocol/Bis.h index 138a3270fa..37d1952c17 100644 --- a/MdePkg/Include/Protocol/Bis.h +++ b/MdePkg/Include/Protocol/Bis.h @@ -161,7 +161,7 @@ EFI_STATUS /** Frees memory structures allocated and returned by other functions in the EFI_BIS protocol. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param ToFree An EFI_BIS_DATA* and associated memory block to be freed. @@ -181,10 +181,10 @@ EFI_STATUS ); /** - Shuts down an application¡¯s instance of the BIS service, invalidating the application handle. After + Shuts down an application's instance of the BIS service, invalidating the application handle. After this call, other BIS functions may no longer be invoked using the application handle value. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @retval EFI_SUCCESS The function completed successfully. @@ -204,7 +204,7 @@ EFI_STATUS Retrieves the certificate that has been configured as the identity of the organization designated as the source of authorization for signatures of boot objects. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param Certificate The function writes an allocated EFI_BIS_DATA* containing the Boot Object Authorization Certificate object. @@ -229,7 +229,7 @@ EFI_STATUS Verifies the integrity and authorization of the indicated data object according to the indicated credentials. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param Credentials A Signed Manifest containing verification information for the indicated data object. @@ -259,7 +259,7 @@ EFI_STATUS /** Retrieves the current status of the Boot Authorization Check Flag. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param CheckIsRequired The function writes the value TRUE if a Boot Authorization Check is currently required on this platform, otherwise the function writes @@ -284,7 +284,7 @@ EFI_STATUS Retrieves a unique token value to be included in the request credential for the next update of any parameter in the Boot Object Authorization set - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param UpdateToken The function writes an allocated EFI_BIS_DATA* containing the new unique update token value. @@ -308,7 +308,7 @@ EFI_STATUS /** Updates one of the configurable parameters of the Boot Object Authorization set. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param RequestCredential This is a Signed Manifest with embedded attributes that carry the details of the requested update. @@ -337,7 +337,7 @@ EFI_STATUS Verifies the integrity and authorization of the indicated data object according to the indicated credentials and authority certificate. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param Credentials A Signed Manifest containing verification information for the indicated data object. @@ -345,7 +345,7 @@ EFI_STATUS @param SectionName An ASCII (not Unicode) string giving the section name in the manifest holding the verification information (in other words, hash value) that corresponds to DataObject. - @param AuthorityCertificate A digital certificate whose public key must match the signer¡¯s + @param AuthorityCertificate A digital certificate whose public key must match the signer's public key which is found in the credentials. @param IsVerified The function writes TRUE if the verification was successful. Otherwise, the function writes FALSE. @@ -377,7 +377,7 @@ EFI_STATUS Retrieves a list of digital certificate identifier, digital signature algorithm, hash algorithm, and keylength combinations that the platform supports. - @param AppHandle An opaque handle that identifies the caller¡¯s instance of initialization + @param AppHandle An opaque handle that identifies the caller's instance of initialization of the BIS service. @param SignatureInfo The function writes an allocated EFI_BIS_DATA* containing the array of EFI_BIS_SIGNATURE_INFO structures representing the supported diff --git a/MdePkg/Include/Protocol/DebugSupport.h b/MdePkg/Include/Protocol/DebugSupport.h index 4f7d3d138a..5b8ec4b0f4 100644 --- a/MdePkg/Include/Protocol/DebugSupport.h +++ b/MdePkg/Include/Protocol/DebugSupport.h @@ -512,7 +512,7 @@ VOID ); /** - Registers and enables the on-target debug agent¡¯s periodic entry point. + Registers and enables the on-target debug agent's periodic entry point. @param SystemContext Exception content. @@ -609,9 +609,9 @@ EFI_STATUS causes a fresh memory fetch to retrieve code to be executed. @param This A pointer to the EFI_DEBUG_SUPPORT_PROTOCOL instance. - @param ProcessorIndex Specifies which processor¡¯s instruction cache is to be invalidated. + @param ProcessorIndex Specifies which processor's instruction cache is to be invalidated. @param Start Specifies the physical base of the memory range to be invalidated. - @param Length Specifies the minimum number of bytes in the processor¡¯s instruction + @param Length Specifies the minimum number of bytes in the processor's instruction cache to invalidate. @retval EFI_SUCCESS The function completed successfully. diff --git a/MdePkg/Include/Protocol/FormBrowser.h b/MdePkg/Include/Protocol/FormBrowser.h index 0e52f1edaa..a16331bf2c 100644 --- a/MdePkg/Include/Protocol/FormBrowser.h +++ b/MdePkg/Include/Protocol/FormBrowser.h @@ -53,7 +53,7 @@ typedef struct { /** Provides direction to the configuration driver whether to use the HII database or a passed-in set of data. This function also establishes a - pointer to the calling driver¡¯s callback interface. + pointer to the calling driver's callback interface. @param This A pointer to the EFI_FORM_BROWSER_PROTOCOL instance. @param UseDatabase Determines whether the HII database is to be @@ -65,7 +65,7 @@ typedef struct { @param HandleCount The number of handles in the array specified by Handle. @param Packet A pointer to a set of data containing pointers to IFR and/or string data. - @param CallbackHandle The handle to the driver¡¯s callback interface. + @param CallbackHandle The handle to the driver's callback interface. This parameter is used only when the UseDatabase parameter is FALSE and an application wants to register a callback with the browser @param NvMapOverride This buffer is used only when there is no NV variable @@ -143,7 +143,7 @@ EFI_STATUS @param SendForm Provides direction to the configuration driver whether to use the HII database or to use a passed-in set of data. This functions also establishes - a pointer to the calling driver¡¯s callback interface. + a pointer to the calling driver's callback interface. @param CreatePopUp Routine used to abstract a generic dialog interface and return the diff --git a/MdePkg/Include/Protocol/FormCallback.h b/MdePkg/Include/Protocol/FormCallback.h index 2f3a527873..8845864be3 100644 --- a/MdePkg/Include/Protocol/FormCallback.h +++ b/MdePkg/Include/Protocol/FormCallback.h @@ -90,7 +90,7 @@ typedef struct { @param This A pointer to the EFI_FORM_CALLBACK_PROTOCOL instance. @param VariableName A NULL-terminated Unicode string that is the - name of the vendor¡¯s variable. + name of the vendor's variable. @param VendorGuid A unique identifier for the vendor. @param Attributes If not NULL, a pointer to the memory location to return the attribute's bit-mask for the variable. diff --git a/MdePkg/Include/Protocol/Hash.h b/MdePkg/Include/Protocol/Hash.h index 7007c78142..9355da4fff 100644 --- a/MdePkg/Include/Protocol/Hash.h +++ b/MdePkg/Include/Protocol/Hash.h @@ -85,7 +85,7 @@ typedef union { @param This Points to this instance of EFI_HASH_PROTOCOL. @param HashAlgorithm Points to the EFI_GUID which identifies the algorithm to use. - @param HashSize Holds the returned size of the algorithm¡¯s hash. + @param HashSize Holds the returned size of the algorithm's hash. @retval EFI_SUCCESS Hash size returned successfully. @retval EFI_INVALID_PARAMETER HashSize is NULL @@ -117,7 +117,7 @@ EFI_STATUS @retval EFI_SUCCESS Hash returned successfully. @retval EFI_INVALID_PARAMETER Message or Hash is NULL @retval EFI_UNSUPPORTED The algorithm specified by HashAlgorithm is not supported by this - driver. Or extend is TRUE and the algorithm doesn¡¯t support extending the hash. + driver. Or extend is TRUE and the algorithm doesn't support extending the hash. **/ typedef diff --git a/MdePkg/Include/Protocol/Hii.h b/MdePkg/Include/Protocol/Hii.h index bb213d8d57..04e74a019e 100644 --- a/MdePkg/Include/Protocol/Hii.h +++ b/MdePkg/Include/Protocol/Hii.h @@ -526,7 +526,7 @@ EFI_STATUS terminator of the string. @param GlyphBufferSize A pointer to a value. On output, if the function returns EFI_SUCCESS, it contains the amount of memory that is required to - store the string¡¯s glyph equivalent. + store the string's glyph equivalent. @retval EFI_SUCCESS All glyphs are available. Note that an empty string always returns this value. diff --git a/MdePkg/Include/Protocol/IdeControllerInit.h b/MdePkg/Include/Protocol/IdeControllerInit.h index 0249055bc5..d43ee0baf9 100644 --- a/MdePkg/Include/Protocol/IdeControllerInit.h +++ b/MdePkg/Include/Protocol/IdeControllerInit.h @@ -311,7 +311,7 @@ EFI_STATUS @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance. @param Channel Zero-based channel number. @param Device Zero-based device number on the Channel. - @param IdentifyData The device¡¯s response to the ATA IDENTIFY_DEVICE command. + @param IdentifyData The device's response to the ATA IDENTIFY_DEVICE command. @retval EFI_SUCCESS The information was accepted without any errors. @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount). diff --git a/MdePkg/Include/Protocol/LegacyBiosPlatform.h b/MdePkg/Include/Protocol/LegacyBiosPlatform.h index 8a0604f5d0..8c394f2ea5 100644 --- a/MdePkg/Include/Protocol/LegacyBiosPlatform.h +++ b/MdePkg/Include/Protocol/LegacyBiosPlatform.h @@ -168,7 +168,7 @@ EFI_STATUS @param DeviceHandle List of PCI devices in the system. @param ShadowAddress First free OpROM area, after other OpROMs have been dispatched. @param Compatibility16Table Pointer to Compatibility16Table. - @param AdditionalData Mode specific Pointer to additional data returned ¨C mode specific. + @param AdditionalData Mode specific Pointer to additional data returned - mode specific. @retval EFI_SUCCESS RomImage is valid @retval EFI_UNSUPPORTED Mode is not supported on the platform. diff --git a/MdePkg/Include/Protocol/LegacyRegion.h b/MdePkg/Include/Protocol/LegacyRegion.h index 9016ecbf32..e7e24ad3a5 100644 --- a/MdePkg/Include/Protocol/LegacyRegion.h +++ b/MdePkg/Include/Protocol/LegacyRegion.h @@ -111,7 +111,7 @@ EFI_STATUS /** @par Protocol Description: - Abstracts the hardware control of the physical address region 0xC0000¨C0xFFFFF + Abstracts the hardware control of the physical address region 0xC0000-C0xFFFFF for the traditional BIOS. @param Decode diff --git a/MdePkg/Include/Protocol/Mtftp4.h b/MdePkg/Include/Protocol/Mtftp4.h index cb2f3f5451..9c0e0734b7 100644 --- a/MdePkg/Include/Protocol/Mtftp4.h +++ b/MdePkg/Include/Protocol/Mtftp4.h @@ -291,7 +291,7 @@ EFI_STATUS the default parameters that were set in the EFI_MTFTP4_PROTOCOL.Configure() function are used. @param Filename Pointer to ASCIIZ file name string. - @param ModeStr Pointer to ASCIIZ mode string. If NULL, ¡°octet¡± will be used. + @param ModeStr Pointer to ASCIIZ mode string. If NULL, "octet" will be used. @param OptionCount Number of option/value string pairs in OptionList. @param OptionList Pointer to array of option/value string pairs. Ignored if OptionCount is zero. @@ -422,7 +422,7 @@ EFI_STATUS /** - Downloads a data file ¡°directory¡± from an MTFTPv4 server. May be unsupported in some EFI + Downloads a data file "directory" from an MTFTPv4 server. May be unsupported in some EFI implementations. @param This Pointer to the EFI_MTFTP4_PROTOCOL instance. diff --git a/MdePkg/Include/Protocol/Pcd.h b/MdePkg/Include/Protocol/Pcd.h index f071036220..7741df17ea 100644 --- a/MdePkg/Include/Protocol/Pcd.h +++ b/MdePkg/Include/Protocol/Pcd.h @@ -765,7 +765,7 @@ EFI_STATUS @param[in] Guid The 128-bit unique value that designates the namespace from which to extract the value. @param[in,out] TokenNumber A pointer to the PCD token number to use to find the subsequent token number. If the input token namespace or token number does not exist on the platform, - an error is returned and the value of *TokenNumber is undefined. To retrieve the ¡°first¡± token, + an error is returned and the value of *TokenNumber is undefined. To retrieve the "first" token, have the pointer reference a TokenNumber value of 0. If the input token number is 0 and there is no valid token number for this token namespace, *TokenNumber will be assigned to 0 and the function return EFI_SUCCESS. If the token number is the last valid token number, diff --git a/MdePkg/Include/Protocol/PciIo.h b/MdePkg/Include/Protocol/PciIo.h index 18494b3394..147f6b2441 100644 --- a/MdePkg/Include/Protocol/PciIo.h +++ b/MdePkg/Include/Protocol/PciIo.h @@ -245,7 +245,7 @@ EFI_STATUS ); /** - Provides the PCI controller¨Cspecific addresses needed to access system memory. + Provides the PCI controller-Cspecific addresses needed to access system memory. @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. @param Operation Indicates if the bus master is going to read or write to system memory. @@ -360,13 +360,13 @@ EFI_STATUS ); /** - Retrieves this PCI controller¡¯s current PCI bus number, device number, and function number. + Retrieves this PCI controller's current PCI bus number, device number, and function number. @param This A pointer to the EFI_PCI_IO_PROTOCOL instance. - @param SegmentNumber The PCI controller¡¯s current PCI segment number. - @param BusNumber The PCI controller¡¯s current PCI bus number. - @param DeviceNumber The PCI controller¡¯s current PCI device number. - @param FunctionNumber The PCI controller¡¯s current PCI function number. + @param SegmentNumber The PCI controller's current PCI segment number. + @param BusNumber The PCI controller's current PCI bus number. + @param DeviceNumber The PCI controller's current PCI device number. + @param FunctionNumber The PCI controller's current PCI function number. @retval EFI_SUCCESS The PCI controller location was returned. @retval EFI_INVALID_PARAMETER One or more parameters are invalid. diff --git a/MdePkg/Include/Protocol/PciPlatform.h b/MdePkg/Include/Protocol/PciPlatform.h index c9491097e3..1c1a6c31fc 100644 --- a/MdePkg/Include/Protocol/PciPlatform.h +++ b/MdePkg/Include/Protocol/PciPlatform.h @@ -191,7 +191,7 @@ EFI_STATUS Retrieves the platform policy regarding enumeration. @param GetPciRom - Gets the PCI device¡¯s option ROM from a platform-specific location. + Gets the PCI device's option ROM from a platform-specific location. **/ struct _EFI_PCI_PLATFORM_PROTOCOL { diff --git a/MdePkg/Include/Protocol/PciRootBridgeIo.h b/MdePkg/Include/Protocol/PciRootBridgeIo.h index 06912da283..db0a4eed5f 100644 --- a/MdePkg/Include/Protocol/PciRootBridgeIo.h +++ b/MdePkg/Include/Protocol/PciRootBridgeIo.h @@ -167,7 +167,7 @@ EFI_STATUS ); /** - Provides the PCI controller¨Cspecific addresses required to access system memory from a + Provides the PCI controller-Cspecific addresses required to access system memory from a DMA bus master. @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. diff --git a/MdePkg/Include/Protocol/PxeBaseCode.h b/MdePkg/Include/Protocol/PxeBaseCode.h index 14a6848255..7fb2a80c42 100644 --- a/MdePkg/Include/Protocol/PxeBaseCode.h +++ b/MdePkg/Include/Protocol/PxeBaseCode.h @@ -506,9 +506,9 @@ EFI_STATUS @param NewSendGUID If not NULL, a pointer to a value that specifies whether to replace the current value of SendGUID. @param NewTTL If not NULL, a pointer to be used in place of the current value of TTL, - the ¡°time to live¡± field of the IP header. + the "time to live" field of the IP header. @param NewToS If not NULL, a pointer to be used in place of the current value of ToS, - the ¡°type of service¡± field of the IP header. + the "type of service" field of the IP header. @param NewMakeCallback If not NULL, a pointer to a value that specifies whether to replace the current value of the MakeCallback field of the Mode structure. diff --git a/MdePkg/Include/Protocol/SmmSxDispatch.h b/MdePkg/Include/Protocol/SmmSxDispatch.h index 4d6811f3fc..43570aa425 100644 --- a/MdePkg/Include/Protocol/SmmSxDispatch.h +++ b/MdePkg/Include/Protocol/SmmSxDispatch.h @@ -61,7 +61,7 @@ typedef struct { Dispatch function for a Sx state SMI handler. @param DispatchHandle Handle of this dispatch function. - @param DispatchContext Pointer to the dispatch function¡¯s context. + @param DispatchContext Pointer to the dispatch function's context. The Type and Phase fields are filled in by the Sx dispatch driver prior to invoking this dispatch function. For this interface, the Sx driver will call the dispatch function for all Sx type diff --git a/MdePkg/Include/Protocol/TapeIo.h b/MdePkg/Include/Protocol/TapeIo.h index 8f15b3a2aa..919c95bc70 100644 --- a/MdePkg/Include/Protocol/TapeIo.h +++ b/MdePkg/Include/Protocol/TapeIo.h @@ -67,7 +67,7 @@ typedef struct { @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero BufferSize or the device is operating in fixed block size mode and the BufferSize was not a multiple of - device¡¯s fixed block size + device's fixed block size @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media. @@ -104,7 +104,7 @@ EFI_STATUS @retval EFI_INVALID_PARAMETER A NULL Buffer was specified with a non-zero BufferSize or the device is operating in fixed block size mode and the BufferSize was not a multiple of - device¡¯s fixed block size + device's fixed block size @retval EFI_DEVICE_ERROR A device error occurred while attempting to transfer data from the media. diff --git a/MdePkg/Include/Protocol/Tcp4.h b/MdePkg/Include/Protocol/Tcp4.h index 87dea25e32..11354b577e 100644 --- a/MdePkg/Include/Protocol/Tcp4.h +++ b/MdePkg/Include/Protocol/Tcp4.h @@ -171,7 +171,7 @@ typedef struct { @retval EFI_SUCCESS The mode data was read. @retval EFI_INVALID_PARAMETER This is NULL. - @retval EFI_NOT_STARTED No configuration data is available because this instance hasn¡¯t + @retval EFI_NOT_STARTED No configuration data is available because this instance hasn't been started. **/ @@ -278,7 +278,7 @@ EFI_STATUS - This is NULL. - ConnectionToken is NULL. - ConnectionToken->CompletionToken.Event is NULL. - @retval EFI_OUT_OF_RESOURCES The driver can¡¯t allocate enough resource to initiate the activeopen. + @retval EFI_OUT_OF_RESOURCES The driver can't allocate enough resource to initiate the activeopen. @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. **/ diff --git a/MdePkg/Include/Protocol/Usb2HostController.h b/MdePkg/Include/Protocol/Usb2HostController.h index 1b1245cb8b..15742281b7 100644 --- a/MdePkg/Include/Protocol/Usb2HostController.h +++ b/MdePkg/Include/Protocol/Usb2HostController.h @@ -101,7 +101,7 @@ EFI_STATUS @retval EFI_SUCCESS The state information of the host controller was returned in State. @retval EFI_INVALID_PARAMETER State is NULL. @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the - host controller¡¯s current state. + host controller's current state. **/ typedef diff --git a/MdePkg/Include/Protocol/UsbHostController.h b/MdePkg/Include/Protocol/UsbHostController.h index cab9bcdd45..20e6fccb4c 100644 --- a/MdePkg/Include/Protocol/UsbHostController.h +++ b/MdePkg/Include/Protocol/UsbHostController.h @@ -60,7 +60,7 @@ EFI_STATUS @retval EFI_SUCCESS The state information of the host controller was returned in State. @retval EFI_INVALID_PARAMETER State is NULL. - @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller¡¯s + @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller's current state. **/ diff --git a/MdePkg/Include/Protocol/UsbIo.h b/MdePkg/Include/Protocol/UsbIo.h index 30309e3035..47de143d85 100644 --- a/MdePkg/Include/Protocol/UsbIo.h +++ b/MdePkg/Include/Protocol/UsbIo.h @@ -123,7 +123,7 @@ EFI_STATUS /** This function is used to manage a USB device with an interrupt transfer pipe. An Asynchronous - Interrupt Transfer is typically used to query a device¡¯s status at a fixed rate. For example, + Interrupt Transfer is typically used to query a device's status at a fixed rate. For example, keyboard, mouse, and hub devices use this type of transfer to query their interrupt endpoints at a fixed rate. @@ -131,7 +131,7 @@ EFI_STATUS @param DeviceEndpoint A pointer to the USB device request that will be sent to the USB device. @param IsNewTransfer If TRUE, a new transfer will be submitted to USB controller. If - FALSE, the interrupt transfer is deleted from the device¡¯s interrupt + FALSE, the interrupt transfer is deleted from the device's interrupt transfer queue. @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed. diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index 53d601bbf0..8c5b22e2ac 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -381,7 +381,7 @@ EFI_STATUS Invoke a notification event @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function¡¯s context, + @param Context Pointer to the notification function's context, which is implementation-dependent. **/ @@ -396,9 +396,9 @@ VOID Creates an event. @param Type The type of event to create and its mode and attributes. - @param NotifyTpl Pointer to the notification function¡¯s context. - @param NotifyFunction Pointer to the event¡¯s notification function, if any. - @param NotifyContext Pointer to the notification function¡¯s context; corresponds to parameter + @param NotifyTpl Pointer to the notification function's context. + @param NotifyFunction Pointer to the event's notification function, if any. + @param NotifyContext Pointer to the notification function's context; corresponds to parameter Context in the notification function. @param Event Pointer to the newly created event if the call succeeds; undefined otherwise. @@ -422,9 +422,9 @@ EFI_STATUS Creates an event in a group. @param Type The type of event to create and its mode and attributes. - @param NotifyTpl Pointer to the notification function¡¯s context. - @param NotifyFunction Pointer to the event¡¯s notification function, if any. - @param NotifyContext Pointer to the notification function¡¯s context; corresponds to parameter + @param NotifyTpl Pointer to the notification function's context. + @param NotifyFunction Pointer to the event's notification function, if any. + @param NotifyContext Pointer to the notification function's context; corresponds to parameter Context in the notification function. @param EventGroup Pointer to the unique identifier of the group to which this event belongs. @param Event Pointer to the newly created event if the call succeeds; undefined @@ -554,7 +554,7 @@ EFI_STATUS #define EFI_TPL_HIGH_LEVEL TPL_HIGH_LEVEL /** - Raises a task¡¯s priority level and returns its previous level. + Raises a task's priority level and returns its previous level. @param NewTpl The new task priority level. @@ -568,7 +568,7 @@ EFI_TPL ); /** - Restores a task¡¯s priority level to its previous value. + Restores a task's priority level to its previous value. @param OldTpl The previous task priority level to restore @@ -590,7 +590,7 @@ VOID Returns the value of a variable. @param VariableName A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. @param VendorGuid A unique identifier for the vendor. @param Attributes If not NULL, a pointer to the memory location to return the attributes bitmask for the variable. @@ -645,7 +645,7 @@ EFI_STATUS Sets the value of a variable. @param VariableName A Null-terminated Unicode string that is the name of the - vendor¡¯s variable. + vendor's variable. @param VendorGuid A unique identifier for the vendor. @param Attributes Attributes bitmask to set for the variable. @param DataSize The size in bytes of the Data buffer. @@ -684,7 +684,7 @@ typedef struct { @param Time A pointer to storage to receive a snapshot of the current time. @param Capabilities An optional pointer to a buffer to receive the real time clock - device¡¯s capabilities. + device's capabilities. @retval EFI_SUCCESS The operation completed successfully. @retval EFI_INVALID_PARAMETER Time is NULL. @@ -778,7 +778,7 @@ EFI_STATUS manager, and that the boot manager is attempting to load FilePath as a boot selection. Ignored if SourceBuffer is not NULL. - @param ParentImageHandle The caller¡¯s image handle. + @param ParentImageHandle The caller's image handle. @param FilePath The DeviceHandle specific file path from which the image is loaded. @param SourceBuffer If not NULL, a pointer to the memory location containing a copy @@ -809,7 +809,7 @@ EFI_STATUS ); /** - Transfers control to a loaded image¡¯s entry point. + Transfers control to a loaded image's entry point. @param ImageHandle Handle of image to be started. @param ExitDataSize Pointer to the size, in bytes, of ExitData. @@ -833,7 +833,7 @@ EFI_STATUS Terminates a loaded EFI image and returns control to boot services. @param ImageHandle Handle that identifies the image. - @param ExitStatus The image¡¯s exit code. + @param ExitStatus The image's exit code. @param ExitDataSize The size, in bytes, of ExitData. @param ExitData Pointer to a data buffer that includes a Null-terminated Unicode string, optionally followed by additional binary data. @@ -903,7 +903,7 @@ EFI_STATUS ); /** - Sets the system¡¯s watchdog timer. + Sets the system's watchdog timer. @param Timeout The number of seconds to set the watchdog timer to. @param WatchdogCode The numeric code to log on a watchdog timer timeout event. @@ -976,7 +976,7 @@ EFI_STATUS ); /** - Returns the next high 32 bits of the platform¡¯s monotonic counter. + Returns the next high 32 bits of the platform's monotonic counter. @param HighCount Pointer to returned value. diff --git a/MdePkg/Library/BaseDebugLibNull/DebugLib.c b/MdePkg/Library/BaseDebugLibNull/DebugLib.c index db0b0a97a7..eeaf7859d3 100644 --- a/MdePkg/Library/BaseDebugLibNull/DebugLib.c +++ b/MdePkg/Library/BaseDebugLibNull/DebugLib.c @@ -114,7 +114,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/BaseMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLib/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c +++ b/MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c +++ b/MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c index c0c79c7c4a..a336417760 100644 --- a/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c +++ b/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.c @@ -746,7 +746,7 @@ UefiDecompressGetInfo ( This function is designed so that the decompression algorithm can be implemented without using any memory services. As a result, this function is not allowed to - call any memory allocation services in its implementation. It is the caller¡¯s r + call any memory allocation services in its implementation. It is the caller's r esponsibility to allocate and free the Destination and Scratch buffers. If the compressed source data specified by Source is sucessfully decompressed into Destination, then RETURN_SUCCESS is returned. If the compressed source data diff --git a/MdePkg/Library/DxeCoreHobLib/HobLib.c b/MdePkg/Library/DxeCoreHobLib/HobLib.c index c8ac8b4952..43889df497 100644 --- a/MdePkg/Library/DxeCoreHobLib/HobLib.c +++ b/MdePkg/Library/DxeCoreHobLib/HobLib.c @@ -175,7 +175,7 @@ GetFirstGuidHob ( @param ModuleName The GUID File Name of the module. @param MemoryAllocationModule The 64 bit physical address of the module. @param ModuleLength The length of the module in bytes. - @param EntryPoint The 64 bit physical address of the module’s entry point. + @param EntryPoint The 64 bit physical address of the module's entry point. **/ VOID diff --git a/MdePkg/Library/DxeHobLib/HobLib.c b/MdePkg/Library/DxeHobLib/HobLib.c index fd2d145419..b4ad4ff2f0 100644 --- a/MdePkg/Library/DxeHobLib/HobLib.c +++ b/MdePkg/Library/DxeHobLib/HobLib.c @@ -201,7 +201,7 @@ GetFirstGuidHob ( @param ModuleName The GUID File Name of the module. @param MemoryAllocationModule The 64 bit physical address of the module. @param ModuleLength The length of the module in bytes. - @param EntryPoint The 64 bit physical address of the module’s entry point. + @param EntryPoint The 64 bit physical address of the module's entry point. **/ VOID diff --git a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c index 36acc1ab9c..ab020ddc95 100644 --- a/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/DxeMemoryAllocationLib/MemoryAllocationLib.c @@ -530,7 +530,7 @@ AllocateReservedZeroPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param PoolType The type of pool to allocate. @param AllocationSize The number of bytes to allocate and zero. @@ -566,7 +566,7 @@ InternalAllocateCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -592,7 +592,7 @@ AllocateCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -618,7 +618,7 @@ AllocateRuntimeCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. diff --git a/MdePkg/Library/DxeMemoryLib/MemLibGuid.c b/MdePkg/Library/DxeMemoryLib/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/DxeMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/DxeMemoryLib/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c b/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c index 8c8bbc2719..f2ce95ddff 100644 --- a/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c +++ b/MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c @@ -172,7 +172,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/MdePkg/Library/PeiHobLib/HobLib.c b/MdePkg/Library/PeiHobLib/HobLib.c index 60a0e8c5da..3765d47cdb 100644 --- a/MdePkg/Library/PeiHobLib/HobLib.c +++ b/MdePkg/Library/PeiHobLib/HobLib.c @@ -207,7 +207,7 @@ InternalPeiCreateHob ( @param ModuleName The GUID File Name of the module. @param MemoryAllocationModule The 64 bit physical address of the module. @param ModuleLength The length of the module in bytes. - @param EntryPoint The 64 bit physical address of the module’s entry point. + @param EntryPoint The 64 bit physical address of the module's entry point. **/ VOID diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c index b4f84cb4d2..ae3481d19c 100644 --- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c +++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c @@ -508,7 +508,7 @@ AllocateReservedZeroPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param PoolType The type of pool to allocate. @param AllocationSize The number of bytes to allocate and zero. @@ -544,7 +544,7 @@ InternalAllocateCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -579,7 +579,7 @@ AllocateCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. @@ -605,7 +605,7 @@ AllocateRuntimeCopyPool ( allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. If Buffer is NULL, then ASSERT(). - If AllocationSize is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param AllocationSize The number of bytes to allocate and zero. @param Buffer The buffer to copy to the allocated buffer. diff --git a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c index 8932af7083..6f50340bd7 100644 --- a/MdePkg/Library/PeiMemoryLib/MemLibGuid.c +++ b/MdePkg/Library/PeiMemoryLib/MemLibGuid.c @@ -97,7 +97,7 @@ CompareGuid ( If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 128-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c index 29170594d3..95f134bbda 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 16-bit boundary, then ASSERT(). If Length is not aligned on a 16-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c index b54d5da07c..6a3dcd7ad2 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 32-bit boundary, then ASSERT(). If Length is not aligned on a 32-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c index 7bfc7d721e..b355fe647c 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c @@ -36,7 +36,7 @@ If Length > 0 and Buffer is NULL, then ASSERT(). If Buffer is not aligned on a 64-bit boundary, then ASSERT(). If Length is not aligned on a 64-bit boundary, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c index 0f7289d3df..2b21b22166 100644 --- a/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c @@ -34,7 +34,7 @@ then a pointer to the matching byte in the target buffer is returned. If no match is found, then NULL is returned. If Length is 0, then NULL is returned. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to scan. @param Length Number of bytes in Buffer to scan. diff --git a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c index c73168841b..e74ce8d65b 100644 --- a/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/SetMemWrapper.c @@ -29,7 +29,7 @@ Fills a target buffer with a byte value, and returns the target buffer. This function fills Length bytes of Buffer with Value, and returns Buffer. - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Memory to set. @param Length Number of bytes to set. diff --git a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c index e2ffb5c3c2..90e607c0ce 100644 --- a/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c +++ b/MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c @@ -30,7 +30,7 @@ This function fills Length bytes of Buffer with zeros, and returns Buffer. If Length > 0 and Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with zeros. @param Length Number of bytes in Buffer to fill with zeros. diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c index 5e828b4c6a..1494607309 100644 --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c @@ -136,7 +136,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c index 6b834ec3e6..041fbc72f0 100644 --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c @@ -136,7 +136,7 @@ DebugAssert ( If Buffer is NULL, then ASSERT(). - If Length is greater than (MAX_ADDRESS – Buffer + 1), then ASSERT(). + If Length is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). @param Buffer Pointer to the target buffer to fill with PcdDebugClearMemoryValue. @param Length Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index 5280d659ac..85fdc6ebe3 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -266,7 +266,7 @@ EfiInitializeLock ( } /** - This function raises the system¡¯s current task priority level to the task + This function raises the system's current task priority level to the task priority level of the mutual exclusion lock. Then, it places the lock in the acquired state. @@ -287,7 +287,7 @@ EfiAcquireLock ( } /** - This function raises the system¡¯s current task priority level to the task + This function raises the system's current task priority level to the task priority level of the mutual exclusion lock. Then, it attempts to place the lock in the acquired state. @@ -323,7 +323,7 @@ EfiAcquireLockOrFail ( /** This function transitions a mutual exclusion lock from the acquired state to - the released state, and restores the system¡¯s task priority level to its + the released state, and restores the system's task priority level to its previous level. @param Lock A pointer to the lock to release. diff --git a/MdePkg/Library/UefiLib/UefiNotTiano.c b/MdePkg/Library/UefiLib/UefiNotTiano.c index 7797608b13..9342da9744 100644 --- a/MdePkg/Library/UefiLib/UefiNotTiano.c +++ b/MdePkg/Library/UefiLib/UefiNotTiano.c @@ -21,18 +21,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. /** An empty function to pass error checking of CreateEventEx (). - This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error - checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0. + This empty function ensures that EFI_EVENT_NOTIFY_SIGNAL_ALL is error + checked correctly since it is now mapped into CreateEventEx() in UEFI 2.0. **/ -VOID -EFIAPI -InternalEmptyFuntion ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - return; +VOID +EFIAPI +InternalEmptyFuntion ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + return; } /** diff --git a/Tools/CCode/Source/Include/Protocol/Hii.h b/Tools/CCode/Source/Include/Protocol/Hii.h index ceeba1c7fb..d1c3c252d6 100644 --- a/Tools/CCode/Source/Include/Protocol/Hii.h +++ b/Tools/CCode/Source/Include/Protocol/Hii.h @@ -543,7 +543,7 @@ EFI_STATUS @param GlyphBufferSize A pointer to a value. On output, if the function returns EFI_SUCCESS, it contains the amount of memory that is required to - store the string¡¯s glyph equivalent. + store the string's glyph equivalent. @retval EFI_SUCCESS All glyphs are available. Note that an empty string always returns this value. -- 2.39.2