]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DebugLib:
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Jul 2006 04:17:04 +0000 (04:17 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 5 Jul 2006 04:17:04 +0000 (04:17 +0000)
Fix a bug in PeiDxeDebugLibReportStatusCode: it should use gReportStatusCodeDebugType so that report status code infrastructure can correctly extract debug info.
Fix functional and coding style issues in the three instances in EdkModulePkg, namely: EdkDxeDebugLibReportStatusCode, EdkUefiDebugLibStderr, EdkUefiDebugLibConout.
DevicePathLib:
Sync with MWG 0.57 and add new interface of CreateDevicePathNode(). All the function headers have been updated.
PeiServicesLib:
Adjust coding style and fix a minor comment error.
PciLib:
Adjust assert() condition to sync with MWG 0.57
BaseMemoryLib:
Adjust assert() for ScanMemXX (), ScanGuid()
Rename UefiMemoryLib to DxeMemoryLib
PrintLib:
Change the return value of all print services to exclude the NULL-terminator.
Misc:
Slightly adjust the coding style in hob.c in PeiCore module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@757 6f19259b-4bc3-4df7-8a09-765794883524

167 files changed:
EdkModulePkg/Application/HelloWorld/HelloWorld.mbd
EdkModulePkg/Bus/Pci/AtapiPassThru/Dxe/AtapiPassThru.mbd
EdkModulePkg/Bus/Pci/CirrusLogic/Dxe/CirrusLogic5430.mbd
EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebus.mbd
EdkModulePkg/Bus/Pci/IdeBus/Dxe/idebusLite.mbd
EdkModulePkg/Bus/Pci/PciBus/Dxe/LightPciBus.mbd
EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBus.mbd
EdkModulePkg/Bus/Pci/PciBus/Dxe/PciBusLite.mbd
EdkModulePkg/Bus/Pci/Uhci/Dxe/Uhci.mbd
EdkModulePkg/Bus/Scsi/ScsiBus/Dxe/ScsiBus.mbd
EdkModulePkg/Bus/Scsi/ScsiDisk/Dxe/ScsiDisk.mbd
EdkModulePkg/Bus/Usb/UsbBot/Dxe/UsbBot.mbd
EdkModulePkg/Bus/Usb/UsbBus/Dxe/UsbBus.mbd
EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi0/UsbCbi0.mbd
EdkModulePkg/Bus/Usb/UsbCbi/Dxe/Cbi1/UsbCbi1.mbd
EdkModulePkg/Bus/Usb/UsbKb/Dxe/UsbKb.mbd
EdkModulePkg/Bus/Usb/UsbMassStorage/Dxe/UsbMassStorage.mbd
EdkModulePkg/Bus/Usb/UsbMouse/Dxe/UsbMouse.mbd
EdkModulePkg/Core/Pei/Hob/Hob.c
EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/DebugLib.c
EdkModulePkg/Library/EdkDxeDebugLibReportStatusCode/EdkDxeDebugLibReportStatusCode.msa
EdkModulePkg/Library/EdkUefiDebugLibConOut/DebugLib.c
EdkModulePkg/Library/EdkUefiDebugLibConOut/EdkUefiDebugLibConOut.msa
EdkModulePkg/Library/EdkUefiDebugLibStdErr/DebugLib.c
EdkModulePkg/Library/EdkUefiDebugLibStdErr/EdkUefiDebugLibStdErr.msa
EdkModulePkg/Universal/Console/ConSplitter/Dxe/ConSplitter.mbd
EdkModulePkg/Universal/Console/GraphicsConsole/Dxe/GraphicsConsole.mbd
EdkModulePkg/Universal/Console/Terminal/Dxe/Terminal.mbd
EdkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.mbd
EdkModulePkg/Universal/DataHub/DataHubStdErr/Dxe/DataHubStdErr.mbd
EdkModulePkg/Universal/DebugSupport/Dxe/DebugSupport.mbd
EdkModulePkg/Universal/Debugger/Debugport/Dxe/DebugPort.mbd
EdkModulePkg/Universal/Disk/DiskIo/Dxe/DiskIo.mbd
EdkModulePkg/Universal/Disk/Partition/Dxe/Partition.mbd
EdkModulePkg/Universal/Disk/UnicodeCollation/English/Dxe/English.mbd
EdkModulePkg/Universal/Ebc/Dxe/Ebc.mbd
EdkModulePkg/Universal/FirmwareVolume/FaultTolerantWriteLite/Dxe/FtwLite.mbd
EdkModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.mbd
EdkModulePkg/Universal/GenericMemoryTest/Dxe/NullMemoryTest.mbd
EdkModulePkg/Universal/Network/PxeBc/Dxe/BC.mbd
EdkModulePkg/Universal/Network/PxeDhcp4/Dxe/Dhcp4.mbd
EdkModulePkg/Universal/PCD/Dxe/Pcd.mbd
EdkModulePkg/Universal/Security/SecurityStub/Dxe/SecurityStub.mbd
EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/DriverSample/DriverSample.mbd
EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/SetupBrowser.mbd
EdkModulePkg/Universal/WatchdogTimer/Dxe/WatchDogTimer.mbd
EdkNt32Pkg/Dxe/ConPlatform/ConPlatform.mbd
EdkNt32Pkg/Dxe/Nt32Platform/MiscSubclass/MiscSubclassDriver.mbd
EdkNt32Pkg/Dxe/PlatformBds/PlatformBds.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/BlockIo/WinNtBlockIo.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Console/WinNtConsole.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SerialIo/WinNtSerialIo.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/SimpleFileSystem/WinNtSimpleFileSystem.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/Uga/WinNtUga.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Bus/WinNtBusDriver/WinNtBusDriver.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Chipset/Metronome/Metronome.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Chipset/RealTimeClock/RealTimeClock.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Chipset/Reset/Reset.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Chipset/Timer/Timer.mbd
EdkNt32Pkg/Dxe/WinNtThunk/Cpu/Cpu.mbd
EdkNt32Pkg/Dxe/WinNtThunk/WinNtThunk/WinNtThunk.mbd
EdkNt32Pkg/Nt32.fpd
MdePkg/Include/Library/BaseMemoryLib.h
MdePkg/Include/Library/DevicePathLib.h
MdePkg/Include/Library/PciCf8Lib.h
MdePkg/Include/Library/PciExpressLib.h
MdePkg/Include/Library/PciLib.h
MdePkg/Include/Library/PeiServicesLib.h
MdePkg/Include/Library/PrintLib.h
MdePkg/Library/BaseMemoryLib/CompareMemWrapper.c
MdePkg/Library/BaseMemoryLib/CopyMemWrapper.c
MdePkg/Library/BaseMemoryLib/MemLibGeneric.c
MdePkg/Library/BaseMemoryLib/MemLibGuid.c
MdePkg/Library/BaseMemoryLib/MemLibInternals.h
MdePkg/Library/BaseMemoryLib/ScanMem16Wrapper.c
MdePkg/Library/BaseMemoryLib/ScanMem32Wrapper.c
MdePkg/Library/BaseMemoryLib/ScanMem64Wrapper.c
MdePkg/Library/BaseMemoryLib/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLib/SetMem16Wrapper.c
MdePkg/Library/BaseMemoryLib/SetMem32Wrapper.c
MdePkg/Library/BaseMemoryLib/SetMem64Wrapper.c
MdePkg/Library/BaseMemoryLib/SetMemWrapper.c
MdePkg/Library/BaseMemoryLib/ZeroMemWrapper.c
MdePkg/Library/BaseMemoryLibMmx/CompareMemWrapper.c
MdePkg/Library/BaseMemoryLibMmx/CopyMemWrapper.c
MdePkg/Library/BaseMemoryLibMmx/MemLibGuid.c
MdePkg/Library/BaseMemoryLibMmx/MemLibInternals.h
MdePkg/Library/BaseMemoryLibMmx/ScanMem16Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/ScanMem32Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/ScanMem64Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/SetMem16Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/SetMem32Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/SetMem64Wrapper.c
MdePkg/Library/BaseMemoryLibMmx/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibMmx/ZeroMemWrapper.c
MdePkg/Library/BaseMemoryLibRepStr/CompareMemWrapper.c
MdePkg/Library/BaseMemoryLibRepStr/CopyMemWrapper.c
MdePkg/Library/BaseMemoryLibRepStr/MemLibGuid.c
MdePkg/Library/BaseMemoryLibRepStr/MemLibInternals.h
MdePkg/Library/BaseMemoryLibRepStr/ScanMem16Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/ScanMem32Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/ScanMem64Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/SetMem16Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/SetMem32Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/SetMem64Wrapper.c
MdePkg/Library/BaseMemoryLibRepStr/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibRepStr/ZeroMemWrapper.c
MdePkg/Library/BaseMemoryLibSse2/CompareMemWrapper.c
MdePkg/Library/BaseMemoryLibSse2/CopyMemWrapper.c
MdePkg/Library/BaseMemoryLibSse2/MemLibGuid.c
MdePkg/Library/BaseMemoryLibSse2/MemLibInternals.h
MdePkg/Library/BaseMemoryLibSse2/ScanMem16Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/ScanMem32Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/ScanMem64Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/ScanMem8Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/SetMem16Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/SetMem32Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/SetMem64Wrapper.c
MdePkg/Library/BaseMemoryLibSse2/SetMemWrapper.c
MdePkg/Library/BaseMemoryLibSse2/ZeroMemWrapper.c
MdePkg/Library/BasePciCf8Lib/PciLib.c
MdePkg/Library/BasePciExpressLib/PciLib.c
MdePkg/Library/BasePciLibCf8/PciLib.c
MdePkg/Library/BasePciLibPciExpress/PciLib.c
MdePkg/Library/BasePrintLib/PrintLib.c
MdePkg/Library/BasePrintLib/PrintLibInternal.c
MdePkg/Library/BasePrintLib/PrintLibInternal.h
MdePkg/Library/DxeMemoryLib/CompareMemWrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/CopyMemWrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/DxeMemoryLib.mbd [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/DxeMemoryLib.msa [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/MemLib.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/MemLibGeneric.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/MemLibGuid.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/MemLibInternals.h [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/SetMem16Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/SetMem32Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/SetMem64Wrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/SetMemWrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c [new file with mode: 0644]
MdePkg/Library/DxeMemoryLib/build.xml [new file with mode: 0644]
MdePkg/Library/PeiDxeDebugLibReportStatusCode/DebugLib.c
MdePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.msa
MdePkg/Library/PeiMemoryLib/CompareMemWrapper.c
MdePkg/Library/PeiMemoryLib/CopyMemWrapper.c
MdePkg/Library/PeiMemoryLib/MemLibGeneric.c
MdePkg/Library/PeiMemoryLib/MemLibGuid.c
MdePkg/Library/PeiMemoryLib/MemLibInternals.h
MdePkg/Library/PeiMemoryLib/ScanMem16Wrapper.c
MdePkg/Library/PeiMemoryLib/ScanMem32Wrapper.c
MdePkg/Library/PeiMemoryLib/ScanMem64Wrapper.c
MdePkg/Library/PeiMemoryLib/ScanMem8Wrapper.c
MdePkg/Library/PeiMemoryLib/SetMem16Wrapper.c
MdePkg/Library/PeiMemoryLib/SetMem32Wrapper.c
MdePkg/Library/PeiMemoryLib/SetMem64Wrapper.c
MdePkg/Library/PeiMemoryLib/SetMemWrapper.c
MdePkg/Library/PeiMemoryLib/ZeroMemWrapper.c
MdePkg/Library/PeiServicesLib/PeiServicesLib.c
MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c
MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLib.c
MdePkg/MdePkg.spd

index 6d44bac0225bfc81f2688ee3fe8fff396f892779..caa6536f14e5d9fd2ca14fdd257614ce83a13cf3 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index 6de42bb9bbf9590289090af077f91f52a429ca04..00cee210f1ab24fc901027e01929802bc5554400 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index a8757d7b7353b772f983e15de75c7fb74b4e9585..dbbddaef22707cd45be4f1167de983cdf2a44ef5 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index b9ad38fffab6c1e888b5f1a866b3733e9d949815..315a07faa055c3df1b93b23c89ccc607fa595ee3 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index fa4bc333d4c334e733506b28f32c36b5bbe95e51..8ea34aa9b8d61ae3da4f37522bdfdfd87cf88987 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 2bed01a330778153919e60a900717c349645bdac..7f27c020606b87b374ead4ea803d7618f6478c5d 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index d343fd581ad5e0c5ffe8755b0d817088c4b811bb..08e8de6672d6c8b049117d141357e36d54424709 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 3e2db59a4c0b9ab81cf38e8cc8e378a547f9afbc..80188cd27b0497e78477b57ea8e34a23c7397a42 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index e0ea5838b77417227b0ed86640c381d589bce2d1..9af8c72bdb6b00a965042502e733432ab5887ff4 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 1681a92a1e82561a95630a23ad001070779ab223..7fd7f0f4fb5ed8f2d57afc6f461f34edfe2f2bbb 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 87b9331c244f912283c97bc56d8f00a4b81489b8..fb4ed4a5f00ccd0ac942bb429ee885578aa07f9c 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index c853ed4dc51ad59a26286e8411bd70bdb34edbc9..449b8e9cbba3ba37173fc0007139ee1ebbcf1165 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 405aab5014e39102e06b426852a090ea2c173e9c..3b40cbc28c340bfd84a90477a515bfd796d6de97 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 935e3b5c8dd7f19dfa0515c7da47d6f969ccc307..66a7e973bc4aff750a4850666a737c57f7bcb216 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 416976a869014af035d589f0ca3229d797967e5a..1dd3dbd133155c02eab67b04d994dc870b67ac42 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 7a26566d95d60115f50b70c85365c657fa2e3c08..f9d9f7ec2d425ef65f3de7c08c0900bd341762d2 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index e77c35d60e3b675918cf05e4d50c12a97115b257..ae24788cd02f4f0ae14b1dc7f09720946b498273 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 026a9bf68ca593af45ae4cde68b98d81a34bafb3..b3eca8f5589c2ec4e4ece3155114a4d71755960a 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 6117827522803c51ed02f24a44c20b74aa1b6674..1eadf9458c20af4a74c276671d90b2456f7a2f77 100644 (file)
@@ -61,7 +61,7 @@ Returns:
   \r
   PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
 \r
   \r
   PrivateData = PEI_CORE_INSTANCE_FROM_PS_THIS(PeiServices);\r
 \r
-  *HobList = PrivateData->HobList.Raw;\r
+  *HobList    = PrivateData->HobList.Raw;\r
 \r
 \r
   return EFI_SUCCESS;   \r
 \r
 \r
   return EFI_SUCCESS;   \r
@@ -111,7 +111,7 @@ Returns:
 \r
   HandOffHob = *Hob;\r
 \r
 \r
   HandOffHob = *Hob;\r
 \r
-  Length = (UINT16)((Length + 0x7) & (~0x7));\r
+  Length     = (UINT16)((Length + 0x7) & (~0x7));\r
 \r
   FreeMemory = HandOffHob->EfiFreeMemoryTop -\r
                HandOffHob->EfiFreeMemoryBottom;\r
 \r
   FreeMemory = HandOffHob->EfiFreeMemoryTop -\r
                HandOffHob->EfiFreeMemoryBottom;\r
@@ -121,9 +121,9 @@ Returns:
   }\r
   \r
   *Hob = (VOID*) (UINTN) HandOffHob->EfiEndOfHobList;\r
   }\r
   \r
   *Hob = (VOID*) (UINTN) HandOffHob->EfiEndOfHobList;\r
-  ((EFI_HOB_GENERIC_HEADER*) *Hob)->HobType = Type;\r
+  ((EFI_HOB_GENERIC_HEADER*) *Hob)->HobType   = Type;\r
   ((EFI_HOB_GENERIC_HEADER*) *Hob)->HobLength = Length;\r
   ((EFI_HOB_GENERIC_HEADER*) *Hob)->HobLength = Length;\r
-  ((EFI_HOB_GENERIC_HEADER*) *Hob)->Reserved = 0;\r
+  ((EFI_HOB_GENERIC_HEADER*) *Hob)->Reserved  = 0;\r
 \r
   HobEnd = (EFI_HOB_GENERIC_HEADER*) ((UINTN) *Hob + Length);\r
   HandOffHob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;\r
 \r
   HobEnd = (EFI_HOB_GENERIC_HEADER*) ((UINTN) *Hob + Length);\r
   HandOffHob->EfiEndOfHobList = (EFI_PHYSICAL_ADDRESS) (UINTN) HobEnd;\r
@@ -164,13 +164,13 @@ Returns:
 --*/\r
 {\r
   EFI_HOB_HANDOFF_INFO_TABLE   *Hob;\r
 --*/\r
 {\r
   EFI_HOB_HANDOFF_INFO_TABLE   *Hob;\r
-  EFI_HOB_GENERIC_HEADER              *HobEnd;\r
+  EFI_HOB_GENERIC_HEADER       *HobEnd;\r
 \r
 \r
-  Hob = (VOID *)(UINTN)MemoryBegin;\r
+  Hob    = (VOID *)(UINTN)MemoryBegin;\r
   HobEnd = (EFI_HOB_GENERIC_HEADER*) (Hob+1);\r
   HobEnd = (EFI_HOB_GENERIC_HEADER*) (Hob+1);\r
-  Hob->Header.HobType  = EFI_HOB_TYPE_HANDOFF;\r
-  Hob->Header.HobLength   = sizeof(EFI_HOB_HANDOFF_INFO_TABLE);\r
-  Hob->Header.Reserved = 0;\r
+  Hob->Header.HobType   = EFI_HOB_TYPE_HANDOFF;\r
+  Hob->Header.HobLength = sizeof(EFI_HOB_HANDOFF_INFO_TABLE);\r
+  Hob->Header.Reserved  = 0;\r
   \r
   HobEnd->HobType     = EFI_HOB_TYPE_END_OF_HOB_LIST;\r
   HobEnd->HobLength   = sizeof(EFI_HOB_GENERIC_HEADER);\r
   \r
   HobEnd->HobType     = EFI_HOB_TYPE_END_OF_HOB_LIST;\r
   HobEnd->HobLength   = sizeof(EFI_HOB_GENERIC_HEADER);\r
index 51ea6bd9ba57207fa141902af8a1079968912b06..fed9ba4d66335f6764523a6030b6fff2155cc796 100644 (file)
-/*++\r
+/** @file\r
+  EFI Debug Library that installs Debug Level Protocol.\r
 \r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
 \r
 \r
-Module Name:\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 \r
-  DebugLib.c\r
-\r
-Abstract:\r
+**/\r
 \r
 \r
-  EFI Debug Library \r
+STATIC BOOLEAN                   mDebugLevelInstalled = FALSE;\r
+STATIC EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
 \r
 \r
---*/\r
+/**\r
+  Installs Debug Level Protocol.\r
+  \r
+  The constructor function installs Debug Level Protocol on the ImageHandle.\r
+  It will ASSERT() if the installation fails and will always return EFI_SUCCESS. \r
 \r
 \r
-static BOOLEAN                   mDebugLevelInstalled = FALSE;\r
-static EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
 \r
 \r
+**/\r
 EFI_STATUS\r
 EFI_STATUS\r
+EFIAPI\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
 {\r
 {\r
-  EFI_STATUS               Status;\r
+  EFI_STATUS           Status;\r
 \r
   //\r
 \r
   //\r
-  // Initialize Debug Level Protocol\r
+  // Initialize Debug Level Protocol.\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
-  // Install Debug Level Protocol \r
+  // Install Debug Level Protocol. \r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
-                  &gEfiDebugLevelProtocolGuid, &mDebugLevel,\r
+                  &gEfiDebugLevelProtocolGuid,\r
+                  &mDebugLevel,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Set flag to show that the Debug Level Protocol has been installed\r
+  // Set flag to show that the Debug Level Protocol has been installed.\r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugAssert (\r
-  IN CHAR8  *FileName,\r
-  IN UINTN  LineNumber,\r
-  IN CHAR8  *Description\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT\r
-  information. If Error Logging hub is not loaded CpuBreakpoint ().\r
-\r
-  We use UINT64 buffers due to IPF alignment concerns.\r
-\r
-Arguments:\r
-\r
-  FileName    - File name of failing routine.\r
-\r
-  LineNumber  - Line number of failing ASSERT().\r
-\r
-  Description - Descritption, usally the assertion,\r
-  \r
-Returns:\r
-  \r
-  None\r
-\r
---*/\r
-{\r
-  UINT64                 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];\r
-  EFI_DEBUG_ASSERT_DATA  *AssertData;\r
-  UINTN                  TotalSize;\r
-  CHAR8                  *Temp;\r
-\r
-  if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) == 0) {\r
-    return;\r
-  }\r
-\r
-  //\r
-  // Make sure it will all fit in the passed in buffer\r
-  //\r
-  TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + AsciiStrLen (FileName) + 1 + AsciiStrLen (Description) + 1;\r
-  if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
-    //\r
-    // Fill in EFI_DEBUG_ASSERT_DATA\r
-    //\r
-    AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
-    AssertData->LineNumber = (UINT32)LineNumber;\r
+/**\r
 \r
 \r
-    //\r
-    // Copy Ascii FileName including NULL.\r
-    //\r
-    Temp = AsciiStrCpy ((CHAR8 *)(AssertData + 1), FileName);\r
+  Prints a debug message to the debug output device if the specified error level is enabled.\r
 \r
 \r
-    //\r
-    // Copy Ascii Description \r
-    //\r
-    AsciiStrCpy (Temp + AsciiStrLen(FileName) + 1, Description);\r
+  If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
+  the message specified by Format and the associated variable argument list to \r
+  the debug output device.\r
 \r
 \r
-    REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
-      (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
-      (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),\r
-      AssertData,\r
-      TotalSize\r
-      );\r
-  }\r
+  If Format is NULL, then ASSERT().\r
 \r
 \r
-  //\r
-  // Put break point in module that contained the error.\r
-  //\r
-  CpuBreakpoint ();\r
-}\r
+  @param  ErrorLevel  The error level of the debug message.\r
+  @param  Format      Format string for the debug message to print.\r
 \r
 \r
+**/\r
 VOID\r
 VOID\r
-DebugVPrint (\r
-  IN  UINTN    ErrorLevel,\r
-  IN  CHAR8    *Format,\r
-  IN  VA_LIST  Marker\r
+EFIAPI\r
+DebugPrint (\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  ...\r
   )\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Worker function for DEBUG(). If Error Logging hub is loaded log ASSERT\r
-  information. If Error Logging hub is not loaded do nothing.\r
-\r
-  We use UINT64 buffers due to IPF alignment concerns.\r
-\r
-Arguments:\r
-\r
-  ErrorLevel - If error level is set do the debug print.\r
-\r
-  Format     - String to use for the print, followed by Print arguments.\r
-\r
-  Marker     - VarArgs\r
-  \r
-Returns:\r
-  \r
-  None\r
-\r
---*/\r
 {\r
   UINT64          Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   UINTN           TotalSize;\r
   UINTN           Index;\r
 {\r
   UINT64          Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];\r
   EFI_DEBUG_INFO  *DebugInfo;\r
   UINTN           TotalSize;\r
   UINTN           Index;\r
+  VA_LIST         Marker;\r
   UINT64          *ArgumentPointer;\r
 \r
   UINT64          *ArgumentPointer;\r
 \r
+  //\r
+  // If Format is NULL, then ASSERT().\r
+  //\r
+  ASSERT (Format != NULL);\r
+\r
   //\r
   // Check driver Debug Level value and global debug level\r
   //\r
   //\r
   // Check driver Debug Level value and global debug level\r
   //\r
@@ -184,7 +107,7 @@ Returns:
     }\r
   }\r
 \r
     }\r
   }\r
 \r
-  TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64 *) + AsciiStrLen (Format) + 1;\r
+  TotalSize = sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64) + AsciiStrLen (Format) + 1;\r
   if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
     return;\r
   }\r
   if (TotalSize > EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
     return;\r
   }\r
@@ -198,57 +121,103 @@ Returns:
   //\r
   // 256 byte mini Var Arg stack. That is followed by the format string.\r
   //\r
   //\r
   // 256 byte mini Var Arg stack. That is followed by the format string.\r
   //\r
+  VA_START (Marker, Format);\r
   for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {\r
     *ArgumentPointer = VA_ARG (Marker, UINT64);\r
   }\r
   for (Index = 0, ArgumentPointer = (UINT64 *)(DebugInfo + 1); Index < 12; Index++, ArgumentPointer++) {\r
     *ArgumentPointer = VA_ARG (Marker, UINT64);\r
   }\r
+  VA_END (Marker);\r
   AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);\r
 \r
   AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);\r
 \r
-  //\r
-  //\r
-  //\r
-  REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
+  REPORT_STATUS_CODE_EX (\r
     EFI_DEBUG_CODE,\r
     (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),\r
     EFI_DEBUG_CODE,\r
     (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),\r
+    0,\r
+    NULL,\r
+    &gEfiStatusCodeDataTypeDebugGuid,\r
     DebugInfo,\r
     TotalSize\r
     );\r
 }\r
 \r
     DebugInfo,\r
     TotalSize\r
     );\r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugPrint (\r
-  IN  UINTN  ErrorLevel,\r
-  IN  CHAR8  *Format,\r
-  ...\r
-  )\r
-/*++\r
 \r
 \r
-Routine Description:\r
+/**\r
 \r
 \r
-  Wrapper for DebugVPrint ()\r
-  \r
-Arguments:\r
+  Prints an assert message containing a filename, line number, and description.  \r
+  This may be followed by a breakpoint or a dead loop.\r
 \r
 \r
-  ErrorLevel - If error level is set do the debug print.\r
+  Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
+  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
+  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
+  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
+  CpuDeadLoop() is called.  If neither of these bits are set, then this function \r
+  returns immediately after the message is printed to the debug output device.\r
+  DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
+  processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
 \r
-  Format     - String to use for the print, followed by Print arguments.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  ...        - Print arguments.\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
 \r
-Returns:\r
-  \r
-  None\r
+  @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
+  @param  LineNumber   The line number in the source file that generated the assert condition\r
+  @param  Description  Pointer to the description of the assert condition.\r
 \r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugAssert (\r
+  IN CONST CHAR8  *FileName,\r
+  IN UINTN        LineNumber,\r
+  IN CONST CHAR8  *Description\r
+  )\r
 {\r
 {\r
-  VA_LIST Marker;\r
+  UINT64                 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];\r
+  EFI_DEBUG_ASSERT_DATA  *AssertData;\r
+  UINTN                  TotalSize;\r
+  CHAR8                  *Temp;\r
 \r
 \r
-  VA_START (Marker, Format);\r
-  DebugVPrint (ErrorLevel, Format, Marker);\r
-  VA_END (Marker);\r
+  //\r
+  // Make sure it will all fit in the passed in buffer.\r
+  //\r
+  TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA) + AsciiStrLen (FileName) + 1 + AsciiStrLen (Description) + 1;\r
+  if (TotalSize <= EFI_STATUS_CODE_DATA_MAX_SIZE) {\r
+    //\r
+    // Fill in EFI_DEBUG_ASSERT_DATA\r
+    //\r
+    AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
+    AssertData->LineNumber = (UINT32)LineNumber;\r
+\r
+    //\r
+    // Copy Ascii FileName including NULL.\r
+    //\r
+    Temp = AsciiStrCpy ((CHAR8 *)(AssertData + 1), FileName);\r
+\r
+    //\r
+    // Copy Ascii Description. \r
+    //\r
+    AsciiStrCpy (Temp + AsciiStrLen (FileName) + 1, Description);\r
+\r
+    REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
+      (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
+      (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE),\r
+      AssertData,\r
+      TotalSize\r
+      );\r
+  }\r
+\r
+  //\r
+  // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r
+  //\r
+  if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
+    CpuBreakpoint ();\r
+  } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
+    CpuDeadLoop ();\r
+  }\r
 }\r
 \r
 }\r
 \r
+\r
 /**\r
 /**\r
+\r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
@@ -258,8 +227,8 @@ Returns:
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
-  @param  Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
-  @param  Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
+  @param   Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
+  @param   Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
 \r
   @return  Buffer\r
 \r
 \r
   @return  Buffer\r
 \r
@@ -271,11 +240,29 @@ DebugClearMemory (
   IN UINTN  Length\r
   )\r
 {\r
   IN UINTN  Length\r
   )\r
 {\r
-//  SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
-  SetMem (Buffer, Length, 0xAF);\r
-  return Buffer;\r
+  //\r
+  // If Buffer is NULL, then ASSERT().\r
+  //\r
+  ASSERT (Buffer != NULL);\r
+\r
+  //\r
+  // SetMem() checks for the the ASSERT() condition on Length and returns Buffer\r
+  //\r
+  return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
 }\r
 \r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if ASSERT() macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
@@ -285,6 +272,18 @@ DebugAssertEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
@@ -294,6 +293,18 @@ DebugPrintEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CODE()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
@@ -303,6 +314,18 @@ DebugCodeEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
@@ -311,4 +334,3 @@ DebugClearMemoryEnabled (
 {\r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
 }\r
 {\r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
 }\r
-\r
index 3de21286b0a6ea5f90411e1fc4bdb550c65d758c..752bc570a48ffa93b600f94fafc55dbd256ff3b4 100644 (file)
     <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
   </PackageDependencies>\r
   <Protocols>\r
     <Package PackageGuid="B6EC423C-21D2-490D-85C6-DD5864EAA674"/>\r
   </PackageDependencies>\r
   <Protocols>\r
-    <Protocol Usage="ALWAYS_CONSUMED">\r
+    <Protocol Usage="ALWAYS_PRODUCED">\r
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>StatusCodeDataTypeDebug</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
+      <TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>\r
+      <HelpText/>\r
+    </PcdEntry>\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
index 9945143dc45ded90a45158a1a305d416fbefbcb7..5f5f2c56ca1b1dfa8454abeb49136d8097ccfe2c 100644 (file)
-/*++\r
+/** @file\r
+  UEFI Debug Library that uses PrintLib to send messages to CONOUT.\r
 \r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
 \r
 \r
-Module Name:\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 \r
-  DebugLib.c\r
+**/\r
 \r
 \r
-Abstract:\r
+//\r
+// Define the maximum debug and assert message length that this library supports. \r
+//\r
+#define MAX_DEBUG_MESSAGE_LENGTH  0x100\r
 \r
 \r
-  UEFI Debug Library that uses PrintLib to send messages to CONOUT\r
+STATIC BOOLEAN                   mDebugLevelInstalled = FALSE;\r
+STATIC EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
 \r
 \r
---*/\r
+/**\r
+  Installs Debug Level Protocol.\r
+  \r
+  The constructor function installs Debug Level Protocol on the ImageHandle.\r
+  It will ASSERT() if the installation fails and will always return EFI_SUCCESS. \r
 \r
 \r
-static BOOLEAN                   mDebugLevelInstalled = FALSE;\r
-static EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
 \r
 \r
+**/\r
 EFI_STATUS\r
 EFI_STATUS\r
+EFIAPI\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
 {\r
 {\r
-  EFI_STATUS               Status;\r
+  EFI_STATUS           Status;\r
 \r
   //\r
 \r
   //\r
-  // Initialize Debug Level Protocol\r
+  // Initialize Debug Level Protocol.\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
-  // Install Debug Level Protocol \r
+  // Install Debug Level Protocol. \r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
-                  &gEfiDebugLevelProtocolGuid, &mDebugLevel,\r
+                  &gEfiDebugLevelProtocolGuid,\r
+                  &mDebugLevel,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Set flag to show that the Debug Level Protocol has been installed\r
+  // Set flag to show that the Debug Level Protocol has been installed.\r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugPrint (\r
-  IN  UINTN  ErrorLevel,\r
-  IN  CHAR8  *Format,\r
-  ...\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Wrapper for DebugVPrint ()\r
-  \r
-Arguments:\r
+/**\r
 \r
 \r
-  ErrorLevel - If error level is set do the debug print.\r
+  Prints a debug message to the debug output device if the specified error level is enabled.\r
 \r
 \r
-  Format     - String to use for the print, followed by Print arguments.\r
+  If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
+  the message specified by Format and the associated variable argument list to \r
+  the debug output device.\r
 \r
 \r
-  ...        - Print arguments.\r
+  If Format is NULL, then ASSERT().\r
 \r
 \r
-Returns:\r
-  \r
-  None\r
+  @param  ErrorLevel  The error level of the debug message.\r
+  @param  Format      Format string for the debug message to print.\r
 \r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugPrint (\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  ...\r
+  )\r
 {\r
 {\r
-  CHAR16   Buffer[0x100];\r
-  CHAR16   UnicodeBuffer[0x100];\r
-  UINT32   Index;\r
+  CHAR16   Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
   VA_LIST  Marker;\r
 \r
   //\r
   VA_LIST  Marker;\r
 \r
   //\r
-  // Check to see if CONOUT is avilable\r
+  // If Format is NULL, then ASSERT().\r
   //\r
   //\r
-  if (gST->ConOut == NULL) {\r
-    return;\r
-  }\r
+  ASSERT (Format != NULL);\r
 \r
   //\r
   // Check driver Debug Level value and global debug level\r
 \r
   //\r
   // Check driver Debug Level value and global debug level\r
@@ -114,83 +108,80 @@ Returns:
     }\r
   }\r
 \r
     }\r
   }\r
 \r
-  //\r
-  // BUGBUG: Need print that take CHAR8 Format and returns CHAR16 Buffer\r
-  //\r
-  for (Index = 0; Format[Index] != 0; Index++) {\r
-    UnicodeBuffer[Index] = Format[Index];\r
-  }\r
-  UnicodeBuffer[Index] = Format[Index];\r
-\r
   //\r
   // Convert the DEBUG() message to a Unicode String\r
   //\r
   VA_START (Marker, Format);\r
   //\r
   // Convert the DEBUG() message to a Unicode String\r
   //\r
   VA_START (Marker, Format);\r
-  UnicodeVSPrint (Buffer, sizeof (Buffer), UnicodeBuffer, Marker);\r
+  UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);\r
   VA_END (Marker);\r
 \r
   //\r
   VA_END (Marker);\r
 \r
   //\r
-  // Send the print string to the Standard Error device\r
+  // Send the print string to the Console Output device if CONOUT is available.\r
   //\r
   //\r
-  gST->ConOut->OutputString (gST->ConOut, Buffer);\r
+  if (gST->ConOut != NULL) {\r
+    gST->ConOut->OutputString (gST->ConOut, Buffer);\r
+  }\r
 }\r
 \r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugAssert (\r
-  IN CHAR8  *FileName,\r
-  IN UINTN  LineNumber,\r
-  IN CHAR8  *Description\r
-  )\r
-/*++\r
 \r
 \r
-Routine Description:\r
-\r
-  Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT\r
-  information. If Error Logging hub is not loaded CpuBreakpoint ().\r
+/**\r
 \r
 \r
-  We use UINT64 buffers due to IPF alignment concerns.\r
+  Prints an assert message containing a filename, line number, and description.  \r
+  This may be followed by a breakpoint or a dead loop.\r
 \r
 \r
-Arguments:\r
+  Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
+  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
+  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
+  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
+  CpuDeadLoop() is called.  If neither of these bits are set, then this function \r
+  returns immediately after the message is printed to the debug output device.\r
+  DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
+  processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
 \r
-  FileName    - File name of failing routine.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  LineNumber  - Line number of failing ASSERT().\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
 \r
-  Description - Descritption, usally the assertion,\r
-  \r
-Returns:\r
-  \r
-  None\r
+  @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
+  @param  LineNumber   The line number in the source file that generated the assert condition\r
+  @param  Description  Pointer to the description of the assert condition.\r
 \r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugAssert (\r
+  IN CONST CHAR8  *FileName,\r
+  IN UINTN        LineNumber,\r
+  IN CONST CHAR8  *Description\r
+  )\r
 {\r
 {\r
-  CHAR16  Buffer[0x100];\r
-\r
-  //\r
-  // Check to see if CONOUT is avilable\r
-  //\r
-  if (gST->ConOut == NULL) {\r
-    return;\r
-  }\r
+  CHAR16  Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
 \r
   //\r
   // Generate the ASSERT() message in Unicode format\r
   //\r
 \r
   //\r
   // Generate the ASSERT() message in Unicode format\r
   //\r
-  UnicodeSPrint (Buffer, sizeof (Buffer), (CHAR16 *)L"ASSERT %s(%d): %s\n", FileName, LineNumber, Description);\r
+  UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);\r
 \r
   //\r
 \r
   //\r
-  // Send the print string to the Standard Error device\r
+  // Send the print string to the Console Output device if CONOUT is available.\r
   //\r
   //\r
-  gST->ConOut->OutputString (gST->ConOut, Buffer);\r
+  if (gST->ConOut != NULL) {\r
+    gST->ConOut->OutputString (gST->ConOut, Buffer);\r
+  }\r
 \r
   //\r
 \r
   //\r
-  // Put break point in module that contained the error.\r
+  // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r
   //\r
   //\r
-  CpuBreakpoint ();\r
+  if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
+    CpuBreakpoint ();\r
+  } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
+    CpuDeadLoop ();\r
+  }\r
 }\r
 \r
 }\r
 \r
+\r
 /**\r
 /**\r
+\r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
@@ -200,8 +191,8 @@ Returns:
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
-  @param  Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
-  @param  Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
+  @param   Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
+  @param   Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
 \r
   @return  Buffer\r
 \r
 \r
   @return  Buffer\r
 \r
@@ -213,11 +204,29 @@ DebugClearMemory (
   IN UINTN  Length\r
   )\r
 {\r
   IN UINTN  Length\r
   )\r
 {\r
-//  SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
-  SetMem (Buffer, Length, 0xAF);\r
-  return Buffer;\r
+  //\r
+  // If Buffer is NULL, then ASSERT().\r
+  //\r
+  ASSERT (Buffer != NULL);\r
+\r
+  //\r
+  // SetMem() checks for the the ASSERT() condition on Length and returns Buffer\r
+  //\r
+  return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
 }\r
 \r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if ASSERT() macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
@@ -227,6 +236,18 @@ DebugAssertEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
@@ -236,6 +257,18 @@ DebugPrintEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CODE()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
@@ -245,6 +278,18 @@ DebugCodeEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
index 915dad137aefdecf970490b674de0c606a727a12..6f7db31d7f9aac8b82fb759eb0ff080975d83339 100644 (file)
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>StatusCodeDataTypeDebug</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
+      <TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>\r
+      <HelpText/>\r
+    </PcdEntry>\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
index dc0c3ab497392d89cf1b056e0414f5cb4eb4873a..20167012848d0dbd2b0e397c8c2b5b4cc0a9d074 100644 (file)
-/*++\r
+/** @file\r
+  UEFI Debug Library that uses PrintLib to send messages to STDERR.\r
 \r
 \r
-Copyright (c) 2006, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
-are licensed and made available under the terms and conditions of the BSD License         \r
-which accompanies this distribution.  The full text of the license may be found at        \r
-http://opensource.org/licenses/bsd-license.php                                            \r
-                                                                                          \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
 \r
 \r
-Module Name:\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 \r
-  DebugLib.c\r
+**/\r
 \r
 \r
-Abstract:\r
+//\r
+// Define the maximum debug and assert message length that this library supports. \r
+//\r
+#define MAX_DEBUG_MESSAGE_LENGTH  0x100\r
 \r
 \r
-  UEFI Debug Library that uses PrintLib to send messages to STDERR\r
+STATIC BOOLEAN                   mDebugLevelInstalled = FALSE;\r
+STATIC EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
 \r
 \r
---*/\r
+/**\r
+  Installs Debug Level Protocol.\r
+  \r
+  The constructor function installs Debug Level Protocol on the ImageHandle.\r
+  It will ASSERT() if the installation fails and will always return EFI_SUCCESS. \r
 \r
 \r
-static BOOLEAN                   mDebugLevelInstalled = FALSE;\r
-static EFI_DEBUG_LEVEL_PROTOCOL  mDebugLevel = { 0 };\r
+  @param  ImageHandle   The firmware allocated handle for the EFI image.\r
+  @param  SystemTable   A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.\r
 \r
 \r
+**/\r
 EFI_STATUS\r
 EFI_STATUS\r
+EFIAPI\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 DebugLibConstructor (\r
   IN EFI_HANDLE        ImageHandle,\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-Arguments:\r
-\r
-Returns:\r
-\r
---*/\r
 {\r
 {\r
-  EFI_STATUS               Status;\r
+  EFI_STATUS           Status;\r
 \r
   //\r
 \r
   //\r
-  // Initialize Debug Level Protocol\r
+  // Initialize Debug Level Protocol.\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
   //\r
   mDebugLevel.DebugLevel = PcdGet32(PcdDebugPrintErrorLevel);\r
 \r
   //\r
-  // Install Debug Level Protocol \r
+  // Install Debug Level Protocol. \r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &ImageHandle,\r
-                  &gEfiDebugLevelProtocolGuid, &mDebugLevel,\r
+                  &gEfiDebugLevelProtocolGuid,\r
+                  &mDebugLevel,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
   //\r
-  // Set flag to show that the Debug Level Protocol has been installed\r
+  // Set flag to show that the Debug Level Protocol has been installed.\r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
   //\r
   mDebugLevelInstalled = TRUE;\r
 \r
-  return EFI_SUCCESS;\r
+  return Status;\r
 }\r
 \r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugPrint (\r
-  IN  UINTN  ErrorLevel,\r
-  IN  CHAR8  *Format,\r
-  ...\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Wrapper for DebugVPrint ()\r
-  \r
-Arguments:\r
+/**\r
 \r
 \r
-  ErrorLevel - If error level is set do the debug print.\r
+  Prints a debug message to the debug output device if the specified error level is enabled.\r
 \r
 \r
-  Format     - String to use for the print, followed by Print arguments.\r
+  If any bit in ErrorLevel is also set in PcdDebugPrintErrorLevel, then print \r
+  the message specified by Format and the associated variable argument list to \r
+  the debug output device.\r
 \r
 \r
-  ...        - Print arguments.\r
+  If Format is NULL, then ASSERT().\r
 \r
 \r
-Returns:\r
-  \r
-  None\r
+  @param  ErrorLevel  The error level of the debug message.\r
+  @param  Format      Format string for the debug message to print.\r
 \r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugPrint (\r
+  IN  UINTN        ErrorLevel,\r
+  IN  CONST CHAR8  *Format,\r
+  ...\r
+  )\r
 {\r
 {\r
-  CHAR16   Buffer[0x100];\r
-  CHAR16   UnicodeBuffer[0x100];\r
-  UINT32   Index;\r
+  CHAR16   Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
   VA_LIST  Marker;\r
 \r
   //\r
   VA_LIST  Marker;\r
 \r
   //\r
-  // Check to see if STDERR is avilable\r
+  // If Format is NULL, then ASSERT().\r
   //\r
   //\r
-  if (gST->StdErr == NULL) {\r
-    return;\r
-  }\r
+  ASSERT (Format != NULL);\r
 \r
   //\r
   // Check driver Debug Level value and global debug level\r
 \r
   //\r
   // Check driver Debug Level value and global debug level\r
@@ -114,83 +108,80 @@ Returns:
     }\r
   }\r
 \r
     }\r
   }\r
 \r
-  //\r
-  // BUGBUG: Need print that take CHAR8 Format and returns CHAR16 Buffer\r
-  //\r
-  for (Index = 0; Format[Index] != 0; Index++) {\r
-    UnicodeBuffer[Index] = Format[Index];\r
-  }\r
-  UnicodeBuffer[Index] = Format[Index];\r
-\r
   //\r
   // Convert the DEBUG() message to a Unicode String\r
   //\r
   VA_START (Marker, Format);\r
   //\r
   // Convert the DEBUG() message to a Unicode String\r
   //\r
   VA_START (Marker, Format);\r
-  UnicodeVSPrint (Buffer, sizeof (Buffer), UnicodeBuffer, Marker);\r
+  UnicodeVSPrintAsciiFormat (Buffer, sizeof (Buffer), Format, Marker);\r
   VA_END (Marker);\r
 \r
   //\r
   VA_END (Marker);\r
 \r
   //\r
-  // Send the print string to the Standard Error device\r
+  // Send the print string to the Standard Error device if STDERR is available.\r
   //\r
   //\r
-  gST->StdErr->OutputString (gST->StdErr, Buffer);\r
+  if (gST->StdErr != NULL) {\r
+    gST->StdErr->OutputString (gST->StdErr, Buffer);\r
+  }\r
 }\r
 \r
 }\r
 \r
-VOID\r
-EFIAPI\r
-DebugAssert (\r
-  IN CHAR8  *FileName,\r
-  IN UINTN  LineNumber,\r
-  IN CHAR8  *Description\r
-  )\r
-/*++\r
 \r
 \r
-Routine Description:\r
-\r
-  Worker function for ASSERT(). If Error Logging hub is loaded log ASSERT\r
-  information. If Error Logging hub is not loaded CpuBreakpoint ().\r
+/**\r
 \r
 \r
-  We use UINT64 buffers due to IPF alignment concerns.\r
+  Prints an assert message containing a filename, line number, and description.  \r
+  This may be followed by a breakpoint or a dead loop.\r
 \r
 \r
-Arguments:\r
+  Print a message of the form "ASSERT <FileName>(<LineNumber>): <Description>\n" \r
+  to the debug output device.  If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of \r
+  PcdDebugProperyMask is set then CpuBreakpoint() is called. Otherwise, if \r
+  DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then \r
+  CpuDeadLoop() is called.  If neither of these bits are set, then this function \r
+  returns immediately after the message is printed to the debug output device.\r
+  DebugAssert() must actively prevent recusrsion.  If DebugAssert() is called while\r
+  processing another DebugAssert(), then DebugAssert() must return immediately.\r
 \r
 \r
-  FileName    - File name of failing routine.\r
+  If FileName is NULL, then a <FileName> string of "(NULL) Filename" is printed.\r
 \r
 \r
-  LineNumber  - Line number of failing ASSERT().\r
+  If Description is NULL, then a <Description> string of "(NULL) Description" is printed.\r
 \r
 \r
-  Description - Descritption, usally the assertion,\r
-  \r
-Returns:\r
-  \r
-  None\r
+  @param  FileName     Pointer to the name of the source file that generated the assert condition.\r
+  @param  LineNumber   The line number in the source file that generated the assert condition\r
+  @param  Description  Pointer to the description of the assert condition.\r
 \r
 \r
---*/\r
+**/\r
+VOID\r
+EFIAPI\r
+DebugAssert (\r
+  IN CONST CHAR8  *FileName,\r
+  IN UINTN        LineNumber,\r
+  IN CONST CHAR8  *Description\r
+  )\r
 {\r
 {\r
-  CHAR16  Buffer[0x100];\r
-\r
-  //\r
-  // Check to see if STDERR is avilable\r
-  //\r
-  if (gST->StdErr == NULL) {\r
-    return;\r
-  }\r
+  CHAR16  Buffer[MAX_DEBUG_MESSAGE_LENGTH];\r
 \r
   //\r
   // Generate the ASSERT() message in Unicode format\r
   //\r
 \r
   //\r
   // Generate the ASSERT() message in Unicode format\r
   //\r
-  UnicodeSPrint (Buffer, sizeof (Buffer), (CHAR16 *)L"ASSERT %s(%d): %s\n", FileName, LineNumber, Description);\r
+  UnicodeSPrintAsciiFormat (Buffer, sizeof (Buffer), "ASSERT %s(%d): %s\n", FileName, LineNumber, Description);\r
 \r
   //\r
 \r
   //\r
-  // Send the print string to the Standard Error device\r
+  // Send the print string to the Standard Error device if STDERR is available.\r
   //\r
   //\r
-  gST->StdErr->OutputString (gST->StdErr, Buffer);\r
+  if (gST->StdErr != NULL) {\r
+    gST->StdErr->OutputString (gST->StdErr, Buffer);\r
+  }\r
 \r
   //\r
 \r
   //\r
-  // Put break point in module that contained the error.\r
+  // Generate a Breakpoint, DeadLoop, or NOP based on PCD settings\r
   //\r
   //\r
-  CpuBreakpoint ();\r
+  if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED) != 0) {\r
+    CpuBreakpoint ();\r
+  } else if ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED) != 0) {\r
+    CpuDeadLoop ();\r
+  }\r
 }\r
 \r
 }\r
 \r
+\r
 /**\r
 /**\r
+\r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
   Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
 \r
   This function fills Length bytes of Buffer with the value specified by \r
@@ -200,8 +191,8 @@ Returns:
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
 \r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
-  @param  Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
-  @param  Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
+  @param   Buffer  Pointer to the target buffer to fill with PcdDebugClearMemoryValue.\r
+  @param   Length  Number of bytes in Buffer to fill with zeros PcdDebugClearMemoryValue. \r
 \r
   @return  Buffer\r
 \r
 \r
   @return  Buffer\r
 \r
@@ -213,11 +204,29 @@ DebugClearMemory (
   IN UINTN  Length\r
   )\r
 {\r
   IN UINTN  Length\r
   )\r
 {\r
-//  SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
-  SetMem (Buffer, Length, 0xAF);\r
-  return Buffer;\r
+  //\r
+  // If Buffer is NULL, then ASSERT().\r
+  //\r
+  ASSERT (Buffer != NULL);\r
+\r
+  //\r
+  // SetMem() checks for the the ASSERT() condition on Length and returns Buffer\r
+  //\r
+  return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue));\r
 }\r
 \r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if ASSERT() macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugAssertEnabled (\r
@@ -227,6 +236,18 @@ DebugAssertEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugPrintEnabled (\r
@@ -236,6 +257,18 @@ DebugPrintEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CODE()macros are enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugCodeEnabled (\r
@@ -245,6 +278,18 @@ DebugCodeEnabled (
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
   return ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
 }\r
 \r
+\r
+/**\r
+  \r
+  Returns TRUE if DEBUG_CLEAR_MEMORY()macro is enabled.\r
+\r
+  This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of \r
+  PcdDebugProperyMask is set.  Otherwise FALSE is returned.\r
+\r
+  @retval  TRUE    The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set.\r
+  @retval  FALSE   The DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear.\r
+\r
+**/\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
 BOOLEAN\r
 EFIAPI\r
 DebugClearMemoryEnabled (\r
index 327e12621f1673f8b53a4b921954f1a679bdc86f..2ab58bbbd9947d33ae5ddfcefa9ff0f6cfa5d826 100644 (file)
@@ -19,7 +19,7 @@
   <ModuleDefinitions>\r
     <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
   <ModuleDefinitions>\r
     <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
     <BinaryModule>false</BinaryModule>\r
-    <OutputFileBasename>EdkUefiDebugLibStdErr</OutputFileBasename>\r
+    <OutputFileBasename>EdkUefiDebugLibConOut</OutputFileBasename>\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">\r
   </ModuleDefinitions>\r
   <LibraryClassDefinitions>\r
     <LibraryClass Usage="ALWAYS_PRODUCED">\r
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
       <ProtocolCName>DebugLevel</ProtocolCName>\r
     </Protocol>\r
   </Protocols>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>StatusCodeDataTypeDebug</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
       <HelpText/>\r
     </PcdEntry>\r
+    <PcdEntry PcdItemType="FIXED_AT_BUILD">\r
+      <C_Name>PcdDebugClearMemoryValue</C_Name>\r
+      <TokenSpaceGuidCName>FIX_ME_PcdDebugClearMemoryValue</TokenSpaceGuidCName>\r
+      <HelpText/>\r
+    </PcdEntry>\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
     <PcdEntry PcdItemType="PATCHABLE_IN_MODULE">\r
       <C_Name>PcdDebugPrintErrorLevel</C_Name>\r
           <TokenSpaceGuidCName>gEfiMdePkgTokenSpaceGuid</TokenSpaceGuidCName>\r\r
index 6da93681ff5ec2ac00082dd41eee272a6af9c57e..8d32865aa11d262b954ffdf3429a52cd74fc6554 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index b23fd9220c3219f1dab36f8bacec52ec9897a04e..7e6d607aae2a8cc7202bb1a9fc27178393990c3a 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 230399e76e13f39123f0ee3bcff535e1d6311bd0..602b027cd56a9014a94fd0329373e77c12044ad8 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index d117880c4130b8eae426712316ef5acd74558c55..b03adbb77dd14ce12322467438ef41525a9162bb 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 3df19f1dc0ea7a7eb2f963323a5dc437067c9a50..00378d69e9873e24c11acd37451e852a09100355 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>    \r
+    <Library>DxeMemoryLib</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
index db485cb4451c89dee850cf4d2bbd4dda07b9d0e3..c85b5f0d0f90bc25feef0e5e8b137906dbd9ae5f 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>    \r
+    <Library>DxeMemoryLib</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
index 5a5f505ca565d2d353ea6642e7f22cc4be5186c4..a50e07d3dda4ff1df189e32604e6f683cde70c28 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 5cddc5ae37d3308c10e5711727e3abacfbc61bc7..36b10a99340b0f009b8710aba1199cb64cef209a 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 628c2ff3de42e0e60397c94b037d26f1a6fbdd18..20e96d20d136f1d74344b285ba75922a3f950d2f 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 4d6e50b1b91e9586d452730ea793b4d222ff7d82..8ea3fa159fde4cb5ddb7aff70293a990f65fd414 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>    \r
+    <Library>DxeMemoryLib</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>    \r
index a8ac736d1a77750771ac807fcb4a90440de3c2e9..6df88d81e874f426300036234278d067cdcb53d7 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index fa4818868cc398cdfd7e4ff7696777bff7395d7f..5a05499c18a9210b466c9a3a6a5168f713c50c27 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
index ba3ea42682e741884e259385bb545d6693fa2126..35dadef8612428bb122cd84b285444d3bc288720 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index ff035c5900bf4423af273a840982dcddfcf22405..7a9b1eec2b3a8b3db0b1107d2a58ba55ae82f2ab 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>    \r
+    <Library>DxeMemoryLib</Library>    \r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeServicesTableLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeServicesTableLib</Library>\r
index 94e8e7cff4635f6d36c9f816a8aa24966aac8b68..f3f81752975defb7ebeb2e0f0c5ab9201e4aceae 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index eda3e289f8dbd7eba9a15b50dcdcd6278eebdde7..d9a50f470815983920ab1488e48450ca18722c01 100644 (file)
@@ -29,7 +29,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
   </MbdHeader>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index 5306a8f9a284ba21ab4e3658a2da491e8bbe43ac..66bd5a03120176813a0b04916db4584f6f11431c 100644 (file)
@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index facb62ce8f513196d926cf1d795dfc6cc0dc0742..98995856df264379418539e68fdaa9a9dbfe53c6 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 24ec052551df7d4c54dc7c60e512ffce036c448d..54bcafa49fc1eb3d13c2254e8581345381b9ba1f 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index ba9532a661fa3915a45d9b0bd6f3e3e12a6ed8da..609bcf8c838852efadf980b3d3c846e36421904c 100644 (file)
@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>BaseLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>BaseLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>BasePrintLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeMemoryAllocationLib</Library>\r
     <Library>BasePrintLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeMemoryAllocationLib</Library>\r
index 9a605c91fc30119855f2144275f58b6c9f3aa3f2..1079e2692e1bb2c027d7c3c200d2b10943fc5101 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 57e0a8974d818b23a9489463c63d8e35620211d5..aa87078e811f7491bcc2acc881f92aef0ca50cf1 100644 (file)
@@ -30,7 +30,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
   <Libraries>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
index a487dba9413f56986f5f3fa04946a3d5be21ea34..0367c18338556f2afc14e2f27ca5d82969e233c8 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index 486f16882f73cc8f62383e0ac231e113d4073f27..82ffc52bf94e619a1cd772721ec2a7978ae82881 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiRuntimeServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeServicesTableLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeServicesTableLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 078350addc464ebc98f222a3007b21b05f566db2..5ac3148a6f9f99a7e9ce51f107bff848433f873a 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index 566a7481afb26183876f9ef99da85894ef8c2c86..945067077cb10642426eb0d23d189c2026f5d0df 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index a5b19f99c46b1a5b142cf5adddd07cf35d2ece78..6468fd029c06dc75073579d4a227c781d96e3071 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index 3a3e7845c656e8e8cc4939c810de9cd90d134cc0..25aef789496c77f68acd879ec30f6ecc7260eb3b 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index 18add2fe1899db6385a87b530673c1ad7b108f85..8981a35741ff08cb984593089eb3dc58a176a746 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>UefiDebugLibStdErr</Library>\r
index ca1a8f35424f39976fa1d33ab3468194663763f6..5059326ed7df4144fbd52ca1281d0052f754a1eb 100644 (file)
@@ -31,7 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>UefiBootServicesTableLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>UefiDriverModelLib</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
index 3ee5bf161fca46702545f1160623fcd6caf88fd4..1e43726ef49325794d4d499f1c9161772d3473af 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>DxeHobLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index f76db8e9afc23458d900f5355e65dc3fdbfd1791..9a824efbb3f5ce84e1979e1f7490cf13c9f17c59 100644 (file)
@@ -33,7 +33,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>DxeWinNtLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>DxeWinNtLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index ff6e2c9c3a009fc965523eb82c3147c6330e14e4..3e61fdd8dc0640694462471a2f3845c35377df9c 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>DxeHobLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index aa850fbd2c02de0d52e4a478eee2a3f24e5bfb90..1c03cfeab58374568e04fc40129032f5d0b31ee7 100644 (file)
@@ -34,7 +34,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>DxeWinNtLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>DxeWinNtLib</Library>\r
index 0e198b75243bcfb4ceaa7c544733cb0abf674c9d..7cc131daffb2fbae95c0fe8111b3720de5747ea4 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>HiiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index b58acbb65b93fe50c5856632867fe25fe1db97b5..43add04dbcbe6ec2085fc5576f78658dc5b41b38 100644 (file)
@@ -32,7 +32,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     <Library>BaseLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
     <Library>BaseLib</Library>\r
     <Library>DxeHobLib</Library>\r
     <Library>UefiLib</Library>\r
-    <Library>UefiMemoryLib</Library>\r
+    <Library>DxeMemoryLib</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
     <Library>UefiDriverEntryPoint</Library>\r
     <Library>DxeReportStatusCodeLib</Library>\r
     <Library>PeiDxeDebugLibReportStatusCode</Library>\r
index 82cbafa255138c4068f2eaa1d3fcd81721ed3bdd..7dea2ca8841542f073a61f636602b3698c96a98e 100644 (file)
         <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="b57a1df6-ffdb-4247-a3df-3a562176751a" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="331deb15-454b-48d8-9b74-70d01f3f3556" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="b57a1df6-ffdb-4247-a3df-3a562176751a" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
         <Instance ModuleGuid="a86fbfca-0183-4eeb-aa8a-762e3b7da1f3" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+        <Instance ModuleGuid="19cbbb97-ff61-45ff-8c3f-dfa66dd118c8" PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
       </Libraries>\r
       <PcdBuildDefinition>\r
         <PcdData ItemType="FIXED_AT_BUILD">\r
index 38f6c489d5dca3937b0ccfdd8d7d96f13dcd13aa..af3e1ecfafa78c5fd5e483f33841ab2c78224fbc 100644 (file)
@@ -48,7 +48,7 @@ CopyMem (
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
@@ -175,7 +175,6 @@ ZeroMem (
   If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
   If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
 \r
   If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
   If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
 \r
-\r
   @param  DestinationBuffer Pointer to the destination buffer to compare.\r
   @param  SourceBuffer      Pointer to the source buffer to compare.\r
   @param  Length            Number of bytes to compare.\r
   @param  DestinationBuffer Pointer to the destination buffer to compare.\r
   @param  SourceBuffer      Pointer to the source buffer to compare.\r
   @param  Length            Number of bytes to compare.\r
@@ -229,6 +228,7 @@ ScanMem8 (
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -256,6 +256,7 @@ ScanMem16 (
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -283,6 +284,7 @@ ScanMem32 (
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -353,7 +355,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
index 299d6071187f861c0f8dd52a4428cbf874ee2166..aee5426ca20d98027e83c93624bd2a8b7d4c5dd2 100644 (file)
 #define __DEVICE_PATH_LIB_H__\r
 \r
 /**\r
 #define __DEVICE_PATH_LIB_H__\r
 \r
 /**\r
-  This function returns the size, in bytes, \r
-  of the device path data structure specified by DevicePath.\r
-  If DevicePath is NULL, then 0 is returned.\r
+  Returns the size of a device path in bytes.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function returns the size, in bytes, of the device path data structure specified by\r
+  DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
   @return The size of a device path in bytes.\r
 \r
 \r
   @return The size of a device path in bytes.\r
 \r
@@ -31,166 +32,220 @@ UINTN
 EFIAPI\r
 GetDevicePathSize (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
 EFIAPI\r
 GetDevicePathSize (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function allocates space for a new copy of the device path\r
-  specified by DevicePath.\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function allocates space for a new copy of the device path specified by DevicePath.  If\r
+  DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
+  contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+  is returned.  Otherwise, NULL is returned.  \r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
 \r
-  @return The duplicated device path.\r
+  @return A pointer to the duplicated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath\r
-  )\r
-;\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function appends the device path SecondDevicePath\r
-  to every device path instance in FirstDevicePath. \r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  FirstDevicePath A pointer to a device path data structure.\r
-  \r
-  @param  SecondDevicePath A pointer to a device path data structure.\r
+  This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+  FirstDevicePath in a newly allocated buffer.  Only the end-of-device-path device node from\r
+  SecondDevicePath is retained. The newly created device path is returned.  \r
+  If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.  \r
+  If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.  \r
+  If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.  \r
+  If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the\r
+  responsibility of the caller to free the memory allocated.\r
+\r
+  @param  FirstDevicePath            A pointer to a device path data structure.\r
+  @param  SecondDevicePath           A pointer to a device path data structure.\r
 \r
 \r
-  @return\r
-  A pointer to the new device path is returned.\r
-  NULL is returned if space for the new device path could not be allocated from pool.\r
-  It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath\r
-  if they are no longer needed.\r
+  @return A pointer to the new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath\r
-  )\r
-;\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,  OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath  OPTIONAL\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function appends the device path node SecondDevicePath\r
-  to every device path instance in FirstDevicePath.\r
+  Creates a new path by appending the device node to the device path.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
-  \r
-  @param  DevicePathNode A pointer to a single device path node.\r
+  This function creates a new device path by appending a copy of the device node specified by\r
+  DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device node.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If DevicePathNode is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathNode             A pointer to a single device path node.\r
 \r
   @return A pointer to the new device path.\r
 \r
   @return A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode\r
-  )\r
-;\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,     OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode  OPTIONAL\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function appends the device path instance Instance to the device path Source.\r
-  If Source is NULL, then a new device path with one instance is created.  \r
-\r
-  @param  Source A pointer to a device path data structure.\r
-  @param  Instance A pointer to a device path instance.\r
+  Creates a new device path by appending the specified device path instance to the specified device\r
+  path.\r
\r
+  This function creates a new device path by appending a copy of the device path instance specified\r
+  by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device path instance\r
+  and a new end-of-device-path-instance node is inserted between. \r
+  If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+  If DevicePathInstance is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathInstance         A pointer to a device path instance.\r
 \r
 \r
-  @return\r
-  A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
+  @return A pointer to the new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Source,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Instance\r
-  )\r
-;\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,        OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance OPTIONAL\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  Function retrieves the next device path instance from a device path data structure.\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a copy of the current device path instance. It also updates DevicePath to\r
+  point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+  to hold the size of the device path instance copy.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  If Size is NULL, then ASSERT().\r
\r
+  @param  DevicePath                 On input, this holds the pointer to the current device path\r
+                                     instance. On output, this holds the pointer to the next device\r
+                                     path instance or NULL if there are no more device path\r
+                                     instances in the device path pointer to a device path data\r
+                                     structure.\r
+  @param  Size                       On output, this holds the size of the device path instance, in\r
+                                     bytes or zero, if DevicePath is NULL.\r
+\r
+  @return A pointer to the current device path instance.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
-  \r
-  @param  Size A pointer to the size of a device path instance in bytes.\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+GetNextDevicePathInstance (\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL    **DevicePath,\r
+  OUT UINTN                          *Size\r
+  );\r
+\r
+/**\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
 \r
 \r
-  @return\r
-  This function returns a pointer to the current device path instance.\r
-  In addition, it returns the size in bytes of the current device path instance in Size,\r
-  and a pointer to the next device path instance in DevicePath.\r
-  If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.\r
+  This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+  initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
+  is returned.\r
+  If NodeLength is smaller than a device path header, then NULL is returned.  \r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  NodeType                   The device node type for the new device node.\r
+  @param  NodeSubType                The device node sub-type for the new device node.\r
+  @param  NodeLength                 The length of the new device node.\r
+\r
+  @return The new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
-GetNextDevicePathInstance (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePath,\r
-     OUT UINTN                     *Size\r
-  )\r
-;\r
+CreateDeviceNode (\r
+  IN UINT8                           NodeType,\r
+  IN UINT8                           NodeSubType,\r
+  IN UINT16                          NodeLength\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  Return TRUE is this is a multi instance device path.\r
+  Determines if a device path is single or multi-instance.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+  Otherwise, FALSE is returned.  If DevicePath is NULL, then FALSE is returned.\r
 \r
 \r
-  @retval  TRUE If DevicePath is multi-instance.\r
-  @retval  FALSE If DevicePath is not multi-instance or DevicePath is NULL.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+\r
+  @retval  TRUE                      DevicePath is multi-instance.\r
+  @retval  FALSE                     DevicePath is not multi-instance or DevicePath is NULL.\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
 IsDevicePathMultiInstance (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
 \r
 **/\r
 BOOLEAN\r
 EFIAPI\r
 IsDevicePathMultiInstance (\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-;\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function retrieves the device path protocol from a handle.\r
+  Retrieves the device path protocol from a handle.\r
 \r
 \r
-  @param  Handle The handle from which to retrieve the device path protocol.\r
+  This function returns the device path protocol from the handle specified by Handle.  If Handle is\r
+  NULL or Handle does not contain a device path protocol, then NULL is returned.\r
\r
+  @param  Handle                     The handle from which to retrieve the device path protocol.\r
 \r
 \r
-  @return\r
-  This function returns the device path protocol from the handle specified by Handle.\r
-  If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.\r
+  @return The device path protocol from the handle specified by Handle.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
-  IN EFI_HANDLE  Handle\r
-  )\r
-;\r
+  IN EFI_HANDLE                      Handle\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This function allocates a device path for a file and appends it to an existing device path.\r
+  Allocates a device path for a file and appends it to an existing device path.\r
+\r
+  If Device is a valid device handle that contains a device path protocol, then a device path for\r
+  the file specified by FileName  is allocated and appended to the device path associated with the\r
+  handle Device.  The allocated device path is returned.  If Device is NULL or Device is a handle\r
+  that does not support the device path protocol, then a device path containing a single device\r
+  path node for the file specified by FileName is allocated and returned.\r
+  If FileName is NULL, then ASSERT().\r
 \r
 \r
-  @param  Device A pointer to a device handle.  This parameter is optional and may be NULL.\r
-  @param  FileName A pointer to a Null-terminated Unicode string.\r
+  @param  Device                     A pointer to a device handle.  This parameter is optional and\r
+                                     may be NULL.\r
+  @param  FileName                   A pointer to a Null-terminated Unicode string.\r
 \r
 \r
-  @return\r
-  If Device is a valid device handle that contains a device path protocol,\r
-  then a device path for the file specified by FileName is allocated\r
-  and appended to the device path associated with the handle Device. The allocated device path is returned.\r
-  If Device is NULL or Device is a handle that does not support the device path protocol,\r
-  then a device path containing a single device path node for the file specified by FileName\r
-  is allocated and returned.\r
+  @return The allocated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
-  IN EFI_HANDLE    Device,     OPTIONAL\r
-  IN CONST CHAR16  *FileName\r
-  )\r
-;\r
+  IN EFI_HANDLE                      Device,     OPTIONAL\r
+  IN CONST CHAR16                    *FileName\r
+  );\r
 \r
 #endif\r
 \r
 #endif\r
index e2ac1b2a0187637104cfeefb997eb4441ffbeb35..e2808418fabb34ee13f952c4914a9a9a0a94489c 100644 (file)
@@ -996,8 +996,7 @@ PciCf8BitFieldAndThenOr32 (
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1030,8 +1029,7 @@ PciCf8ReadBuffer (
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
index c21a2795c15149a865061b8c73678eeee84cb57a..9bd1166a8706f7608979403e4ba2bcf5afbf4fec 100644 (file)
@@ -965,8 +965,7 @@ PciExpressBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -998,8 +997,7 @@ PciExpressReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
index 4d21cb77089c6cf8e0a753fb45725a718c9a61a7..6acf13c7beb2ab8d5c854e93353f2b873d270b30 100644 (file)
@@ -960,8 +960,7 @@ PciBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -993,8 +992,7 @@ PciReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
index 10eebb5bf0b877f34dd8bb00c73ab5262b84160d..53d1cdba427bcb30d19a8595ccc04a024068e3f3 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
 /** @file\r
-  PEI Core Library implementation\r
+  Header file for PEI Services Library.\r
 \r
   Copyright (c) 2006, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
 \r
   Copyright (c) 2006, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
 /**\r
   This service enables a given PEIM to register an interface into the PEI Foundation. \r
 \r
 /**\r
   This service enables a given PEIM to register an interface into the PEI Foundation. \r
 \r
-  @param  PpiList A pointer to the list of interfaces that the caller shall install.\r
+  @param  PpiList               A pointer to the list of interfaces that the caller shall install.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The PpiList pointer is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPpi (\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *PpiList\r
-  )\r
-;\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *PpiList\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to replace an entry in the PPI database with an alternate entry.\r
 \r
 \r
 /**\r
   This service enables PEIMs to replace an entry in the PPI database with an alternate entry.\r
 \r
-  @param  OldPpi Pointer to the old PEI PPI Descriptors.\r
-  @param  NewPpi Pointer to the new PEI PPI Descriptors.\r
+  @param  OldPpi                Pointer to the old PEI PPI Descriptors.\r
+  @param  NewPpi                Pointer to the new PEI PPI Descriptors.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
-  @retval  EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
+  @retval EFI_NOT_FOUND         The PPI for which the reinstallation was requested has not been\r
+                                installed.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesReInstallPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesReInstallPpi (\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *OldPpi,\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *NewPpi\r
-  )\r
-;\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *OldPpi,\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *NewPpi\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to discover a given instance of an interface.\r
 \r
 \r
 /**\r
   This service enables PEIMs to discover a given instance of an interface.\r
 \r
-  @param  Guid A pointer to the GUID whose corresponding interface needs to be found.\r
-  @param  Instance The N-th instance of the interface that is required.\r
-  @param  PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.\r
-  @param  Ppi A pointer to the instance of the interface.\r
+  @param  Guid                  A pointer to the GUID whose corresponding interface needs to be\r
+                                found.\r
+  @param  Instance              The N-th instance of the interface that is required.\r
+  @param  PpiDescriptor         A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.\r
+  @param  Ppi                   A pointer to the instance of the interface.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully returned.\r
-  @retval  EFI_NOT_FOUND The PPI descriptor is not found in the database.\r
+  @retval EFI_SUCCESS           The interface was successfully returned.\r
+  @retval EFI_NOT_FOUND         The PPI descriptor is not found in the database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesLocatePpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesLocatePpi (\r
-  IN EFI_GUID                         *Guid,\r
-  IN UINTN                            Instance,\r
-  IN OUT EFI_PEI_PPI_DESCRIPTOR       **PpiDescriptor,\r
-  IN OUT VOID                         **Ppi\r
-  )\r
-;\r
+  IN EFI_GUID                   *Guid,\r
+  IN UINTN                      Instance,\r
+  IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r
+  IN OUT VOID                   **Ppi\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This service enables PEIMs to register a given service to be invoked\r
-  when another service is installed or reinstalled.\r
+  This service enables PEIMs to register a given service to be invoked when another service is\r
+  installed or reinstalled.\r
 \r
 \r
-  @param  NotifyList A pointer to the list of notification interfaces that the caller shall install.\r
+  @param  NotifyList            A pointer to the list of notification interfaces that the caller\r
+                                shall install.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The NotifyList pointer is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesNotifyPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesNotifyPpi (\r
-  IN EFI_PEI_NOTIFY_DESCRIPTOR        *NotifyList\r
-  )\r
-;\r
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyList\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to ascertain the present value of the boot mode.  \r
 \r
 \r
 /**\r
   This service enables PEIMs to ascertain the present value of the boot mode.  \r
 \r
-  @param  BootMode A pointer to contain the value of the boot mode.\r
+  @param  BootMode              A pointer to contain the value of the boot mode.\r
 \r
 \r
-  @retval  EFI_SUCCESS The boot mode was returned successfully.\r
-  @retval  EFI_INVALID_PARAMETER BootMode is NULL.\r
+  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetBootMode (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetBootMode (\r
-  IN OUT EFI_BOOT_MODE                *BootMode\r
-  )\r
-;\r
+  IN OUT EFI_BOOT_MODE          *BootMode\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to update the boot mode variable.    \r
 \r
 \r
 /**\r
   This service enables PEIMs to update the boot mode variable.    \r
 \r
-  @param  BootMode The value of the boot mode to set.\r
+  @param  BootMode              The value of the boot mode to set.\r
 \r
 \r
-  @retval  EFI_SUCCESS The value was successfully updated\r
+  @retval EFI_SUCCESS           The value was successfully updated\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesSetBootMode (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesSetBootMode (\r
-  IN EFI_BOOT_MODE                    BootMode\r
-  )\r
-;\r
+  IN EFI_BOOT_MODE              BootMode\r
+  );\r
 \r
 /**\r
   This service enables a PEIM to ascertain the address of the list of HOBs in memory.\r
 \r
 \r
 /**\r
   This service enables a PEIM to ascertain the address of the list of HOBs in memory.\r
 \r
-  @param  HobList A pointer to the list of HOBs that the PEI Foundation will initialize.\r
+  @param  HobList               A pointer to the list of HOBs that the PEI Foundation will initialize.\r
 \r
 \r
-  @retval  EFI_SUCCESS The list was successfully returned.\r
-  @retval  EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r
+  @retval EFI_SUCCESS           The list was successfully returned.\r
+  @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetHobList (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetHobList (\r
-  IN OUT VOID                         **HobList\r
-  )\r
-;\r
+  IN OUT VOID                   **HobList\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to create various types of HOBs.\r
 \r
 \r
 /**\r
   This service enables PEIMs to create various types of HOBs.\r
 \r
-  @param  Type The type of HOB to be installed.\r
-  @param  Length The length of the HOB to be added.\r
-  @param  Hob The address of a pointer that will contain the HOB header.\r
+  @param  Type                  The type of HOB to be installed.\r
+  @param  Length                The length of the HOB to be added.\r
+  @param  Hob                   The address of a pointer that will contain the HOB header.\r
 \r
 \r
-  @retval  EFI_SUCCESS The HOB was successfully created.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r
+  @retval EFI_SUCCESS           The HOB was successfully created.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesCreateHob (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesCreateHob (\r
-  IN UINT16                           Type,\r
-  IN UINT16                           Length,\r
-  IN OUT VOID                         **Hob\r
-  )\r
-;\r
+  IN UINT16                     Type,\r
+  IN UINT16                     Length,\r
+  IN OUT VOID                   **Hob\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware volumes.\r
 \r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware volumes.\r
 \r
-  @param  Instance This instance of the firmware volume to find.\r
-  The value 0 is the Boot Firmware Volume (BFV).\r
-  @param  FwVolHeader Pointer to the firmware volume header of the volume to return.\r
+  @param  Instance              This instance of the firmware volume to find.  The value 0 is the\r
+                                Boot Firmware Volume (BFV).\r
+  @param  FwVolHeader           Pointer to the firmware volume header of the volume to return.\r
 \r
 \r
-  @retval  EFI_SUCCESS The volume was found.\r
-  @retval  EFI_NOT_FOUND The volume was not found.\r
-  @retval  EFI_INVALID_PARAMETER FwVolHeader is NULL.\r
+  @retval EFI_SUCCESS           The volume was found.\r
+  @retval EFI_NOT_FOUND         The volume was not found.\r
+  @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextVolume (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextVolume (\r
-  IN UINTN                            Instance,\r
-  IN OUT EFI_FIRMWARE_VOLUME_HEADER   **FwVolHeader\r
-  )\r
-;\r
+  IN UINTN                          Instance,\r
+  IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware files.\r
 \r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware files.\r
 \r
-  @param  SearchType A filter to find files only of this type.\r
-  @param  FwVolHeader Pointer to the firmware volume header of the volume to search.\r
-  This parameter must point to a valid FFS volume.\r
-  @param  FileHeader Pointer to the current file from which to begin searching.\r
+  @param  SearchType            A filter to find files only of this type.\r
+  @param  FwVolHeader           Pointer to the firmware volume header of the volume to search.\r
+                                This parameter must point to a valid FFS volume.\r
+  @param  FileHeader            Pointer to the current file from which to begin searching.\r
 \r
 \r
-  @retval  EFI_SUCCESS The file was found.\r
-  @retval  EFI_NOT_FOUND The file was not found.\r
-  @retval  EFI_NOT_FOUND The header checksum was not zero.\r
+  @retval EFI_SUCCESS           The file was found.\r
+  @retval EFI_NOT_FOUND         The file was not found.\r
+  @retval EFI_NOT_FOUND         The header checksum was not zero.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextFile (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE                  SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER       *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER          **FileHeader\r
-  )\r
-;\r
+  IN EFI_FV_FILETYPE            SearchType,\r
+  IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,\r
+  IN OUT EFI_FFS_FILE_HEADER    **FileHeader\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to discover sections of a given type within a valid FFS file.\r
 \r
 \r
 /**\r
   This service enables PEIMs to discover sections of a given type within a valid FFS file.\r
 \r
-  @param  SearchType The value of the section type to find.\r
-  @param  FfsFileHeader A pointer to the file header that contains the set of sections to be searched.\r
-  @param  SectionData A pointer to the discovered section, if successful.\r
+  @param  SearchType            The value of the section type to find.\r
+  @param  FfsFileHeader         A pointer to the file header that contains the set of sections to\r
+                                be searched.\r
+  @param  SectionData           A pointer to the discovered section, if successful.\r
 \r
 \r
-  @retval  EFI_SUCCESS The section was found.\r
-  @retval  EFI_NOT_FOUND The section was not found.\r
+  @retval EFI_SUCCESS           The section was found.\r
+  @retval EFI_NOT_FOUND         The section was not found.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindSectionData (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE                 SectionType,\r
-  IN EFI_FFS_FILE_HEADER              *FfsFileHeader,\r
-  IN OUT VOID                         **SectionData\r
-  )\r
-;\r
+  IN EFI_SECTION_TYPE           SectionType,\r
+  IN EFI_FFS_FILE_HEADER        *FfsFileHeader,\r
+  IN OUT VOID                   **SectionData\r
+  );\r
 \r
 /**\r
   This service enables PEIMs to register the permanent memory configuration\r
   that has been initialized with the PEI Foundation.\r
 \r
 \r
 /**\r
   This service enables PEIMs to register the permanent memory configuration\r
   that has been initialized with the PEI Foundation.\r
 \r
-  @param  MemoryBegin The value of a region of installed memory.\r
-  @param  MemoryLength The corresponding length of a region of installed memory.\r
+  @param  MemoryBegin           The value of a region of installed memory.\r
+  @param  MemoryLength          The corresponding length of a region of installed memory.\r
 \r
 \r
-  @retval  EFI_SUCCESS The region was successfully installed in a HOB.\r
-  @retval  EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r
+  @retval EFI_SUCCESS           The region was successfully installed in a HOB.\r
+  @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPeiMemory (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPeiMemory (\r
-  IN EFI_PHYSICAL_ADDRESS             MemoryBegin,\r
-  IN UINT64                           MemoryLength\r
-  )\r
-;\r
+  IN EFI_PHYSICAL_ADDRESS       MemoryBegin,\r
+  IN UINT64                     MemoryLength\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.\r
+  This service enables PEIMs to allocate memory after the permanent memory has been installed by a\r
+  PEIM.\r
 \r
 \r
-  @param  MemoryType Type of memory to allocate.\r
-  @param  Pages Number of pages to allocate.\r
-  @param  Memory Pointer of memory allocated.\r
+  @param  MemoryType            Type of memory to allocate.\r
+  @param  Pages                 Number of pages to allocate.\r
+  @param  Memory                Pointer of memory allocated.\r
 \r
 \r
-  @retval  EFI_SUCCESS The memory range was successfully allocated.\r
-  @retval  EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
-  @retval  EFI_NOT_AVAILABLE_YET Called with permanent memory not available.\r
-  @retval  EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
+  @retval EFI_SUCCESS           The memory range was successfully allocated.\r
+  @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
+  @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.\r
+  @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePages (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePages (\r
-  IN EFI_MEMORY_TYPE                  MemoryType,\r
-  IN UINTN                            Pages,\r
-  IN OUT EFI_PHYSICAL_ADDRESS         *Memory\r
-  )\r
-;\r
+  IN EFI_MEMORY_TYPE            MemoryType,\r
+  IN UINTN                      Pages,\r
+  IN OUT EFI_PHYSICAL_ADDRESS   *Memory\r
+  );\r
 \r
 /**\r
   This service allocates memory from the Hand-Off Block (HOB) heap.\r
 \r
 \r
 /**\r
   This service allocates memory from the Hand-Off Block (HOB) heap.\r
 \r
-  @param  Size The number of bytes to allocate from the pool.\r
-  @param  Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;\r
-  undefined otherwise.\r
+  @param  Size                  The number of bytes to allocate from the pool.\r
+  @param  Buffer                If the call succeeds, a pointer to a pointer to the allocate\r
+                                buffer; undefined otherwise.\r
 \r
 \r
-  @retval  EFI_SUCCESS The allocation was successful\r
-  @retval  EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.\r
+  @retval EFI_SUCCESS           The allocation was successful\r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough heap to allocate the requested size.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePool (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePool (\r
-  IN UINTN                            Size,\r
-  OUT VOID                            **Buffer\r
-  )\r
-;\r
+  IN UINTN                      Size,\r
+  OUT VOID                      **Buffer\r
+  );\r
 \r
 /**\r
 \r
 /**\r
-  This service resets the entire platform, including all processors and devices, and reboots the system. \r
+  This service resets the entire platform, including all processors and devices, and reboots the\r
+  system. \r
 \r
 \r
-  @retval  EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
+  @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesResetSystem (\r
   VOID\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesResetSystem (\r
   VOID\r
-  )\r
-;\r
+  );\r
+\r
 \r
 #endif\r
 \r
 #endif\r
index bdab062638a3cd74009f61a0fc8fb9537c243fdf..e1b3cb37bba051bdb62606ff6351089b1b9cf674 100644 (file)
   The Unicode string is produced by parsing the format string specified by FormatString.  \r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.  \r
   The Unicode string is produced by parsing the format string specified by FormatString.  \r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.  \r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
 \r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -86,22 +90,26 @@ UnicodeVSPrint (
   and BufferSize.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the format string.\r
   and BufferSize.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the format string.\r
-  The length of the produced output buffer is returned.  \r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
 \r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -122,23 +130,27 @@ UnicodeSPrint (
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.\r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
-\r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -159,22 +171,26 @@ UnicodeVSPrintAsciiFormat (
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
-\r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -195,23 +211,27 @@ UnicodeSPrintAsciiFormat (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -232,22 +252,26 @@ AsciiVSPrint (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -268,23 +292,27 @@ AsciiSPrint (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -305,22 +333,26 @@ AsciiVSPrintUnicodeFormat (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -338,7 +370,7 @@ AsciiSPrintUnicodeFormat (
   Converts the decimal number specified by Value to a Null-terminated Unicode \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   Converts the decimal number specified by Value to a Null-terminated Unicode \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
-  The total number of characters placed in Buffer is returned.\r
+  The number of Unicode characters in Buffer is returned not including the Null-terminator.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
@@ -362,9 +394,9 @@ AsciiSPrintUnicodeFormat (
                   Unicode string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
                   Unicode string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
-  @param  Width    The maximum number of Unicode characters to place in Buffer.\r
+  @param  Width   The maximum number of Unicode characters to place in Buffer.\r
   \r
   \r
-  @return Total number of characters required to perform the conversion.\r
+  @return The number of Unicode characters in Buffer not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -382,7 +414,7 @@ UnicodeValueToString (
   Converts the decimal number specified by Value to a Null-terminated ASCII string \r
   specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   Converts the decimal number specified by Value to a Null-terminated ASCII string \r
   specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
-  The total number of characters placed in Buffer is returned.\r
+  The number of ASCII characters in Buffer is returned not including the Null-terminator.\r
   If the conversion contains more than Width characters, then only the first Width\r
   characters are returned, and the total number of characters required to perform\r
   the conversion is returned.\r
   If the conversion contains more than Width characters, then only the first Width\r
   characters are returned, and the total number of characters required to perform\r
   the conversion is returned.\r
@@ -406,9 +438,9 @@ UnicodeValueToString (
                   ASCII string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
                   ASCII string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
-  @param  Width    The maximum number of ASCII characters to place in Buffer.\r
+  @param  Width   The maximum number of ASCII characters to place in Buffer.\r
   \r
   \r
-  @return Total number of characters required to perform the conversion.\r
+  @return The number of ASCII characters in Buffer not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
index e3b0fe3fd6c38b2a4f74cbd307d4a74cf1eba745..4c0d3eaadbab5863b3e4480e0ecad15e25767a89 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 1fd00acabd531e5f82bedd49f8cc042bf8f58557..9e620e2200a5ffe9a4580c7b4a923c260fa9d2c9 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3fecfc9ff0d242b144556cfeaa1df45a64d1e5d4..759377483c910147ea92d5fb88240d0b2125a8e3 100644 (file)
@@ -16,7 +16,7 @@
 \r
     BaseMemoryLib\r
     PeiMemoryLib\r
 \r
     BaseMemoryLib\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
index ca7311a40746ee620cd6590e8e855c35c7e4a02e..8646b24e7902fd205824a613d65b58ca7b998719 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..29170594d33fa795450d8873ddf72df7252092df 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 6b0beee63223330addb361917e6bd2d7d7775692..b54d5da07c7b3777d3036e646c37ef796d33eb3b 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem32 (
   IN UINT32      Value\r
   )\r
 {\r
   IN UINT32      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 589d45c1a126175d4aa389593856fc15317dc4aa..7bfc7d721e50045264af5ef8d06174ebfa315ac7 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem64 (
   IN UINT64      Value\r
   )\r
 {\r
   IN UINT64      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 4dc8bac073f8e26ad073611c951ff35cb6601f77..0f7289d3df3726dc1f7f0f09bd89cb221f1d1368 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 41467a9cb0e1b58559e1a97020535b046dcd15d5..889339c9533d9822a5d3f47af818b3d47ee33ea4 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 425840682d2ca589f0a0997be54e938073c1ac60..15f8205ebc2c88ed16ca0bcc18f8c0208155cfdf 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 4a1eda80e8af733764e9ea0de18a41600eb91408..981a7d4731d50e950b4b2822ebed733da8cbea4c 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3965be759a20ab868938c534fb63531252f53deb..c73168841bb9989e166237530144f12f0b698d20 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -32,7 +32,7 @@
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
index 56dbe5d8be900a6a8b9102cc3c7d111e940149b3..08247681c539d6a6fd660892b6141bd99361a4d0 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index e3b0fe3fd6c38b2a4f74cbd307d4a74cf1eba745..4c0d3eaadbab5863b3e4480e0ecad15e25767a89 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 1fd00acabd531e5f82bedd49f8cc042bf8f58557..9e620e2200a5ffe9a4580c7b4a923c260fa9d2c9 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
index ca7311a40746ee620cd6590e8e855c35c7e4a02e..8646b24e7902fd205824a613d65b58ca7b998719 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..29170594d33fa795450d8873ddf72df7252092df 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 6b0beee63223330addb361917e6bd2d7d7775692..b54d5da07c7b3777d3036e646c37ef796d33eb3b 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem32 (
   IN UINT32      Value\r
   )\r
 {\r
   IN UINT32      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 589d45c1a126175d4aa389593856fc15317dc4aa..7bfc7d721e50045264af5ef8d06174ebfa315ac7 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem64 (
   IN UINT64      Value\r
   )\r
 {\r
   IN UINT64      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 4dc8bac073f8e26ad073611c951ff35cb6601f77..0f7289d3df3726dc1f7f0f09bd89cb221f1d1368 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 41467a9cb0e1b58559e1a97020535b046dcd15d5..889339c9533d9822a5d3f47af818b3d47ee33ea4 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 425840682d2ca589f0a0997be54e938073c1ac60..15f8205ebc2c88ed16ca0bcc18f8c0208155cfdf 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 4a1eda80e8af733764e9ea0de18a41600eb91408..981a7d4731d50e950b4b2822ebed733da8cbea4c 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3965be759a20ab868938c534fb63531252f53deb..c73168841bb9989e166237530144f12f0b698d20 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -32,7 +32,7 @@
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
index 56dbe5d8be900a6a8b9102cc3c7d111e940149b3..08247681c539d6a6fd660892b6141bd99361a4d0 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index e3b0fe3fd6c38b2a4f74cbd307d4a74cf1eba745..4c0d3eaadbab5863b3e4480e0ecad15e25767a89 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 1fd00acabd531e5f82bedd49f8cc042bf8f58557..9e620e2200a5ffe9a4580c7b4a923c260fa9d2c9 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
index ca7311a40746ee620cd6590e8e855c35c7e4a02e..8646b24e7902fd205824a613d65b58ca7b998719 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..29170594d33fa795450d8873ddf72df7252092df 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 6b0beee63223330addb361917e6bd2d7d7775692..b54d5da07c7b3777d3036e646c37ef796d33eb3b 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem32 (
   IN UINT32      Value\r
   )\r
 {\r
   IN UINT32      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 589d45c1a126175d4aa389593856fc15317dc4aa..7bfc7d721e50045264af5ef8d06174ebfa315ac7 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem64 (
   IN UINT64      Value\r
   )\r
 {\r
   IN UINT64      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 4dc8bac073f8e26ad073611c951ff35cb6601f77..0f7289d3df3726dc1f7f0f09bd89cb221f1d1368 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 41467a9cb0e1b58559e1a97020535b046dcd15d5..889339c9533d9822a5d3f47af818b3d47ee33ea4 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 425840682d2ca589f0a0997be54e938073c1ac60..15f8205ebc2c88ed16ca0bcc18f8c0208155cfdf 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 4a1eda80e8af733764e9ea0de18a41600eb91408..981a7d4731d50e950b4b2822ebed733da8cbea4c 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3965be759a20ab868938c534fb63531252f53deb..c73168841bb9989e166237530144f12f0b698d20 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -32,7 +32,7 @@
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
index 56dbe5d8be900a6a8b9102cc3c7d111e940149b3..08247681c539d6a6fd660892b6141bd99361a4d0 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index e3b0fe3fd6c38b2a4f74cbd307d4a74cf1eba745..4c0d3eaadbab5863b3e4480e0ecad15e25767a89 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 1fd00acabd531e5f82bedd49f8cc042bf8f58557..9e620e2200a5ffe9a4580c7b4a923c260fa9d2c9 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
index ca7311a40746ee620cd6590e8e855c35c7e4a02e..8646b24e7902fd205824a613d65b58ca7b998719 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..29170594d33fa795450d8873ddf72df7252092df 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 6b0beee63223330addb361917e6bd2d7d7775692..b54d5da07c7b3777d3036e646c37ef796d33eb3b 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem32 (
   IN UINT32      Value\r
   )\r
 {\r
   IN UINT32      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 589d45c1a126175d4aa389593856fc15317dc4aa..7bfc7d721e50045264af5ef8d06174ebfa315ac7 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem64 (
   IN UINT64      Value\r
   )\r
 {\r
   IN UINT64      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 4dc8bac073f8e26ad073611c951ff35cb6601f77..0f7289d3df3726dc1f7f0f09bd89cb221f1d1368 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 41467a9cb0e1b58559e1a97020535b046dcd15d5..889339c9533d9822a5d3f47af818b3d47ee33ea4 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 425840682d2ca589f0a0997be54e938073c1ac60..15f8205ebc2c88ed16ca0bcc18f8c0208155cfdf 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 4a1eda80e8af733764e9ea0de18a41600eb91408..981a7d4731d50e950b4b2822ebed733da8cbea4c 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3965be759a20ab868938c534fb63531252f53deb..c73168841bb9989e166237530144f12f0b698d20 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -32,7 +32,7 @@
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
index 56dbe5d8be900a6a8b9102cc3c7d111e940149b3..08247681c539d6a6fd660892b6141bd99361a4d0 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 89cf0db2b710aec98f648db17c21cf53fbb21631..a3897bfaa4314941fd7bdba099b1d8dd2718b5c5 100644 (file)
@@ -1277,8 +1277,7 @@ PciCf8BitFieldAndThenOr32(
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1300,11 +1299,11 @@ PciCf8ReadBuffer (
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
-  ASSERT (Buffer != NULL);\r
+  ASSERT ((Buffer != NULL) || (Size == 0));\r
 \r
   EndAddress = StartAddress + Size;\r
 \r
 \r
   EndAddress = StartAddress + Size;\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 1)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) {\r
     //\r
     // Read a byte if StartAddress is byte aligned\r
     //\r
     //\r
     // Read a byte if StartAddress is byte aligned\r
     //\r
@@ -1313,7 +1312,7 @@ PciCf8ReadBuffer (
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 2)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
@@ -1322,7 +1321,7 @@ PciCf8ReadBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  while (EndAddress - StartAddress >= 4) {\r
+  while ((EndAddress - StartAddress) >= 4) {\r
     //\r
     // Read as many double words as possible\r
     //\r
     //\r
     // Read as many double words as possible\r
     //\r
@@ -1340,7 +1339,7 @@ PciCf8ReadBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 1) {\r
+  if ((EndAddress & 1) != 0) {\r
     //\r
     // Read the last remaining byte if exist\r
     //\r
     //\r
     // Read the last remaining byte if exist\r
     //\r
@@ -1365,8 +1364,7 @@ PciCf8ReadBuffer (
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If the register specified by StartAddress >= 0x100, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x100, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1388,7 +1386,7 @@ PciCf8WriteBuffer (
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress, 0);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x100);\r
-  ASSERT (Buffer != NULL);\r
+  ASSERT ((Buffer != NULL) || (Size == 0));\r
 \r
   EndAddress = StartAddress + Size;\r
 \r
 \r
   EndAddress = StartAddress + Size;\r
 \r
@@ -1401,7 +1399,7 @@ PciCf8WriteBuffer (
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 2)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Write a word if StartAddress is word aligned\r
     //\r
     //\r
     // Write a word if StartAddress is word aligned\r
     //\r
@@ -1410,7 +1408,7 @@ PciCf8WriteBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  while (EndAddress - StartAddress >= 4) {\r
+  while ((EndAddress - StartAddress) >= 4) {\r
     //\r
     // Write as many double words as possible\r
     //\r
     //\r
     // Write as many double words as possible\r
     //\r
@@ -1419,7 +1417,7 @@ PciCf8WriteBuffer (
     Buffer = (UINT32*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT32*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 2) {\r
+  if ((EndAddress & 2) != 0) {\r
     //\r
     // Write the last remaining word if exist\r
     //\r
     //\r
     // Write the last remaining word if exist\r
     //\r
@@ -1428,7 +1426,7 @@ PciCf8WriteBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 1) {\r
+  if ((EndAddress & 1) != 0) {\r
     //\r
     // Write the last remaining byte if exist\r
     //\r
     //\r
     // Write the last remaining byte if exist\r
     //\r
index e027955ceb6ddad741bdae814c095edc67c4edb2..036994aa7b95f04660573bbe6e1bccb78867dac0 100644 (file)
@@ -1174,8 +1174,7 @@ PciExpressBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1197,11 +1196,11 @@ PciExpressReadBuffer (
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT (Buffer != NULL);\r
+  ASSERT ((Buffer != NULL) || (Size == 0));\r
 \r
   EndAddress = StartAddress + Size;\r
 \r
 \r
   EndAddress = StartAddress + Size;\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 1)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) {\r
     //\r
     // Read a byte if StartAddress is byte aligned\r
     //\r
     //\r
     // Read a byte if StartAddress is byte aligned\r
     //\r
@@ -1210,7 +1209,7 @@ PciExpressReadBuffer (
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 2)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
     //\r
     // Read a word if StartAddress is word aligned\r
     //\r
@@ -1219,7 +1218,7 @@ PciExpressReadBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  while (EndAddress - StartAddress >= 4) {\r
+  while ((EndAddress - StartAddress) >= 4) {\r
     //\r
     // Read as many double words as possible\r
     //\r
     //\r
     // Read as many double words as possible\r
     //\r
@@ -1237,7 +1236,7 @@ PciExpressReadBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 1) {\r
+  if ((EndAddress & 1) != 0) {\r
     //\r
     // Read the last remaining byte if exist\r
     //\r
     //\r
     // Read the last remaining byte if exist\r
     //\r
@@ -1261,8 +1260,7 @@ PciExpressReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1284,11 +1282,11 @@ PciExpressWriteBuffer (
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
 \r
   ASSERT_INVALID_PCI_ADDRESS (StartAddress);\r
   ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);\r
-  ASSERT (Buffer != NULL);\r
+  ASSERT ((Buffer != NULL) || (Size == 0));\r
 \r
   EndAddress = StartAddress + Size;\r
 \r
 \r
   EndAddress = StartAddress + Size;\r
 \r
-  if ((StartAddress < EndAddress) && ((StartAddress & 1)!= 0)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 1) != 0)) {\r
     //\r
     // Write a byte if StartAddress is byte aligned\r
     //\r
     //\r
     // Write a byte if StartAddress is byte aligned\r
     //\r
@@ -1297,7 +1295,7 @@ PciExpressWriteBuffer (
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT8*)Buffer + 1;\r
   }\r
 \r
-  if (StartAddress < EndAddress && (StartAddress & 2)) {\r
+  if ((StartAddress < EndAddress) && ((StartAddress & 2) != 0)) {\r
     //\r
     // Write a word if StartAddress is word aligned\r
     //\r
     //\r
     // Write a word if StartAddress is word aligned\r
     //\r
@@ -1306,7 +1304,7 @@ PciExpressWriteBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  while (EndAddress - StartAddress >= 4) {\r
+  while ((EndAddress - StartAddress) >= 4) {\r
     //\r
     // Write as many double words as possible\r
     //\r
     //\r
     // Write as many double words as possible\r
     //\r
@@ -1315,7 +1313,7 @@ PciExpressWriteBuffer (
     Buffer = (UINT32*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT32*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 2) {\r
+  if ((EndAddress & 2) != 0) {\r
     //\r
     // Write the last remaining word if exist\r
     //\r
     //\r
     // Write the last remaining word if exist\r
     //\r
@@ -1324,7 +1322,7 @@ PciExpressWriteBuffer (
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
     Buffer = (UINT16*)Buffer + 1;\r
   }\r
 \r
-  if (EndAddress & 1) {\r
+  if ((EndAddress & 1) != 0) {\r
     //\r
     // Write the last remaining byte if exist\r
     //\r
     //\r
     // Write the last remaining byte if exist\r
     //\r
index 5cfa952b124a09faea74df5017820762984b3e4d..7e21e23174c50979fba95d700540fc80f79ea5ee 100644 (file)
@@ -1011,8 +1011,7 @@ PciBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1047,8 +1046,7 @@ PciReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
index 7c6097495518fd9224700d620b7c819af8aff770..1b543da3aab7be0da78aed953ce89e98e89b2e1f 100644 (file)
@@ -1011,8 +1011,7 @@ PciBitFieldAndThenOr32 (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
@@ -1047,8 +1046,7 @@ PciReadBuffer (
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
 \r
   If StartAddress > 0x0FFFFFFF, then ASSERT().\r
   If ((StartAddress & 0xFFF) + Size) > 0x1000, then ASSERT().\r
-  If (StartAddress + Size - 1)  > 0x0FFFFFFF, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
+  If Size > 0 and Buffer is NULL, then ASSERT().\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
 \r
   @param  StartAddress  Starting address that encodes the PCI Bus, Device,\r
                         Function and Register.\r
index 1484d891b63f284ba6df8e31f620ea5d8822208c..d33f49d3882aa32f08541cd361e2176ef162e6cc 100644 (file)
@@ -57,17 +57,17 @@ STATIC CONST CHAR8 *StatusString [] = {
 \r
   VSPrint function to process format and place the results in Buffer. Since a \r
   VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
 \r
   VSPrint function to process format and place the results in Buffer. Since a \r
   VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
-  this is the main print working routine\r
+  this is the main print working routine.\r
 \r
   @param  Buffer      Character buffer to print the results of the parsing\r
                       of Format into.\r
   @param  BufferSize  Maximum number of characters to put into buffer.\r
   @param  Flags       Intial flags value.\r
 \r
   @param  Buffer      Character buffer to print the results of the parsing\r
                       of Format into.\r
   @param  BufferSize  Maximum number of characters to put into buffer.\r
   @param  Flags       Intial flags value.\r
-                      Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
+                      Can only have FORMAT_UNICODE and OUTPUT_UNICODE set.\r
   @param  Format      Null-terminated format string.\r
   @param  Marker      Vararg list consumed by processing Format.\r
 \r
   @param  Format      Null-terminated format string.\r
   @param  Marker      Vararg list consumed by processing Format.\r
 \r
-  @return Number of characters printed.\r
+  @return Number of characters printed not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -127,8 +127,8 @@ BasePrintLibVSPrint (
     FormatMask = 0xffff;\r
   } else {\r
     //\r
     FormatMask = 0xffff;\r
   } else {\r
     //\r
-    // Make sure format string cannot contain more than PcdMaximumUnicodeStringLength\r
-    // Ascii characters if PcdMaximumUnicodeStringLength is not zero. \r
+    // Make sure format string cannot contain more than PcdMaximumAsciiStringLength\r
+    // Ascii characters if PcdMaximumAsciiStringLength is not zero. \r
     //\r
     ASSERT (AsciiStrSize (Format) != 0);\r
     BytesPerFormatCharacter = 1;\r
     //\r
     ASSERT (AsciiStrSize (Format) != 0);\r
     BytesPerFormatCharacter = 1;\r
@@ -506,7 +506,7 @@ BasePrintLibVSPrint (
     // Output the Prefix character if it is present\r
     //\r
     Index = 0;\r
     // Output the Prefix character if it is present\r
     //\r
     Index = 0;\r
-    if (Prefix) {\r
+    if (Prefix != 0) {\r
       Index++;\r
     }\r
 \r
       Index++;\r
     }\r
 \r
@@ -557,18 +557,17 @@ BasePrintLibVSPrint (
   //\r
   // Null terminate the Unicode or ASCII string\r
   //\r
   //\r
   // Null terminate the Unicode or ASCII string\r
   //\r
-  Buffer = BasePrintLibFillBuffer (Buffer, 1, 0, BytesPerOutputCharacter);\r
+  BasePrintLibFillBuffer (Buffer, 1, 0, BytesPerOutputCharacter);\r
   //\r
   // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength\r
   // Unicode characters if PcdMaximumUnicodeStringLength is not zero. \r
   //\r
   ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));\r
   //\r
   //\r
   // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength\r
   // Unicode characters if PcdMaximumUnicodeStringLength is not zero. \r
   //\r
   ASSERT ((((Flags & OUTPUT_UNICODE) == 0)) || (StrSize ((CHAR16 *) OriginalBuffer) != 0));\r
   //\r
-  // Make sure output buffer cannot contain more than PcdMaximumUnicodeStringLength\r
-  // Ascii characters if PcdMaximumUnicodeStringLength is not zero. \r
+  // Make sure output buffer cannot contain more than PcdMaximumAsciiStringLength\r
+  // ASCII characters if PcdMaximumAsciiStringLength is not zero. \r
   //\r
   ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));\r
   //\r
   ASSERT ((((Flags & OUTPUT_UNICODE) != 0)) || (AsciiStrSize (OriginalBuffer) != 0));\r
-   \r
 \r
   return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r
 }\r
 \r
   return ((Buffer - OriginalBuffer) / BytesPerOutputCharacter);\r
 }\r
@@ -579,7 +578,7 @@ BasePrintLibVSPrint (
 \r
   VSPrint function to process format and place the results in Buffer. Since a \r
   VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
 \r
   VSPrint function to process format and place the results in Buffer. Since a \r
   VA_LIST is used this rountine allows the nesting of Vararg routines. Thus \r
-  this is the main print working routine\r
+  this is the main print working routine.\r
 \r
   @param  Buffer        Character buffer to print the results of the parsing\r
                         of Format into.\r
 \r
   @param  Buffer        Character buffer to print the results of the parsing\r
                         of Format into.\r
@@ -589,7 +588,7 @@ BasePrintLibVSPrint (
                         Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
   @param  FormatString  Null-terminated format string.\r
 \r
                         Can only have FORMAT_UNICODE and OUTPUT_UNICODE set\r
   @param  FormatString  Null-terminated format string.\r
 \r
-  @return Number of characters printed.\r
+  @return Number of characters printed not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -616,23 +615,27 @@ BasePrintLibSPrint (
   The Unicode string is produced by parsing the format string specified by FormatString.  \r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.  \r
   The Unicode string is produced by parsing the format string specified by FormatString.  \r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.  \r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
 \r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -655,22 +658,26 @@ UnicodeVSPrint (
   and BufferSize.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the format string.\r
   and BufferSize.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the format string.\r
-  The length of the produced output buffer is returned.  \r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
 \r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
   If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -697,23 +704,27 @@ UnicodeSPrint (
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on the \r
   contents of the format string.\r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
-\r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -737,22 +748,26 @@ UnicodeVSPrintAsciiFormat (
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The Unicode string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
-  If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
-\r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  The number of Unicode characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
+  If BufferSize is 0 or 1, then no output buffer is produced and 0 is returned.\r
+\r
+  If BufferSize > 1 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 1 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
   If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength Unicode characters, then ASSERT().\r
+  contains more than PcdMaximumUnicodeStringLength Unicode characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           Unicode string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of Unicode characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -779,23 +794,27 @@ UnicodeSPrintAsciiFormat (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -819,22 +838,26 @@ AsciiVSPrint (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumAsciiStringLength ASCII characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -861,23 +884,27 @@ AsciiSPrint (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list specified by Marker based on \r
   the contents of the format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   @param  Marker          VA_LIST marker for the variable argument list.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -901,22 +928,26 @@ AsciiVSPrintUnicodeFormat (
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
   The ASCII string is produced by parsing the format string specified by FormatString.\r
   Arguments are pulled from the variable argument list based on the contents of the \r
   format string.\r
-  The length of the produced output buffer is returned.\r
+  The number of ASCII characters in the produced output buffer is returned not including\r
+  the Null-terminator.\r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
   If BufferSize is 0, then no output buffer is produced and 0 is returned.\r
 \r
-  If BufferSize is not 0 and StartOfBuffer is NULL, then ASSERT().\r
-  If BufferSize is not 0 and FormatString is NULL, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than \r
-  PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
-  If PcdMaximumUnicodeStringLength is not zero, and produced Null-terminated Unicode string\r
-  contains more than PcdMaximumUnicodeStringLength ASCII characters, then ASSERT().\r
+  If BufferSize > 0 and StartOfBuffer is NULL, then ASSERT().\r
+  If BufferSize > 0 and FormatString is NULL, then ASSERT().\r
+  If PcdMaximumUnicodeStringLength is not zero, and FormatString contains more than\r
+  PcdMaximumUnicodeStringLength Unicode characters not including the Null-terminator, then\r
+  ASSERT().\r
+  If PcdMaximumAsciiStringLength is not zero, and produced Null-terminated ASCII string\r
+  contains more than PcdMaximumAsciiStringLength ASCII characters not including the\r
+  Null-terminator, then ASSERT().\r
 \r
 \r
-  @param  StartOfBuffer   APointer to the output buffer for the produced Null-terminated \r
+  @param  StartOfBuffer   A pointer to the output buffer for the produced Null-terminated \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
                           ASCII string.\r
   @param  BufferSize      The size, in bytes, of the output buffer specified by StartOfBuffer.\r
   @param  FormatString    Null-terminated Unicode format string.\r
   \r
-  @return Length of the produced output buffer.\r
+  @return The number of ASCII characters in the produced output buffer not including the\r
+          Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -940,7 +971,7 @@ AsciiSPrintUnicodeFormat (
   Converts the decimal number specified by Value to a Null-terminated Unicode \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   Converts the decimal number specified by Value to a Null-terminated Unicode \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
-  The total number of characters placed in Buffer is returned.\r
+  The number of Unicode characters in Buffer is returned not including the Null-terminator.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
@@ -964,9 +995,9 @@ AsciiSPrintUnicodeFormat (
                   Unicode string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
                   Unicode string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
-  @param  Width    The maximum number of Unicode characters to place in Buffer.\r
+  @param  Width   The maximum number of Unicode characters to place in Buffer.\r
   \r
   \r
-  @return Total number of characters required to perform the conversion.\r
+  @return The number of Unicode characters in Buffer not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -987,7 +1018,7 @@ UnicodeValueToString (
   Converts the decimal number specified by Value to a Null-terminated ASCII string \r
   specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   Converts the decimal number specified by Value to a Null-terminated ASCII string \r
   specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
-  The total number of characters placed in Buffer is returned.\r
+  The number of ASCII characters in Buffer is returned not including the Null-terminator.\r
   If the conversion contains more than Width characters, then only the first Width\r
   characters are returned, and the total number of characters required to perform\r
   the conversion is returned.\r
   If the conversion contains more than Width characters, then only the first Width\r
   characters are returned, and the total number of characters required to perform\r
   the conversion is returned.\r
@@ -1011,9 +1042,9 @@ UnicodeValueToString (
                   ASCII string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
                   ASCII string.\r
   @param  Flags   The bitmask of flags that specify left justification, zero pad, and commas.\r
   @param  Value   The 64-bit signed value to convert to a string.\r
-  @param  Width    The maximum number of ASCII characters to place in Buffer.\r
+  @param  Width   The maximum number of ASCII characters to place in Buffer.\r
   \r
   \r
-  @return Total number of characters required to perform the conversion.\r
+  @return The number of ASCII characters in Buffer not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
index 30b4539141d5bc5dbfc22f8cc919a8db2cf82ca1..8f417fbf11489f4c9c18955b75706e087616c0e5 100644 (file)
@@ -92,7 +92,7 @@ BasePrintLibValueToString (
   Converts the decimal number specified by Value to a Null-terminated  \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
   Converts the decimal number specified by Value to a Null-terminated  \r
   string specified by Buffer containing at most Width characters.\r
   If Width is 0 then a width of  MAXIMUM_VALUE_CHARACTERS is assumed.\r
-  The total number of characters placed in Buffer is returned.\r
+  The number of characters in Buffer is returned not including the Null-terminator.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
   If the conversion contains more than Width characters, then only the first\r
   Width characters are returned, and the total number of characters \r
   required to perform the conversion is returned.\r
@@ -120,7 +120,7 @@ BasePrintLibValueToString (
   @param  Width      The maximum number of characters to place in Buffer.\r
   @param  Increment Character increment in Buffer.\r
   \r
   @param  Width      The maximum number of characters to place in Buffer.\r
   @param  Increment Character increment in Buffer.\r
   \r
-  @return Total number of characters required to perform the conversion.\r
+  @return The number of characters in Buffer not including the Null-terminator.\r
 \r
 **/\r
 UINTN\r
 \r
 **/\r
 UINTN\r
@@ -184,7 +184,7 @@ BasePrintLibConvertValueToString (
     }\r
   }\r
 \r
     }\r
   }\r
 \r
-  Buffer = BasePrintLibFillBuffer (Buffer, 1, 0, Increment);\r
+  BasePrintLibFillBuffer (Buffer, 1, 0, Increment);\r
 \r
   return ((Buffer - OriginalBuffer) / Increment);\r
 }\r
 \r
   return ((Buffer - OriginalBuffer) / Increment);\r
 }\r
index 5e650b012326a670b420dbac6d338f7f878c370f..b7c95a8e4326e511e867653d09a008f01aef1a8e 100644 (file)
@@ -14,6 +14,9 @@
 \r
 **/\r
 \r
 \r
 **/\r
 \r
+#ifndef __PRINT_LIB_INTERNAL_H\r
+#define __PRINT_LIB_INTERNAL_H\r
+\r
 //\r
 // Print primitives\r
 //\r
 //\r
 // Print primitives\r
 //\r
@@ -148,7 +151,7 @@ BasePrintLibValueToString (
   @param  Flags     The bitmask of flags that specify left justification, zero pad,\r
                     and commas.\r
   @param  Value     The 64-bit signed value to convert to a string.\r
   @param  Flags     The bitmask of flags that specify left justification, zero pad,\r
                     and commas.\r
   @param  Value     The 64-bit signed value to convert to a string.\r
-  @param  Width      The maximum number of characters to place in Buffer.\r
+  @param  Width     The maximum number of characters to place in Buffer.\r
   @param  Increment Character increment in Buffer.\r
   \r
   @return Total number of characters required to perform the conversion.\r
   @param  Increment Character increment in Buffer.\r
   \r
   @return Total number of characters required to perform the conversion.\r
@@ -162,3 +165,5 @@ BasePrintLibConvertValueToString (
   IN UINTN       Width,\r
   IN UINTN       Increment\r
   );\r
   IN UINTN       Width,\r
   IN UINTN       Increment\r
   );\r
+\r
+#endif\r
diff --git a/MdePkg/Library/DxeMemoryLib/CompareMemWrapper.c b/MdePkg/Library/DxeMemoryLib/CompareMemWrapper.c
new file mode 100644 (file)
index 0000000..4c0d3ea
--- /dev/null
@@ -0,0 +1,67 @@
+/** @file\r
+  CompareMem() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  CompareMemWrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Compares the contents of two buffers.\r
+\r
+  This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer.\r
+  If all Length bytes of the two buffers are identical, then 0 is returned.  Otherwise, the\r
+  value returned is the first mismatched byte in SourceBuffer subtracted from the first\r
+  mismatched byte in DestinationBuffer.\r
+  If Length > 0 and DestinationBuffer is NULL and Length > 0, then ASSERT().\r
+  If Length > 0 and SourceBuffer is NULL and Length > 0, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
+\r
+\r
+  @param  DestinationBuffer Pointer to the destination buffer to compare.\r
+  @param  SourceBuffer      Pointer to the source buffer to compare.\r
+  @param  Length            Number of bytes to compare.\r
+\r
+  @return 0                 All Length bytes of the two buffers are identical.\r
+  @retval Non-zero          The first mismatched byte in SourceBuffer subtracted from the first\r
+                            mismatched byte in DestinationBuffer.\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+CompareMem (\r
+  IN CONST VOID  *DestinationBuffer,\r
+  IN CONST VOID  *SourceBuffer,\r
+  IN UINTN       Length\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return 0;\r
+  }\r
+  ASSERT (DestinationBuffer != NULL);\r
+  ASSERT (SourceBuffer != NULL);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));\r
+\r
+  return InternalMemCompareMem (DestinationBuffer, SourceBuffer, Length);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/CopyMemWrapper.c b/MdePkg/Library/DxeMemoryLib/CopyMemWrapper.c
new file mode 100644 (file)
index 0000000..9e620e2
--- /dev/null
@@ -0,0 +1,62 @@
+/** @file\r
+  CopyMem() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  CopyMemWrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Copies a source buffer to a destination buffer, and returns the destination buffer.\r
+\r
+  This function copies Length bytes from SourceBuffer to DestinationBuffer, and returns\r
+  DestinationBuffer.  The implementation must be reentrant, and it must handle the case\r
+  where SourceBuffer overlaps DestinationBuffer.\r
+  If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). \r
+  If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT(). \r
+\r
+  @param  DestinationBuffer   Pointer to the destination buffer of the memory copy.\r
+  @param  SourceBuffer        Pointer to the source buffer of the memory copy.\r
+  @param  Length              Number of bytes to copy from SourceBuffer to DestinationBuffer.\r
+\r
+  @return DestinationBuffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+CopyMem (\r
+  OUT VOID       *DestinationBuffer,\r
+  IN CONST VOID  *SourceBuffer,\r
+  IN UINTN       Length\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return DestinationBuffer;\r
+  }\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)DestinationBuffer));\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)SourceBuffer));\r
+\r
+  if (DestinationBuffer == SourceBuffer) {\r
+    return DestinationBuffer;\r
+  }\r
+  return InternalMemCopyMem (DestinationBuffer, SourceBuffer, Length);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.mbd b/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.mbd
new file mode 100644 (file)
index 0000000..0bf1b7e
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution.  The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+-->\r
+<LibraryModuleBuildDescription xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.TianoCore.org/2006/Edk2.0  http://www.TianoCore.org/2006/Edk2.0/SurfaceArea.xsd">\r
+  <MbdLibHeader>\r
+    <BaseName>DxeMemoryLib</BaseName>\r
+    <Guid>f1bbe03d-2f28-4dee-bec7-d98d7a30c36a</Guid>\r
+    <Version>EDK_RELEASE_VERSION        0x00090000</Version>\r
+    <Description>FIX ME!</Description>\r
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
+    <License>\r
+      All rights reserved. This program and the accompanying materials\r
+      are licensed and made available under the terms and conditions of the BSD License\r
+      which accompanies this distribution.  The full text of the license may be found at\r
+      http://opensource.org/licenses/bsd-license.php\r
+      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+    </License>\r
+    <Created>2006-04-12 13:39</Created>\r
+  </MbdLibHeader>\r
+</LibraryModuleBuildDescription>\r
diff --git a/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.msa b/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.msa
new file mode 100644 (file)
index 0000000..254ca0d
--- /dev/null
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
+  <MsaHeader>\r
+    <ModuleName>DxeMemoryLib</ModuleName>\r
+    <ModuleType>UEFI_DRIVER</ModuleType>\r
+    <GuidValue>f1bbe03d-2f28-4dee-bec7-d98d7a30c36a</GuidValue>\r
+    <Version>1.0</Version>\r
+    <Abstract>Memory-only library functions with no library constructor/destructor</Abstract>\r
+    <Description>FIX ME!</Description>\r
+    <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
+    <License>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.</License>\r
+    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
+  </MsaHeader>\r
+  <ModuleDefinitions>\r
+    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
+    <BinaryModule>false</BinaryModule>\r
+    <OutputFileBasename>DxeMemoryLib</OutputFileBasename>\r
+  </ModuleDefinitions>\r
+  <LibraryClassDefinitions>\r
+    <LibraryClass Usage="ALWAYS_PRODUCED">\r
+      <Keyword>BaseMemoryLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>DebugLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>UefiBootServicesTableLib</Keyword>\r
+    </LibraryClass>\r
+    <LibraryClass Usage="ALWAYS_CONSUMED">\r
+      <Keyword>BaseLib</Keyword>\r
+    </LibraryClass>\r
+  </LibraryClassDefinitions>\r
+  <SourceFiles>\r
+    <Filename>MemLib.c</Filename>\r
+    <Filename>MemLibGuid.c</Filename>\r
+    <Filename>MemLibGeneric.c</Filename>\r
+    <Filename>CopyMemWrapper.c</Filename>\r
+    <Filename>SetMemWrapper.c</Filename>\r
+    <Filename>SetMem16Wrapper.c</Filename>\r
+    <Filename>SetMem32Wrapper.c</Filename>\r
+    <Filename>SetMem64Wrapper.c</Filename>\r
+    <Filename>CompareMemWrapper.c</Filename>\r
+    <Filename>ZeroMemWrapper.c</Filename>\r
+    <Filename>ScanMem8Wrapper.c</Filename>\r
+    <Filename>ScanMem16Wrapper.c</Filename>\r
+    <Filename>ScanMem32Wrapper.c</Filename>\r
+    <Filename>ScanMem64Wrapper.c</Filename>\r
+  </SourceFiles>\r
+  <PackageDependencies>\r
+    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
+  </PackageDependencies>\r
+  <Externs>\r
+    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
+    <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
+  </Externs>\r
+</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/MdePkg/Library/DxeMemoryLib/MemLib.c b/MdePkg/Library/DxeMemoryLib/MemLib.c
new file mode 100644 (file)
index 0000000..f8f8e30
--- /dev/null
@@ -0,0 +1,39 @@
+/** @file\r
+  Base Memory Library.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  MemLib.c\r
+\r
+**/\r
+\r
+VOID *\r
+EFIAPI\r
+InternalMemCopyMem (\r
+  OUT     VOID                      *Destination,\r
+  IN      CONST VOID                *Source,\r
+  IN      UINTN                     Length\r
+  )\r
+{\r
+  gBS->CopyMem (Destination, (VOID*)Source, Length);\r
+  return Destination;\r
+}\r
+\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Size,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  gBS->SetMem (Buffer, Size, Value);\r
+  return Buffer;\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/MemLibGeneric.c b/MdePkg/Library/DxeMemoryLib/MemLibGeneric.c
new file mode 100644 (file)
index 0000000..7593774
--- /dev/null
@@ -0,0 +1,261 @@
+/** @file\r
+  Architecture Independent Base Memory Library Implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  MemLibGeneric.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with a 16-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem16 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  do {\r
+    ((UINT16*)Buffer)[--Length] = Value;\r
+  } while (Length != 0);\r
+  return Buffer;\r
+}\r
+\r
+/**\r
+  Fills a target buffer with a 32-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem32 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  do {\r
+    ((UINT32*)Buffer)[--Length] = Value;\r
+  } while (Length != 0);\r
+  return Buffer;\r
+}\r
+\r
+/**\r
+  Fills a target buffer with a 64-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem64 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  do {\r
+    ((UINT64*)Buffer)[--Length] = Value;\r
+  } while (Length != 0);\r
+  return Buffer;\r
+}\r
+\r
+/**\r
+  Set Buffer to 0 for Size bytes.\r
+\r
+  @param  Buffer Memory to set.\r
+  @param  Size Number of bytes to set\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemZeroMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length\r
+  )\r
+{\r
+  return InternalMemSetMem (Buffer, Length, 0);\r
+}\r
+\r
+/**\r
+  Compares two memory buffers of a given length.\r
+\r
+  @param  DestinationBuffer First memory buffer\r
+  @param  SourceBuffer      Second memory buffer\r
+  @param  Length            Length of DestinationBuffer and SourceBuffer memory\r
+                            regions to compare. Must be non-zero.\r
+\r
+  @retval 0     if MemOne == MemTwo\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+InternalMemCompareMem (\r
+  IN      CONST VOID                *DestinationBuffer,\r
+  IN      CONST VOID                *SourceBuffer,\r
+  IN      UINTN                     Length\r
+  )\r
+{\r
+  while ((--Length != 0) &&\r
+         (*(INT8*)DestinationBuffer == *(INT8*)SourceBuffer)) {\r
+    DestinationBuffer = (INT8*)DestinationBuffer + 1;\r
+    SourceBuffer = (INT8*)SourceBuffer + 1;\r
+  }\r
+  return (INTN)*(UINT8*)DestinationBuffer - (INTN)*(UINT8*)SourceBuffer;\r
+}\r
+\r
+/**\r
+  Scans a target buffer for an 8-bit value, and returns a pointer to the\r
+  matching 8-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem8 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT8                     Value\r
+  )\r
+{\r
+  CONST UINT8                       *Pointer;\r
+\r
+  Pointer = (CONST UINT8*)Buffer;\r
+  do {\r
+    if (*(Pointer++) == Value) {\r
+      return Pointer;\r
+    }\r
+  } while (--Length != 0);\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Scans a target buffer for a 16-bit value, and returns a pointer to the\r
+  matching 16-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem16 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  )\r
+{\r
+  CONST UINT16                      *Pointer;\r
+\r
+  Pointer = (CONST UINT16*)Buffer;\r
+  do {\r
+    if (*(Pointer++) == Value) {\r
+      return Pointer;\r
+    }\r
+  } while (--Length != 0);\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Scans a target buffer for a 32-bit value, and returns a pointer to the\r
+  matching 32-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem32 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  )\r
+{\r
+  CONST UINT32                      *Pointer;\r
+\r
+  Pointer = (CONST UINT32*)Buffer;\r
+  do {\r
+    if (*(Pointer++) == Value) {\r
+      return Pointer;\r
+    }\r
+  } while (--Length != 0);\r
+  return NULL;\r
+}\r
+\r
+/**\r
+  Scans a target buffer for a 64-bit value, and returns a pointer to the\r
+  matching 64-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem64 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  )\r
+{\r
+  CONST UINT64                      *Pointer;\r
+\r
+  Pointer = (CONST UINT64*)Buffer;\r
+  do {\r
+    if (*(Pointer++) == Value) {\r
+      return Pointer;\r
+    }\r
+  } while (--Length != 0);\r
+  return NULL;\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/MemLibGuid.c b/MdePkg/Library/DxeMemoryLib/MemLibGuid.c
new file mode 100644 (file)
index 0000000..8932af7
--- /dev/null
@@ -0,0 +1,132 @@
+/** @file\r
+  Implementation of GUID functions.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  MemLibGuid.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+/**\r
+  Copies a source GUID to a destination GUID.\r
+\r
+  This function copies the contents of the 128-bit GUID specified by SourceGuid to\r
+  DestinationGuid, and returns DestinationGuid.\r
+  If DestinationGuid is NULL, then ASSERT().\r
+  If SourceGuid is NULL, then ASSERT().\r
+\r
+  @param  DestinationGuid   Pointer to the destination GUID.\r
+  @param  SourceGuid        Pointer to the source GUID.\r
+\r
+  @return DestinationGuid.\r
+\r
+**/\r
+GUID *\r
+EFIAPI\r
+CopyGuid (\r
+  OUT GUID       *DestinationGuid,\r
+  IN CONST GUID  *SourceGuid\r
+  )\r
+{\r
+  WriteUnaligned64 (\r
+    (UINT64*)DestinationGuid,\r
+    ReadUnaligned64 ((CONST UINT64*)SourceGuid)\r
+    );\r
+  WriteUnaligned64 (\r
+    (UINT64*)DestinationGuid + 1,\r
+    ReadUnaligned64 ((CONST UINT64*)SourceGuid + 1)\r
+    );\r
+  return DestinationGuid;\r
+}\r
+\r
+/**\r
+  Compares two GUIDs.\r
+\r
+  This function compares Guid1 to Guid2.  If the GUIDs are identical then TRUE is returned.\r
+  If there are any bit differences in the two GUIDs, then FALSE is returned.\r
+  If Guid1 is NULL, then ASSERT().\r
+  If Guid2 is NULL, then ASSERT().\r
+\r
+  @param  Guid1       A pointer to a 128 bit GUID.\r
+  @param  Guid2       A pointer to a 128 bit GUID.\r
+\r
+  @retval TRUE        Guid1 and Guid2 are identical.\r
+  @retval FALSE       Guid1 and Guid2 are not identical.\r
+\r
+**/\r
+BOOLEAN\r
+EFIAPI\r
+CompareGuid (\r
+  IN CONST GUID  *Guid1,\r
+  IN CONST GUID  *Guid2\r
+  )\r
+{\r
+  return (BOOLEAN)(\r
+           ReadUnaligned64 ((CONST UINT64*)Guid1)\r
+             == ReadUnaligned64 ((CONST UINT64*)Guid2) &&\r
+           ReadUnaligned64 ((CONST UINT64*)Guid1 + 1)\r
+             == ReadUnaligned64 ((CONST UINT64*)Guid2 + 1)\r
+           );\r
+}\r
+\r
+/**\r
+  Scans a target buffer for a GUID, and returns a pointer to the matching GUID\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from\r
+  the lowest address to the highest address at 128-bit increments for the 128-bit\r
+  GUID value that matches Guid.  If a match is found, then a pointer to the matching\r
+  GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
+  If Length is 0, then NULL is returned.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan.\r
+  @param  Guid    Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching Guid in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanGuid (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN CONST GUID  *Guid\r
+  )\r
+{\r
+  CONST GUID                        *GuidPtr;\r
+\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
+  ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
+\r
+  GuidPtr = (GUID*)Buffer;\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
+  while (GuidPtr < (CONST GUID*)Buffer) {\r
+    if (CompareGuid (GuidPtr, Guid)) {\r
+      return (VOID*)GuidPtr;\r
+    }\r
+    GuidPtr++;\r
+  }\r
+  return NULL;\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/MemLibInternals.h b/MdePkg/Library/DxeMemoryLib/MemLibInternals.h
new file mode 100644 (file)
index 0000000..8646b24
--- /dev/null
@@ -0,0 +1,230 @@
+/** @file\r
+  Declaration of internal functions for Base Memory Library.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  MemLibInternals.h\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#ifndef __MEM_LIB_INTERNALS__\r
+#define __MEM_LIB_INTERNALS__\r
+\r
+/**\r
+  Copy Length bytes from Source to Destination.\r
+\r
+  @param  Destination Target of copy\r
+  @param  Source Place to copy from\r
+  @param  Length Number of bytes to copy\r
+\r
+  @return Destination\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemCopyMem (\r
+  OUT     VOID                      *DestinationBuffer,\r
+  IN      CONST VOID                *SourceBuffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Set Buffer to Value for Size bytes.\r
+\r
+  @param  Buffer Memory to set.\r
+  @param  Size Number of bytes to set\r
+  @param  Value Value of the set operation.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT8                     Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 16-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem16 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 32-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem32 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Fills a target buffer with a 64-bit value, and returns the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemSetMem64 (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+/**\r
+  Set Buffer to 0 for Size bytes.\r
+\r
+  @param  Buffer Memory to set.\r
+  @param  Size Number of bytes to set\r
+\r
+  @return Buffer\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+InternalMemZeroMem (\r
+  OUT     VOID                      *Buffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Compares two memory buffers of a given length.\r
+\r
+  @param  DestinationBuffer First memory buffer\r
+  @param  SourceBuffer      Second memory buffer\r
+  @param  Length            Length of DestinationBuffer and SourceBuffer memory\r
+                            regions to compare. Must be non-zero.\r
+\r
+  @retval 0     if MemOne == MemTwo\r
+\r
+**/\r
+INTN\r
+EFIAPI\r
+InternalMemCompareMem (\r
+  IN      CONST VOID                *DestinationBuffer,\r
+  IN      CONST VOID                *SourceBuffer,\r
+  IN      UINTN                     Length\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for an 8-bit value, and returns a pointer to the\r
+  matching 8-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem8 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT8                     Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 16-bit value, and returns a pointer to the\r
+  matching 16-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem16 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT16                    Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 32-bit value, and returns a pointer to the\r
+  matching 32-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem32 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT32                    Value\r
+  );\r
+\r
+/**\r
+  Scans a target buffer for a 64-bit value, and returns a pointer to the\r
+  matching 64-bit value in the target buffer.\r
+\r
+  @param  Buffer  Pointer to the target buffer to scan.\r
+  @param  Length  Number of bytes in Buffer to scan. Must be non-zero.\r
+  @param  Value   Value to search for in the target buffer.\r
+\r
+  @return Pointer to the first occurrence or NULL if not found.\r
+\r
+**/\r
+CONST VOID *\r
+EFIAPI\r
+InternalMemScanMem64 (\r
+  IN      CONST VOID                *Buffer,\r
+  IN      UINTN                     Length,\r
+  IN      UINT64                    Value\r
+  );\r
+\r
+#endif\r
diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem16Wrapper.c
new file mode 100644 (file)
index 0000000..2917059
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  ScanMem16() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  ScanMem16Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Scans a target buffer for a 16-bit value, and returns a pointer to the matching 16-bit value\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a 16-bit value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem16 (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINT16      Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return NULL;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem32Wrapper.c
new file mode 100644 (file)
index 0000000..b54d5da
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  ScanMem32() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  ScanMem32Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Scans a target buffer for a 32-bit value, and returns a pointer to the matching 32-bit value\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a 32-bit value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem32 (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINT32      Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return NULL;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem64Wrapper.c
new file mode 100644 (file)
index 0000000..7bfc7d7
--- /dev/null
@@ -0,0 +1,66 @@
+/** @file\r
+  ScanMem64() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  ScanMem64Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Scans a target buffer for a 64-bit value, and returns a pointer to the matching 64-bit value\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for a 64-bit value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem64 (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINT64      Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return NULL;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c b/MdePkg/Library/DxeMemoryLib/ScanMem8Wrapper.c
new file mode 100644 (file)
index 0000000..0f7289d
--- /dev/null
@@ -0,0 +1,61 @@
+/** @file\r
+  ScanMem8() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  ScanMem8Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Scans a target buffer for an 8-bit value, and returns a pointer to the matching 8-bit value\r
+  in the target buffer.\r
+\r
+  This function searches target the buffer specified by Buffer and Length from the lowest\r
+  address to the highest address for an 8-bit value that matches Value.  If a match is found,\r
+  then a pointer to the matching byte in the target buffer is returned.  If no match is found,\r
+  then NULL is returned.  If Length is 0, then NULL is returned.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer      Pointer to the target buffer to scan.\r
+  @param  Length      Number of bytes in Buffer to scan.\r
+  @param  Value       Value to search for in the target buffer.\r
+\r
+  @return A pointer to the matching byte in the target buffer or NULL otherwise.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ScanMem8 (\r
+  IN CONST VOID  *Buffer,\r
+  IN UINTN       Length,\r
+  IN UINT8       Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return NULL;\r
+  }\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
\r
+  return (VOID*)InternalMemScanMem8 (Buffer, Length, Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/SetMem16Wrapper.c b/MdePkg/Library/DxeMemoryLib/SetMem16Wrapper.c
new file mode 100644 (file)
index 0000000..889339c
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+  SetMem16() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SetMem16Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with a 16-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 16-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 16-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem16 (\r
+  OUT VOID   *Buffer,\r
+  IN UINTN   Length,\r
+  IN UINT16  Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return Buffer;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return InternalMemSetMem16 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/SetMem32Wrapper.c b/MdePkg/Library/DxeMemoryLib/SetMem32Wrapper.c
new file mode 100644 (file)
index 0000000..15f8205
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+  SetMem32() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SetMem32Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with a 32-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 32-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 32-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem32 (\r
+  OUT VOID   *Buffer,\r
+  IN UINTN   Length,\r
+  IN UINT32  Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return Buffer;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return InternalMemSetMem32 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/SetMem64Wrapper.c b/MdePkg/Library/DxeMemoryLib/SetMem64Wrapper.c
new file mode 100644 (file)
index 0000000..981a7d4
--- /dev/null
@@ -0,0 +1,65 @@
+/** @file\r
+  SetMem64() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SetMem64Wrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with a 64-bit value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with the 64-bit value specified by\r
+  Value, and returns Buffer. Value is repeated every 64-bits in for Length\r
+  bytes of Buffer.\r
+\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().\r
+  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
+\r
+  @param  Buffer  Pointer to the target buffer to fill.\r
+  @param  Length  Number of bytes in Buffer to fill.\r
+  @param  Value   Value with which to fill Length bytes of Buffer.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem64 (\r
+  OUT VOID   *Buffer,\r
+  IN UINTN   Length,\r
+  IN UINT64  Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return Buffer;\r
+  }\r
+\r
+  ASSERT (Buffer != NULL);\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((((UINTN)Buffer) & (sizeof (Value) - 1)) == 0);\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
+\r
+  return InternalMemSetMem64 (Buffer, Length / sizeof (Value), Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c b/MdePkg/Library/DxeMemoryLib/SetMemWrapper.c
new file mode 100644 (file)
index 0000000..c731688
--- /dev/null
@@ -0,0 +1,56 @@
+/** @file\r
+  SetMem() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  SetMemWrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with a byte value, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with Value, and returns Buffer.\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer    Memory to set.\r
+  @param  Length    Number of bytes to set.\r
+  @param  Value     Value of the set operation.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+SetMem (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length,\r
+  IN UINT8  Value\r
+  )\r
+{\r
+  if (Length == 0) {\r
+    return Buffer;\r
+  }\r
+\r
+  ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+\r
+  return InternalMemSetMem (Buffer, Length, Value);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c b/MdePkg/Library/DxeMemoryLib/ZeroMemWrapper.c
new file mode 100644 (file)
index 0000000..0824768
--- /dev/null
@@ -0,0 +1,51 @@
+/** @file\r
+  ZeroMem() implementation.\r
+\r
+  Copyright (c) 2006, Intel Corporation<BR>\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  Module Name:  ZeroMemWrapper.c\r
+\r
+  The following BaseMemoryLib instances share the same version of this file:\r
+\r
+    BaseMemoryLib\r
+    BaseMemoryLibMmx\r
+    BaseMemoryLibSse2\r
+    BaseMemoryLibRepStr\r
+    PeiMemoryLib\r
+    DxeMemoryLib\r
+\r
+**/\r
+\r
+#include "MemLibInternals.h"\r
+\r
+/**\r
+  Fills a target buffer with zeros, and returns the target buffer.\r
+\r
+  This function fills Length bytes of Buffer with zeros, and returns Buffer.\r
+  If Length > 0 and Buffer is NULL, then ASSERT().\r
+  If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
+\r
+  @param  Buffer      Pointer to the target buffer to fill with zeros.\r
+  @param  Length      Number of bytes in Buffer to fill with zeros.\r
+\r
+  @return Buffer.\r
+\r
+**/\r
+VOID *\r
+EFIAPI\r
+ZeroMem (\r
+  OUT VOID  *Buffer,\r
+  IN UINTN  Length\r
+  )\r
+{\r
+  ASSERT (!(Buffer == NULL && Length > 0));\r
+  ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  return InternalMemSetMem (Buffer, Length, 0);\r
+}\r
diff --git a/MdePkg/Library/DxeMemoryLib/build.xml b/MdePkg/Library/DxeMemoryLib/build.xml
new file mode 100644 (file)
index 0000000..4b5ee9f
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?><!-- Copyright (c) 2006, Intel Corporation \r
+All rights reserved. This program and the accompanying materials \r
+are licensed and made available under the terms and conditions of the BSD License \r
+which accompanies this distribution.  The full text of the license may be found at  \r
+http://opensource.org/licenses/bsd-license.php \r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.-->\r
+<project basedir="." default="DxeMemoryLib"><!--Apply external ANT tasks-->\r
+   <taskdef resource="GenBuild.tasks"/>\r
+   <taskdef resource="net/sf/antcontrib/antlib.xml"/>\r
+   <property environment="env"/>\r
+   <property name="WORKSPACE_DIR" value="${env.WORKSPACE}"/>\r
+   <import file="${WORKSPACE_DIR}/Tools/Conf/BuildMacro.xml"/><!--MODULE_RELATIVE PATH is relative to PACKAGE_DIR-->\r
+   <property name="MODULE_RELATIVE_PATH" value="Library/DxeMemoryLib"/>\r
+   <property name="MODULE_DIR" value="${PACKAGE_DIR}/${MODULE_RELATIVE_PATH}"/>\r
+   <property name="COMMON_FILE" value="${WORKSPACE_DIR}/Tools/Conf/Common.xml"/>\r
+   <target name="DxeMemoryLib">\r
+      <GenBuild baseName="DxeMemoryLib" mbdFilename="${MODULE_DIR}/DxeMemoryLib.mbd" msaFilename="${MODULE_DIR}/DxeMemoryLib.msa"/>\r
+   </target>\r
+   <target depends="UefiMemoryLib_clean" name="clean"/>\r
+   <target depends="UefiMemoryLib_cleanall" name="cleanall"/>\r
+   <target name="UefiMemoryLib_clean">\r
+      <OutputDirSetup baseName="DxeMemoryLib" mbdFilename="${MODULE_DIR}/DxeMemoryLib.mbd" msaFilename="${MODULE_DIR}/DxeMemoryLib.msa"/>\r
+      <if>\r
+         <available file="${DEST_DIR_OUTPUT}/UefiMemoryLib_build.xml"/>\r
+         <then>\r
+            <ant antfile="${DEST_DIR_OUTPUT}/UefiMemoryLib_build.xml" target="clean"/>\r
+         </then>\r
+      </if>\r
+      <delete dir="${DEST_DIR_OUTPUT}" excludes="*.xml"/>\r
+   </target>\r
+   <target name="UefiMemoryLib_cleanall">\r
+      <OutputDirSetup baseName="DxeMemoryLib" mbdFilename="${MODULE_DIR}/DxeMemoryLib.mbd" msaFilename="${MODULE_DIR}/DxeMemoryLib.msa"/>\r
+      <if>\r
+         <available file="${DEST_DIR_OUTPUT}/UefiMemoryLib_build.xml"/>\r
+         <then>\r
+            <ant antfile="${DEST_DIR_OUTPUT}/UefiMemoryLib_build.xml" target="cleanall"/>\r
+         </then>\r
+      </if>\r
+      <delete dir="${DEST_DIR_OUTPUT}"/>\r
+      <delete dir="${DEST_DIR_DEBUG}"/>\r
+      <delete>\r
+         <fileset dir="${BIN_DIR}" includes="**DxeMemoryLib*"/>\r
+      </delete>\r
+   </target>\r
+</project>
\ No newline at end of file
index b06a75660f490457ecd64f6f55928296f34ca052..8c8bbc27198999a4ca360f482568ea9a83740e92 100644 (file)
@@ -75,12 +75,12 @@ DebugPrint (
   VA_END (Marker);\r
   AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);\r
 \r
   VA_END (Marker);\r
   AsciiStrCpy ((CHAR8 *)ArgumentPointer, Format);\r
 \r
-  //\r
-  //\r
-  //\r
-  REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
+  REPORT_STATUS_CODE_EX (\r
     EFI_DEBUG_CODE,\r
     (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),\r
     EFI_DEBUG_CODE,\r
     (EFI_SOFTWARE_DXE_BS_DRIVER | EFI_DC_UNSPECIFIED),\r
+    0,\r
+    NULL,\r
+    &gEfiStatusCodeDataTypeDebugGuid,\r
     DebugInfo,\r
     TotalSize\r
     );\r
     DebugInfo,\r
     TotalSize\r
     );\r
@@ -142,7 +142,7 @@ DebugAssert (
     //\r
     // Copy Ascii Description \r
     //\r
     //\r
     // Copy Ascii Description \r
     //\r
-    AsciiStrCpy (Temp + AsciiStrLen(FileName) + 1, Description);\r
+    AsciiStrCpy (Temp + AsciiStrLen (FileName) + 1, Description);\r
 \r
     REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
       (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
 \r
     REPORT_STATUS_CODE_WITH_EXTENDED_DATA (\r
       (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
index a3c923693f61049da3c3f4ac566e7030e3357d59..f65ed5a05836b70fe6f8034f3417e11e5d2a81c9 100644 (file)
@@ -5,7 +5,7 @@
     <ModuleType>PEIM</ModuleType>\r
     <GuidValue>bda39d3a-451b-4350-8266-81ab10fa0523</GuidValue>\r
     <Version>1.0</Version>\r
     <ModuleType>PEIM</ModuleType>\r
     <GuidValue>bda39d3a-451b-4350-8266-81ab10fa0523</GuidValue>\r
     <Version>1.0</Version>\r
-    <Abstract>Debug Library for PEIMs that send debug messages to ReportStatusCode</Abstract>\r
+    <Abstract>Debug Library for PEIMs and DXE drivers that send debug messages to ReportStatusCode</Abstract>\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
     <License>All rights reserved. This program and the accompanying materials\r
     <Description>FIX ME!</Description>\r
     <Copyright>Copyright (c) 2004-2006, Intel Corporation</Copyright>\r
     <License>All rights reserved. This program and the accompanying materials\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
   </PackageDependencies>\r
   <PackageDependencies>\r
     <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
   </PackageDependencies>\r
+  <Guids>\r
+    <GuidCNames Usage="ALWAYS_CONSUMED">\r
+      <GuidCName>StatusCodeDataTypeDebug</GuidCName>\r
+    </GuidCNames>\r
+  </Guids>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
   <Externs>\r
     <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
     <Specification>EDK_RELEASE_VERSION 0x00090000</Specification>\r
index e3b0fe3fd6c38b2a4f74cbd307d4a74cf1eba745..4c0d3eaadbab5863b3e4480e0ecad15e25767a89 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 1fd00acabd531e5f82bedd49f8cc042bf8f58557..9e620e2200a5ffe9a4580c7b4a923c260fa9d2c9 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3fecfc9ff0d242b144556cfeaa1df45a64d1e5d4..759377483c910147ea92d5fb88240d0b2125a8e3 100644 (file)
@@ -16,7 +16,7 @@
 \r
     BaseMemoryLib\r
     PeiMemoryLib\r
 \r
     BaseMemoryLib\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 351e370c2cc8d63e028ad4a9fcffe7373bff7b76..8932af7083ebfbf5b36d45b53b9be140a48c9333 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -95,7 +95,8 @@ CompareGuid (
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   GUID in the target buffer is returned.  If no match is found, then NULL is returned.\r
   If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
-  If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 128-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer  Pointer to the target buffer to scan.\r
@@ -115,16 +116,12 @@ ScanGuid (
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
 {\r
   CONST GUID                        *GuidPtr;\r
 \r
-  ASSERT (Buffer != NULL);\r
-  //\r
-  // Make sure Buffer is aligned on a 64-bit boundary.\r
-  //\r
-  ASSERT (((UINTN) Buffer & 7) == 0);\r
-\r
+  ASSERT (((UINTN)Buffer & (sizeof (Guid->Data1) - 1)) == 0);\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
   ASSERT (Length <= (MAX_ADDRESS - (UINTN)Buffer + 1));\r
+  ASSERT ((Length & (sizeof (*GuidPtr) - 1)) == 0);\r
 \r
   GuidPtr = (GUID*)Buffer;\r
 \r
   GuidPtr = (GUID*)Buffer;\r
-  Buffer = GuidPtr + Length / sizeof (*GuidPtr);\r
+  Buffer  = GuidPtr + Length / sizeof (*GuidPtr);\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
   while (GuidPtr < (CONST GUID*)Buffer) {\r
     if (CompareGuid (GuidPtr, Guid)) {\r
       return (VOID*)GuidPtr;\r
index ca7311a40746ee620cd6590e8e855c35c7e4a02e..8646b24e7902fd205824a613d65b58ca7b998719 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 9ffc2cf159e758b64671a3ef7d4a245f110bda49..29170594d33fa795450d8873ddf72df7252092df 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 16-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 16-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem16 (
   IN UINT16      Value\r
   )\r
 {\r
   IN UINT16      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem16 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem16 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 6b0beee63223330addb361917e6bd2d7d7775692..b54d5da07c7b3777d3036e646c37ef796d33eb3b 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 32-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 32-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem32 (
   IN UINT32      Value\r
   )\r
 {\r
   IN UINT32      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem32 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem32 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 589d45c1a126175d4aa389593856fc15317dc4aa..7bfc7d721e50045264af5ef8d06174ebfa315ac7 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -35,6 +35,7 @@
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
   then NULL is returned.  If Length is 0, then NULL is returned.\r
   If Length > 0 and Buffer is NULL, then ASSERT().\r
   If Buffer is not aligned on a 64-bit boundary, then ASSERT().\r
+  If Length is not aligned on a 64-bit boundary, then ASSERT().\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer      Pointer to the target buffer to scan.\r
@@ -52,16 +53,14 @@ ScanMem64 (
   IN UINT64      Value\r
   )\r
 {\r
   IN UINT64      Value\r
   )\r
 {\r
-  UINTN     Stride;\r
-  \r
-  Stride = Length / sizeof (Value);\r
-  if (Stride == 0) {\r
+  if (Length == 0) {\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
     return NULL;\r
   }\r
 \r
   ASSERT (Buffer != NULL);\r
   ASSERT (((UINTN)Buffer & (sizeof (Value) - 1)) == 0);\r
   ASSERT ((Length - 1) <= (MAX_ADDRESS - (UINTN)Buffer));\r
+  ASSERT ((Length & (sizeof (Value) - 1)) == 0);\r
 \r
 \r
-  return (VOID*)InternalMemScanMem64 (Buffer, Stride, Value);\r
+  return (VOID*)InternalMemScanMem64 (Buffer, Length / sizeof (Value), Value);\r
 }\r
 }\r
index 4dc8bac073f8e26ad073611c951ff35cb6601f77..0f7289d3df3726dc1f7f0f09bd89cb221f1d1368 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 41467a9cb0e1b58559e1a97020535b046dcd15d5..889339c9533d9822a5d3f47af818b3d47ee33ea4 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 425840682d2ca589f0a0997be54e938073c1ac60..15f8205ebc2c88ed16ca0bcc18f8c0208155cfdf 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 4a1eda80e8af733764e9ea0de18a41600eb91408..981a7d4731d50e950b4b2822ebed733da8cbea4c 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 3965be759a20ab868938c534fb63531252f53deb..c73168841bb9989e166237530144f12f0b698d20 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
@@ -32,7 +32,7 @@
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
   If Length is greater than (MAX_ADDRESS \96 Buffer + 1), then ASSERT(). \r
 \r
   @param  Buffer    Memory to set.\r
-  @param  Length    Number of bytes to set\r
+  @param  Length    Number of bytes to set.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
   @param  Value     Value of the set operation.\r
 \r
   @return Buffer.\r
index 56dbe5d8be900a6a8b9102cc3c7d111e940149b3..08247681c539d6a6fd660892b6141bd99361a4d0 100644 (file)
@@ -19,7 +19,7 @@
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
     BaseMemoryLibSse2\r
     BaseMemoryLibRepStr\r
     PeiMemoryLib\r
-    UefiMemoryLib\r
+    DxeMemoryLib\r
 \r
 **/\r
 \r
 \r
 **/\r
 \r
index 2f666a6963adae9ed1a607b7c19b8a7a6ae4563a..e64618de21845511974914f7dc6f64b684e16064 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
 /** @file\r
-  PEI Library.\r
+  Implementation for PEI Services Library.\r
 \r
   Copyright (c) 2006, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials                          \r
 \r
   Copyright (c) 2006, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials                          \r
 /**\r
   This service enables a given PEIM to register an interface into the PEI Foundation. \r
 \r
 /**\r
   This service enables a given PEIM to register an interface into the PEI Foundation. \r
 \r
-  @param  PpiList A pointer to the list of interfaces that the caller shall install.\r
+  @param  PpiList               A pointer to the list of interfaces that the caller shall install.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The PpiList pointer is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPpi (\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *PpiList\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *PpiList\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -41,22 +41,23 @@ PeiServicesInstallPpi (
 /**\r
   This service enables PEIMs to replace an entry in the PPI database with an alternate entry.\r
 \r
 /**\r
   This service enables PEIMs to replace an entry in the PPI database with an alternate entry.\r
 \r
-  @param  OldPpi Pointer to the old PEI PPI Descriptors.\r
-  @param  NewPpi Pointer to the new PEI PPI Descriptors.\r
+  @param  OldPpi                Pointer to the old PEI PPI Descriptors.\r
+  @param  NewPpi                Pointer to the new PEI PPI Descriptors.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
-  @retval  EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The OldPpi or NewPpi is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI PPI descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
+  @retval EFI_NOT_FOUND         The PPI for which the reinstallation was requested has not been\r
+                                installed.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesReInstallPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesReInstallPpi (\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *OldPpi,\r
-  IN EFI_PEI_PPI_DESCRIPTOR           *NewPpi\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *OldPpi,\r
+  IN EFI_PEI_PPI_DESCRIPTOR     *NewPpi\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -68,22 +69,23 @@ PeiServicesReInstallPpi (
 /**\r
   This service enables PEIMs to discover a given instance of an interface.\r
 \r
 /**\r
   This service enables PEIMs to discover a given instance of an interface.\r
 \r
-  @param  Guid A pointer to the GUID whose corresponding interface needs to be found.\r
-  @param  Instance The N-th instance of the interface that is required.\r
-  @param  PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.\r
-  @param  Ppi A pointer to the instance of the interface.\r
+  @param  Guid                  A pointer to the GUID whose corresponding interface needs to be\r
+                                found.\r
+  @param  Instance              The N-th instance of the interface that is required.\r
+  @param  PpiDescriptor         A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.\r
+  @param  Ppi                   A pointer to the instance of the interface.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully returned.\r
-  @retval  EFI_NOT_FOUND The PPI descriptor is not found in the database.\r
+  @retval EFI_SUCCESS           The interface was successfully returned.\r
+  @retval EFI_NOT_FOUND         The PPI descriptor is not found in the database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesLocatePpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesLocatePpi (\r
-  IN EFI_GUID                         *Guid,\r
-  IN UINTN                            Instance,\r
-  IN OUT EFI_PEI_PPI_DESCRIPTOR       **PpiDescriptor,\r
-  IN OUT VOID                         **Ppi\r
+  IN EFI_GUID                   *Guid,\r
+  IN UINTN                      Instance,\r
+  IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r
+  IN OUT VOID                   **Ppi\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -93,22 +95,23 @@ PeiServicesLocatePpi (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This service enables PEIMs to register a given service to be invoked\r
-  when another service is installed or reinstalled.\r
+  This service enables PEIMs to register a given service to be invoked when another service is\r
+  installed or reinstalled.\r
 \r
 \r
-  @param  NotifyList A pointer to the list of notification interfaces that the caller shall install.\r
+  @param  NotifyList            A pointer to the list of notification interfaces that the caller\r
+                                shall install.\r
 \r
 \r
-  @retval  EFI_SUCCESS The interface was successfully installed.\r
-  @retval  EFI_INVALID_PARAMETER The NotifyList pointer is NULL.\r
-  @retval  EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have\r
-  the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r
+  @retval EFI_SUCCESS           The interface was successfully installed.\r
+  @retval EFI_INVALID_PARAMETER The NotifyList pointer is NULL.\r
+  @retval EFI_INVALID_PARAMETER Any of the PEI notify descriptors in the list do not have the\r
+                                EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space in the PPI database.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesNotifyPpi (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesNotifyPpi (\r
-  IN EFI_PEI_NOTIFY_DESCRIPTOR        *NotifyList\r
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyList\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -120,16 +123,16 @@ PeiServicesNotifyPpi (
 /**\r
   This service enables PEIMs to ascertain the present value of the boot mode.  \r
 \r
 /**\r
   This service enables PEIMs to ascertain the present value of the boot mode.  \r
 \r
-  @param  BootMode A pointer to contain the value of the boot mode.\r
+  @param  BootMode              A pointer to contain the value of the boot mode.\r
 \r
 \r
-  @retval  EFI_SUCCESS The boot mode was returned successfully.\r
-  @retval  EFI_INVALID_PARAMETER BootMode is NULL.\r
+  @retval EFI_SUCCESS           The boot mode was returned successfully.\r
+  @retval EFI_INVALID_PARAMETER BootMode is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetBootMode (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetBootMode (\r
-  IN OUT EFI_BOOT_MODE                *BootMode\r
+  IN OUT EFI_BOOT_MODE          *BootMode\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -141,15 +144,15 @@ PeiServicesGetBootMode (
 /**\r
   This service enables PEIMs to update the boot mode variable.    \r
 \r
 /**\r
   This service enables PEIMs to update the boot mode variable.    \r
 \r
-  @param  BootMode The value of the boot mode to set.\r
+  @param  BootMode              The value of the boot mode to set.\r
 \r
 \r
-  @retval  EFI_SUCCESS The value was successfully updated\r
+  @retval EFI_SUCCESS           The value was successfully updated\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesSetBootMode (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesSetBootMode (\r
-  IN EFI_BOOT_MODE                    BootMode\r
+  IN EFI_BOOT_MODE              BootMode\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -161,16 +164,16 @@ PeiServicesSetBootMode (
 /**\r
   This service enables a PEIM to ascertain the address of the list of HOBs in memory.\r
 \r
 /**\r
   This service enables a PEIM to ascertain the address of the list of HOBs in memory.\r
 \r
-  @param  HobList A pointer to the list of HOBs that the PEI Foundation will initialize.\r
+  @param  HobList               A pointer to the list of HOBs that the PEI Foundation will initialize.\r
 \r
 \r
-  @retval  EFI_SUCCESS The list was successfully returned.\r
-  @retval  EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r
+  @retval EFI_SUCCESS           The list was successfully returned.\r
+  @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetHobList (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesGetHobList (\r
-  IN OUT VOID                         **HobList\r
+  IN OUT VOID                   **HobList\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -182,20 +185,20 @@ PeiServicesGetHobList (
 /**\r
   This service enables PEIMs to create various types of HOBs.\r
 \r
 /**\r
   This service enables PEIMs to create various types of HOBs.\r
 \r
-  @param  Type The type of HOB to be installed.\r
-  @param  Length The length of the HOB to be added.\r
-  @param  Hob The address of a pointer that will contain the HOB header.\r
+  @param  Type                  The type of HOB to be installed.\r
+  @param  Length                The length of the HOB to be added.\r
+  @param  Hob                   The address of a pointer that will contain the HOB header.\r
 \r
 \r
-  @retval  EFI_SUCCESS The HOB was successfully created.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r
+  @retval EFI_SUCCESS           The HOB was successfully created.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesCreateHob (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesCreateHob (\r
-  IN UINT16                           Type,\r
-  IN UINT16                           Length,\r
-  IN OUT VOID                         **Hob\r
+  IN UINT16                     Type,\r
+  IN UINT16                     Length,\r
+  IN OUT VOID                   **Hob\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -207,20 +210,20 @@ PeiServicesCreateHob (
 /**\r
   This service enables PEIMs to discover additional firmware volumes.\r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware volumes.\r
 \r
-  @param  Instance This instance of the firmware volume to find.\r
-  The value 0 is the Boot Firmware Volume (BFV).\r
-  @param  FwVolHeader Pointer to the firmware volume header of the volume to return.\r
+  @param  Instance              This instance of the firmware volume to find.  The value 0 is the\r
+                                Boot Firmware Volume (BFV).\r
+  @param  FwVolHeader           Pointer to the firmware volume header of the volume to return.\r
 \r
 \r
-  @retval  EFI_SUCCESS The volume was found.\r
-  @retval  EFI_NOT_FOUND The volume was not found.\r
-  @retval  EFI_INVALID_PARAMETER FwVolHeader is NULL.\r
+  @retval EFI_SUCCESS           The volume was found.\r
+  @retval EFI_NOT_FOUND         The volume was not found.\r
+  @retval EFI_INVALID_PARAMETER FwVolHeader is NULL.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextVolume (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextVolume (\r
-  IN UINTN                            Instance,\r
-  IN OUT EFI_FIRMWARE_VOLUME_HEADER   **FwVolHeader\r
+  IN UINTN                          Instance,\r
+  IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -232,22 +235,22 @@ PeiServicesFfsFindNextVolume (
 /**\r
   This service enables PEIMs to discover additional firmware files.\r
 \r
 /**\r
   This service enables PEIMs to discover additional firmware files.\r
 \r
-  @param  SearchType A filter to find files only of this type.\r
-  @param  FwVolHeader Pointer to the firmware volume header of the volume to search.\r
-  This parameter must point to a valid FFS volume.\r
-  @param  FileHeader Pointer to the current file from which to begin searching.\r
+  @param  SearchType            A filter to find files only of this type.\r
+  @param  FwVolHeader           Pointer to the firmware volume header of the volume to search.\r
+                                This parameter must point to a valid FFS volume.\r
+  @param  FileHeader            Pointer to the current file from which to begin searching.\r
 \r
 \r
-  @retval  EFI_SUCCESS The file was found.\r
-  @retval  EFI_NOT_FOUND The file was not found.\r
-  @retval  EFI_NOT_FOUND The header checksum was not zero.\r
+  @retval EFI_SUCCESS           The file was found.\r
+  @retval EFI_NOT_FOUND         The file was not found.\r
+  @retval EFI_NOT_FOUND         The header checksum was not zero.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextFile (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindNextFile (\r
-  IN EFI_FV_FILETYPE                  SearchType,\r
-  IN EFI_FIRMWARE_VOLUME_HEADER       *FwVolHeader,\r
-  IN OUT EFI_FFS_FILE_HEADER          **FileHeader\r
+  IN EFI_FV_FILETYPE            SearchType,\r
+  IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,\r
+  IN OUT EFI_FFS_FILE_HEADER    **FileHeader\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -259,20 +262,21 @@ PeiServicesFfsFindNextFile (
 /**\r
   This service enables PEIMs to discover sections of a given type within a valid FFS file.\r
 \r
 /**\r
   This service enables PEIMs to discover sections of a given type within a valid FFS file.\r
 \r
-  @param  SearchType The value of the section type to find.\r
-  @param  FfsFileHeader A pointer to the file header that contains the set of sections to be searched.\r
-  @param  SectionData A pointer to the discovered section, if successful.\r
+  @param  SearchType            The value of the section type to find.\r
+  @param  FfsFileHeader         A pointer to the file header that contains the set of sections to\r
+                                be searched.\r
+  @param  SectionData           A pointer to the discovered section, if successful.\r
 \r
 \r
-  @retval  EFI_SUCCESS The section was found.\r
-  @retval  EFI_NOT_FOUND The section was not found.\r
+  @retval EFI_SUCCESS           The section was found.\r
+  @retval EFI_NOT_FOUND         The section was not found.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindSectionData (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesFfsFindSectionData (\r
-  IN EFI_SECTION_TYPE                 SectionType,\r
-  IN EFI_FFS_FILE_HEADER              *FfsFileHeader,\r
-  IN OUT VOID                         **SectionData\r
+  IN EFI_SECTION_TYPE           SectionType,\r
+  IN EFI_FFS_FILE_HEADER        *FfsFileHeader,\r
+  IN OUT VOID                   **SectionData\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -285,19 +289,19 @@ PeiServicesFfsFindSectionData (
   This service enables PEIMs to register the permanent memory configuration\r
   that has been initialized with the PEI Foundation.\r
 \r
   This service enables PEIMs to register the permanent memory configuration\r
   that has been initialized with the PEI Foundation.\r
 \r
-  @param  MemoryBegin The value of a region of installed memory.\r
-  @param  MemoryLength The corresponding length of a region of installed memory.\r
+  @param  MemoryBegin           The value of a region of installed memory.\r
+  @param  MemoryLength          The corresponding length of a region of installed memory.\r
 \r
 \r
-  @retval  EFI_SUCCESS The region was successfully installed in a HOB.\r
-  @retval  EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.\r
-  @retval  EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r
+  @retval EFI_SUCCESS           The region was successfully installed in a HOB.\r
+  @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.\r
+  @retval EFI_OUT_OF_RESOURCES  There is no additional space for HOB creation.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPeiMemory (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesInstallPeiMemory (\r
-  IN EFI_PHYSICAL_ADDRESS             MemoryBegin,\r
-  IN UINT64                           MemoryLength\r
+  IN EFI_PHYSICAL_ADDRESS       MemoryBegin,\r
+  IN UINT64                     MemoryLength\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -307,24 +311,25 @@ PeiServicesInstallPeiMemory (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This service enables PEIMs to allocate memory after the permanent memory has been installed by a PEIM.\r
+  This service enables PEIMs to allocate memory after the permanent memory has been installed by a\r
+  PEIM.\r
 \r
 \r
-  @param  MemoryType Type of memory to allocate.\r
-  @param  Pages Number of pages to allocate.\r
-  @param  Memory Pointer of memory allocated.\r
+  @param  MemoryType            Type of memory to allocate.\r
+  @param  Pages                 Number of pages to allocate.\r
+  @param  Memory                Pointer of memory allocated.\r
 \r
 \r
-  @retval  EFI_SUCCESS The memory range was successfully allocated.\r
-  @retval  EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
-  @retval  EFI_NOT_AVAILABLE_YET Called with permanent memory not available.\r
-  @retval  EFI_OUT_OF_RESOURCES The pages could not be allocated.\r
+  @retval EFI_SUCCESS           The memory range was successfully allocated.\r
+  @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.\r
+  @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available.\r
+  @retval EFI_OUT_OF_RESOURCES  The pages could not be allocated.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePages (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePages (\r
-  IN EFI_MEMORY_TYPE                  MemoryType,\r
-  IN UINTN                            Pages,\r
-  IN OUT EFI_PHYSICAL_ADDRESS         *Memory\r
+  IN EFI_MEMORY_TYPE            MemoryType,\r
+  IN UINTN                      Pages,\r
+  IN OUT EFI_PHYSICAL_ADDRESS   *Memory\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -336,19 +341,19 @@ PeiServicesAllocatePages (
 /**\r
   This service allocates memory from the Hand-Off Block (HOB) heap.\r
 \r
 /**\r
   This service allocates memory from the Hand-Off Block (HOB) heap.\r
 \r
-  @param  Size The number of bytes to allocate from the pool.\r
-  @param  Buffer If the call succeeds, a pointer to a pointer to the allocated buffer;\r
-  undefined otherwise.\r
+  @param  Size                  The number of bytes to allocate from the pool.\r
+  @param  Buffer                If the call succeeds, a pointer to a pointer to the allocate\r
+                                buffer; undefined otherwise.\r
 \r
 \r
-  @retval  EFI_SUCCESS The allocation was successful\r
-  @retval  EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.\r
+  @retval EFI_SUCCESS           The allocation was successful\r
+  @retval EFI_OUT_OF_RESOURCES  There is not enough heap to allocate the requested size.\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePool (\r
 \r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
 PeiServicesAllocatePool (\r
-  IN UINTN                            Size,\r
-  OUT VOID                            **Buffer\r
+  IN UINTN                      Size,\r
+  OUT VOID                      **Buffer\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
   )\r
 {\r
   EFI_PEI_SERVICES  **PeiServices;\r
@@ -358,9 +363,10 @@ PeiServicesAllocatePool (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This service resets the entire platform, including all processors and devices, and reboots the system. \r
+  This service resets the entire platform, including all processors and devices, and reboots the\r
+  system. \r
 \r
 \r
-  @retval  EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
+  @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r
 \r
 **/\r
 EFI_STATUS\r
 \r
 **/\r
 EFI_STATUS\r
index 1b1376e2cf29b287310b0d61516118b3e67d1644..31a0462f079beaffd47e9a8ed8fac8572b9da1e9 100644 (file)
 **/\r
 \r
 /**\r
 **/\r
 \r
 /**\r
-  This function returns the size, in bytes, \r
-  of the device path data structure specified by DevicePath.\r
-  If DevicePath is NULL, then 0 is returned.\r
+  Returns the size of a device path in bytes.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function returns the size, in bytes, of the device path data structure specified by\r
+  DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
   @return The size of a device path in bytes.\r
 \r
 \r
   @return The size of a device path in bytes.\r
 \r
@@ -58,18 +59,22 @@ GetDevicePathSize (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function allocates space for a new copy of the device path\r
-  specified by DevicePath.\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function allocates space for a new copy of the device path specified by DevicePath.  If\r
+  DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
+  contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+  is returned.  Otherwise, NULL is returned.  \r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
 \r
-  @return The duplicated device path.\r
+  @return A pointer to the duplicated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
@@ -92,24 +97,29 @@ DuplicateDevicePath (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function appends the device path SecondDevicePath\r
-  to every device path instance in FirstDevicePath. \r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  FirstDevicePath A pointer to a device path data structure.\r
-  \r
-  @param  SecondDevicePath A pointer to a device path data structure.\r
+  This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+  FirstDevicePath in a newly allocated buffer.  Only the end-of-device-path device node from\r
+  SecondDevicePath is retained. The newly created device path is returned.  \r
+  If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.  \r
+  If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.  \r
+  If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.  \r
+  If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the\r
+  responsibility of the caller to free the memory allocated.\r
 \r
 \r
-  @return A pointer to the new device path is returned.\r
-  NULL is returned if space for the new device path could not be allocated from pool.\r
-  It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath\r
-  if they are no longer needed.\r
+  @param  FirstDevicePath            A pointer to a device path data structure.\r
+  @param  SecondDevicePath           A pointer to a device path data structure.\r
+\r
+  @return A pointer to the new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,  OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath  OPTIONAL\r
   )\r
 {\r
   UINTN                     Size;\r
   )\r
 {\r
   UINTN                     Size;\r
@@ -119,7 +129,7 @@ AppendDevicePath (
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath2;\r
 \r
   //\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath2;\r
 \r
   //\r
-  // If there's only 1 path, just duplicate it\r
+  // If there's only 1 path, just duplicate it.\r
   //\r
   if (FirstDevicePath == NULL) {\r
     return DuplicateDevicePath (SecondDevicePath);\r
   //\r
   if (FirstDevicePath == NULL) {\r
     return DuplicateDevicePath (SecondDevicePath);\r
@@ -131,7 +141,7 @@ AppendDevicePath (
 \r
   //\r
   // Allocate space for the combined device path. It only has one end node of\r
 \r
   //\r
   // Allocate space for the combined device path. It only has one end node of\r
-  // length EFI_DEVICE_PATH_PROTOCOL\r
+  // length EFI_DEVICE_PATH_PROTOCOL.\r
   //\r
   Size1         = GetDevicePathSize (FirstDevicePath);\r
   Size2         = GetDevicePathSize (SecondDevicePath);\r
   //\r
   Size1         = GetDevicePathSize (FirstDevicePath);\r
   Size2         = GetDevicePathSize (SecondDevicePath);\r
@@ -142,9 +152,10 @@ AppendDevicePath (
   if (NewDevicePath != NULL) {\r
     NewDevicePath = CopyMem (NewDevicePath, FirstDevicePath, Size1);\r
     //\r
   if (NewDevicePath != NULL) {\r
     NewDevicePath = CopyMem (NewDevicePath, FirstDevicePath, Size1);\r
     //\r
-    // Over write Src1 EndNode and do the copy\r
+    // Over write FirstDevicePath EndNode and do the copy\r
     //\r
     //\r
-    DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath + (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));\r
+    DevicePath2 = (EFI_DEVICE_PATH_PROTOCOL *) ((CHAR8 *) NewDevicePath +\r
+                  (Size1 - sizeof (EFI_DEVICE_PATH_PROTOCOL)));\r
     CopyMem (DevicePath2, SecondDevicePath, Size2);\r
   }\r
 \r
     CopyMem (DevicePath2, SecondDevicePath, Size2);\r
   }\r
 \r
@@ -152,23 +163,28 @@ AppendDevicePath (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function appends the device path node SecondDevicePath\r
-  to every device path instance in FirstDevicePath.\r
+  Creates a new path by appending the device node to the device path.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
-  \r
-  @param  DevicePathNode A pointer to a single device path node.\r
+  This function creates a new device path by appending a copy of the device node specified by\r
+  DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device node.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If DevicePathNode is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathNode             A pointer to a single device path node.\r
 \r
   @return A pointer to the new device path.\r
 \r
   @return A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,     OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode  OPTIONAL\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
@@ -176,6 +192,9 @@ AppendDevicePathNode (
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
   UINTN                     NodeLength;\r
 \r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
   UINTN                     NodeLength;\r
 \r
+  if (DevicePath == NULL || DevicePathNode == NULL) {\r
+    return NULL;\r
+  }\r
   //\r
   // Build a Node that has a terminator on it\r
   //\r
   //\r
   // Build a Node that has a terminator on it\r
   //\r
@@ -202,81 +221,103 @@ AppendDevicePathNode (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function appends the device path instance Instance to the device path Source.\r
-  If Source is NULL, then a new device path with one instance is created.  \r
-\r
-  @param  Source A pointer to a device path data structure.\r
-  @param  Instance A pointer to a device path instance.\r
+  Creates a new device path by appending the specified device path instance to the specified device\r
+  path.\r
\r
+  This function creates a new device path by appending a copy of the device path instance specified\r
+  by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device path instance\r
+  and a new end-of-device-path-instance node is inserted between. \r
+  If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+  If DevicePathInstance is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathInstance         A pointer to a device path instance.\r
 \r
   @return A pointer to the new device path.\r
 \r
   @return A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Source,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Instance\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,        OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance OPTIONAL\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *NewDevicePath;\r
-  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
+  EFI_DEVICE_PATH_PROTOCOL  *TempDevicePath;\r
   UINTN                     SrcSize;\r
   UINTN                     InstanceSize;\r
 \r
   UINTN                     SrcSize;\r
   UINTN                     InstanceSize;\r
 \r
-  if (Source == NULL) {\r
-    return DuplicateDevicePath (Instance);\r
+  if (DevicePath == NULL) {\r
+    return DuplicateDevicePath (DevicePathInstance);\r
+  }\r
+\r
+  if (DevicePathInstance == NULL) {\r
+    return NULL;\r
   }\r
 \r
   }\r
 \r
-  SrcSize       = GetDevicePathSize (Source);\r
-  InstanceSize  = GetDevicePathSize (Instance);\r
+  SrcSize       = GetDevicePathSize (DevicePath);\r
+  InstanceSize  = GetDevicePathSize (DevicePathInstance);\r
 \r
   NewDevicePath = AllocatePool (SrcSize + InstanceSize);\r
   if (NewDevicePath != NULL) {\r
     \r
 \r
   NewDevicePath = AllocatePool (SrcSize + InstanceSize);\r
   if (NewDevicePath != NULL) {\r
     \r
-    DevicePath = CopyMem (NewDevicePath, Source, SrcSize);;\r
+    TempDevicePath = CopyMem (NewDevicePath, DevicePath, SrcSize);;\r
  \r
  \r
-    while (!IsDevicePathEnd (DevicePath)) {\r
-      DevicePath = NextDevicePathNode (DevicePath);\r
+    while (!IsDevicePathEnd (TempDevicePath)) {\r
+      TempDevicePath = NextDevicePathNode (TempDevicePath);\r
     }\r
     \r
     }\r
     \r
-    DevicePath->SubType  = END_INSTANCE_DEVICE_PATH_SUBTYPE;\r
-\r
-    DevicePath           = NextDevicePathNode (DevicePath);\r
-    CopyMem (DevicePath, Instance, InstanceSize);\r
+    TempDevicePath->SubType  = END_INSTANCE_DEVICE_PATH_SUBTYPE;\r
+    TempDevicePath           = NextDevicePathNode (TempDevicePath);\r
+    CopyMem (TempDevicePath, DevicePathInstance, InstanceSize);\r
   }\r
 \r
   return NewDevicePath;\r
 }\r
 \r
 /**\r
   }\r
 \r
   return NewDevicePath;\r
 }\r
 \r
 /**\r
-  Function retrieves the next device path instance from a device path data structure.\r
-\r
-  @param  DevicePath A pointer to a device path data structure.\r
-  \r
-  @param  Size A pointer to the size of a device path instance in bytes.\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a copy of the current device path instance. It also updates DevicePath to\r
+  point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+  to hold the size of the device path instance copy.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  If Size is NULL, then ASSERT().\r
\r
+  @param  DevicePath                 On input, this holds the pointer to the current device path\r
+                                     instance. On output, this holds the pointer to the next device\r
+                                     path instance or NULL if there are no more device path\r
+                                     instances in the device path pointer to a device path data\r
+                                     structure.\r
+  @param  Size                       On output, this holds the size of the device path instance, in\r
+                                     bytes or zero, if DevicePath is NULL.\r
 \r
 \r
-  @return This function returns a pointer to the current device path instance.\r
-  In addition, it returns the size in bytes of the current device path instance in Size,\r
-  and a pointer to the next device path instance in DevicePath.\r
-  If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.\r
+  @return A pointer to the current device path instance.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 GetNextDevicePathInstance (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 GetNextDevicePathInstance (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePath,\r
-     OUT UINTN                     *Size\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL    **DevicePath,\r
+  OUT UINTN                          *Size\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevPath;\r
   EFI_DEVICE_PATH_PROTOCOL  *ReturnValue;\r
   UINT8                     Temp;\r
 \r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevPath;\r
   EFI_DEVICE_PATH_PROTOCOL  *ReturnValue;\r
   UINT8                     Temp;\r
 \r
-  ASSERT (DevicePath != NULL);\r
   ASSERT (Size != NULL);\r
   ASSERT (Size != NULL);\r
-  if (*DevicePath == NULL) {\r
+\r
+  if (DevicePath == NULL || *DevicePath == NULL) {\r
     *Size = 0;\r
     return NULL;\r
   }\r
     *Size = 0;\r
     return NULL;\r
   }\r
@@ -316,12 +357,60 @@ GetNextDevicePathInstance (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Return TRUE is this is a multi instance device path.\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+  initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
+  is returned.\r
+  If NodeLength is smaller than a device path header, then NULL is returned.  \r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  NodeType                   The device node type for the new device node.\r
+  @param  NodeSubType                The device node sub-type for the new device node.\r
+  @param  NodeLength                 The length of the new device node.\r
+\r
+  @return The new device path.\r
+\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+CreateDeviceNode (\r
+  IN UINT8                           NodeType,\r
+  IN UINT8                           NodeSubType,\r
+  IN UINT16                          NodeLength\r
+  )\r
+{\r
+  EFI_DEVICE_PATH_PROTOCOL      *DevicePath;\r
+\r
+  if (NodeLength < sizeof (EFI_DEVICE_PATH_PROTOCOL)) {\r
+    //\r
+    // NodeLength is less than the size of the header.\r
+    //\r
+    return NULL;\r
+  }\r
\r
+  DevicePath = AllocatePool (NodeLength);\r
+  if (DevicePath != NULL) {\r
+     DevicePath->Type    = NodeType;\r
+     DevicePath->SubType = NodeSubType;\r
+  }\r
+\r
+  return DevicePath;\r
+}\r
+\r
+/**\r
+  Determines if a device path is single or multi-instance.\r
+\r
+  This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+  Otherwise, FALSE is returned.  If DevicePath is NULL, then FALSE is returned.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
 \r
-  @retval  TRUE If DevicePath is multi-instance.\r
-  @retval  FALSE If DevicePath is not multi-instance or DevicePath is NULL.\r
+  @retval  TRUE                      DevicePath is multi-instance.\r
+  @retval  FALSE                     DevicePath is not multi-instance or DevicePath is NULL.\r
 \r
 **/\r
 BOOLEAN\r
 \r
 **/\r
 BOOLEAN\r
@@ -330,7 +419,7 @@ IsDevicePathMultiInstance (
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
-  CONST EFI_DEVICE_PATH_PROTOCOL  *Node;\r
+  CONST EFI_DEVICE_PATH_PROTOCOL     *Node;\r
 \r
   if (DevicePath == NULL) {\r
     return FALSE;\r
 \r
   if (DevicePath == NULL) {\r
     return FALSE;\r
@@ -348,19 +437,22 @@ IsDevicePathMultiInstance (
   return FALSE;\r
 }\r
 \r
   return FALSE;\r
 }\r
 \r
+\r
 /**\r
 /**\r
-  This function retrieves the device path protocol from a handle.\r
+  Retrieves the device path protocol from a handle.\r
 \r
 \r
-  @param  Handle The handle from which to retrieve the device path protocol.\r
+  This function returns the device path protocol from the handle specified by Handle.  If Handle is\r
+  NULL or Handle does not contain a device path protocol, then NULL is returned.\r
\r
+  @param  Handle                     The handle from which to retrieve the device path protocol.\r
 \r
 \r
-  @return This function returns the device path protocol from the handle specified by Handle.\r
-  If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.\r
+  @return The device path protocol from the handle specified by Handle.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
-  IN EFI_HANDLE  Handle\r
+  IN EFI_HANDLE                      Handle\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
@@ -378,54 +470,52 @@ DevicePathFromHandle (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function allocates a device path for a file and appends it to an existing device path.\r
+  Allocates a device path for a file and appends it to an existing device path.\r
 \r
 \r
-  @param  Device A pointer to a device handle.  This parameter is optional and may be NULL.\r
-  @param  FileName A pointer to a Null-terminated Unicode string.\r
+  If Device is a valid device handle that contains a device path protocol, then a device path for\r
+  the file specified by FileName  is allocated and appended to the device path associated with the\r
+  handle Device.  The allocated device path is returned.  If Device is NULL or Device is a handle\r
+  that does not support the device path protocol, then a device path containing a single device\r
+  path node for the file specified by FileName is allocated and returned.\r
+  If FileName is NULL, then ASSERT().\r
 \r
 \r
-  @return If Device is a valid device handle that contains a device path protocol,\r
-  then a device path for the file specified by FileName is allocated\r
-  and appended to the device path associated with the handle Device. The allocated device path is returned.\r
-  If Device is NULL or Device is a handle that does not support the device path protocol,\r
-  then a device path containing a single device path node for the file specified by FileName\r
-  is allocated and returned.\r
+  @param  Device                     A pointer to a device handle.  This parameter is optional and\r
+                                     may be NULL.\r
+  @param  FileName                   A pointer to a Null-terminated Unicode string.\r
+\r
+  @return The allocated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
-  IN EFI_HANDLE    Device,     OPTIONAL\r
-  IN CONST CHAR16  *FileName\r
+  IN EFI_HANDLE                      Device,     OPTIONAL\r
+  IN CONST CHAR16                    *FileName\r
   )\r
 {\r
   )\r
 {\r
-  UINTN                     FileNameSize;\r
-  UINTN                     FilePathNodeSize;\r
-  FILEPATH_DEVICE_PATH      *FilePathNode;\r
+  UINTN                     Size;\r
+  FILEPATH_DEVICE_PATH      *FilePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
-\r
-  DevicePath        = NULL;\r
-\r
-  FileNameSize      = StrSize (FileName);\r
-  FilePathNodeSize  = FileNameSize + SIZE_OF_FILEPATH_DEVICE_PATH;\r
-  FilePathNode      = AllocatePool (FilePathNodeSize);\r
-  if (FilePathNode != NULL) {\r
-    //\r
-    // Build a file path node\r
-    //\r
-    FilePathNode->Header.Type     = MEDIA_DEVICE_PATH;\r
-    FilePathNode->Header.SubType  = MEDIA_FILEPATH_DP;\r
-    SetDevicePathNodeLength (&FilePathNode->Header, FilePathNodeSize);\r
-    CopyMem (FilePathNode->PathName, FileName, FileNameSize);\r
\r
-    //\r
-    // Append file path node to device's device path\r
-    //\r
+  EFI_DEVICE_PATH_PROTOCOL  *FileDevicePathNode;\r
+\r
+  DevicePath = NULL;\r
+\r
+  Size = StrSize (FileName);\r
+  FileDevicePathNode = CreateDeviceNode (\r
+                         MEDIA_DEVICE_PATH,\r
+                         MEDIA_FILEPATH_DP,\r
+                         (UINT16) (Size + SIZE_OF_FILEPATH_DEVICE_PATH)\r
+                         );\r
+  if (FileDevicePathNode != NULL) {\r
+    FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePathNode;\r
+    CopyMem (&FilePath->PathName, FileName, Size);\r
     if (Device != NULL) {\r
       DevicePath = DevicePathFromHandle (Device);\r
     }\r
     if (Device != NULL) {\r
       DevicePath = DevicePathFromHandle (Device);\r
     }\r
-    DevicePath = AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOCOL *) FilePathNode);\r
-    FreePool (FilePathNode);\r
+    DevicePath = AppendDevicePathNode (DevicePath, FileDevicePathNode);\r
+    FreePool (FileDevicePathNode);\r
   }\r
   }\r
+\r
   return DevicePath;\r
 }\r
 \r
   return DevicePath;\r
 }\r
 \r
index aea75aa49640e0b02001b1f099826f1e97d661b2..ec4325cf3934f7287d08cc405c1ec9f1959fc0dd 100644 (file)
@@ -49,11 +49,12 @@ DevicePathLibConstructor (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function returns the size, in bytes, \r
-  of the device path data structure specified by DevicePath.\r
-  If DevicePath is NULL, then 0 is returned.\r
+  Returns the size of a device path in bytes.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function returns the size, in bytes, of the device path data structure specified by\r
+  DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
   @return The size of a device path in bytes.\r
 \r
 \r
   @return The size of a device path in bytes.\r
 \r
@@ -68,124 +69,189 @@ GetDevicePathSize (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function allocates space for a new copy of the device path\r
-  specified by DevicePath.\r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function allocates space for a new copy of the device path specified by DevicePath.  If\r
+  DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
+  contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
+  is returned.  Otherwise, NULL is returned.  \r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
 \r
 \r
-  @return The duplicated device path.\r
+  @return A pointer to the duplicated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DuplicateDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL   *DevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
   )\r
 {\r
   return mDevicePathUtilities->DuplicateDevicePath (DevicePath);\r
 }\r
 \r
 /**\r
   )\r
 {\r
   return mDevicePathUtilities->DuplicateDevicePath (DevicePath);\r
 }\r
 \r
 /**\r
-  This function appends the device path SecondDevicePath\r
-  to every device path instance in FirstDevicePath. \r
+  Creates a new device path by appending a second device path to a first device path.\r
 \r
 \r
-  @param  FirstDevicePath A pointer to a device path data structure.\r
-  \r
-  @param  SecondDevicePath A pointer to a device path data structure.\r
+  This function creates a new device path by appending a copy of SecondDevicePath to a copy of\r
+  FirstDevicePath in a newly allocated buffer.  Only the end-of-device-path device node from\r
+  SecondDevicePath is retained. The newly created device path is returned.  \r
+  If FirstDevicePath is NULL, then it is ignored, and a duplicate of SecondDevicePath is returned.  \r
+  If SecondDevicePath is NULL, then it is ignored, and a duplicate of FirstDevicePath is returned.  \r
+  If both FirstDevicePath and SecondDevicePath are NULL, then NULL is returned.  \r
+  If there is not enough memory for the newly allocated buffer, then NULL is returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the\r
+  responsibility of the caller to free the memory allocated.\r
 \r
 \r
-  @return A pointer to the new device path is returned.\r
-  NULL is returned if space for the new device path could not be allocated from pool.\r
-  It is up to the caller to free the memory used by FirstDevicePath and SecondDevicePath\r
-  if they are no longer needed.\r
+  @param  FirstDevicePath            A pointer to a device path data structure.\r
+  @param  SecondDevicePath           A pointer to a device path data structure.\r
+\r
+  @return A pointer to the new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePath (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,  OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath  OPTIONAL\r
   )\r
 {\r
   return mDevicePathUtilities->AppendDevicePath (FirstDevicePath, SecondDevicePath);\r
 }\r
 \r
 /**\r
   )\r
 {\r
   return mDevicePathUtilities->AppendDevicePath (FirstDevicePath, SecondDevicePath);\r
 }\r
 \r
 /**\r
-  This function appends the device path node SecondDevicePath\r
-  to every device path instance in FirstDevicePath.\r
+  Creates a new path by appending the device node to the device path.\r
 \r
 \r
-  @param  FirstDevicePath A pointer to a device path data structure.\r
-  \r
-  @param  SecondDevicePath A pointer to a single device path node.\r
+  This function creates a new device path by appending a copy of the device node specified by\r
+  DevicePathNode to a copy of the device path specified by DevicePath in an allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device node.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If DevicePathNode is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathNode             A pointer to a single device path node.\r
 \r
   @return A pointer to the new device path.\r
 \r
   @return A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathNode (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *FirstDevicePath,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *SecondDevicePath\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,     OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathNode  OPTIONAL\r
   )\r
 {\r
   )\r
 {\r
-  return mDevicePathUtilities->AppendDeviceNode (FirstDevicePath, SecondDevicePath);\r
+  return mDevicePathUtilities->AppendDeviceNode (DevicePath, DevicePathNode);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function appends the device path instance Instance to the device path Source.\r
-  If Source is NULL, then a new device path with one instance is created.  \r
-\r
-  @param  Source A pointer to a device path data structure.\r
-  @param  Instance A pointer to a device path instance.\r
+  Creates a new device path by appending the specified device path instance to the specified device\r
+  path.\r
\r
+  This function creates a new device path by appending a copy of the device path instance specified\r
+  by DevicePathInstance to a copy of the device path secified by DevicePath in a allocated buffer.\r
+  The end-of-device-path device node is moved after the end of the appended device path instance\r
+  and a new end-of-device-path-instance node is inserted between. \r
+  If DevicePath is NULL, then a copy if DevicePathInstance is returned.\r
+  If DevicePathInstance is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  \r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+  @param  DevicePathInstance         A pointer to a device path instance.\r
 \r
   @return A pointer to the new device path.\r
 \r
   @return A pointer to the new device path.\r
-  If there is not enough temporary pool memory available to complete this function,\r
-  then NULL is returned.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 AppendDevicePathInstance (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Source,\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *Instance\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath,        OPTIONAL\r
+  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePathInstance OPTIONAL\r
   )\r
 {\r
   )\r
 {\r
-  return mDevicePathUtilities->AppendDevicePathInstance (Source, Instance);\r
+  return mDevicePathUtilities->AppendDevicePathInstance (DevicePath, DevicePathInstance);\r
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  Function retrieves the next device path instance from a device path data structure.\r
-\r
-  @param  DevicePath A pointer to a device path data structure.\r
-  \r
-  @param  Size A pointer to the size of a device path instance in bytes.\r
-\r
-  @return This function returns a pointer to the current device path instance.\r
-  In addition, it returns the size in bytes of the current device path instance in Size,\r
-  and a pointer to the next device path instance in DevicePath.\r
-  If there are no more device path instances in DevicePath, then DevicePath will be set to NULL.\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a copy of the current device path instance. It also updates DevicePath to\r
+  point to the next device path instance in the device path (or NULL if no more) and updates Size\r
+  to hold the size of the device path instance copy.\r
+  If DevicePath is NULL, then NULL is returned.\r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+  If Size is NULL, then ASSERT().\r
\r
+  @param  DevicePath                 On input, this holds the pointer to the current device path\r
+                                     instance. On output, this holds the pointer to the next device\r
+                                     path instance or NULL if there are no more device path\r
+                                     instances in the device path pointer to a device path data\r
+                                     structure.\r
+  @param  Size                       On output, this holds the size of the device path instance, in\r
+                                     bytes or zero, if DevicePath is NULL.\r
+\r
+  @return A pointer to the current device path instance.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 GetNextDevicePathInstance (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 GetNextDevicePathInstance (\r
-  IN OUT EFI_DEVICE_PATH_PROTOCOL  **DevicePath,\r
-     OUT UINTN                     *Size\r
+  IN OUT EFI_DEVICE_PATH_PROTOCOL    **DevicePath,\r
+  OUT UINTN                          *Size\r
   )\r
 {\r
   )\r
 {\r
-  ASSERT (DevicePath != NULL);\r
   ASSERT (Size != NULL);\r
   return mDevicePathUtilities->GetNextDevicePathInstance (DevicePath, Size);\r
 }\r
 \r
 /**\r
   ASSERT (Size != NULL);\r
   return mDevicePathUtilities->GetNextDevicePathInstance (DevicePath, Size);\r
 }\r
 \r
 /**\r
-  Return TRUE is this is a multi instance device path.\r
+  Creates a copy of the current device path instance and returns a pointer to the next device path\r
+  instance.\r
+\r
+  This function creates a new device node in a newly allocated buffer of size NodeLength and\r
+  initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
+  is returned.\r
+  If NodeLength is smaller than a device path header, then NULL is returned.  \r
+  If there is not enough memory to allocate space for the new device path, then NULL is returned.  \r
+  The memory is allocated from EFI boot services memory. It is the responsibility of the caller to\r
+  free the memory allocated.\r
+\r
+  @param  NodeType                   The device node type for the new device node.\r
+  @param  NodeSubType                The device node sub-type for the new device node.\r
+  @param  NodeLength                 The length of the new device node.\r
+\r
+  @return The new device path.\r
+\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+EFIAPI\r
+CreateDeviceNode (\r
+  IN UINT8                           NodeType,\r
+  IN UINT8                           NodeSubType,\r
+  IN UINT16                          NodeLength\r
+  )\r
+{\r
+  return mDevicePathUtilities->CreateDeviceNode (NodeType, NodeSubType, NodeLength);\r
+}\r
+\r
+/**\r
+  Determines if a device path is single or multi-instance.\r
 \r
 \r
-  @param  DevicePath A pointer to a device path data structure.\r
+  This function returns TRUE if the device path specified by DevicePath is multi-instance.\r
+  Otherwise, FALSE is returned.  If DevicePath is NULL, then FALSE is returned.\r
 \r
 \r
-  @retval  TRUE If DevicePath is multi-instance.\r
-  @retval  FALSE If DevicePath is not multi-instance or DevicePath is NULL.\r
+  @param  DevicePath                 A pointer to a device path data structure.\r
+\r
+  @retval  TRUE                      DevicePath is multi-instance.\r
+  @retval  FALSE                     DevicePath is not multi-instance or DevicePath is NULL.\r
 \r
 **/\r
 BOOLEAN\r
 \r
 **/\r
 BOOLEAN\r
@@ -198,18 +264,20 @@ IsDevicePathMultiInstance (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function retrieves the device path protocol from a handle.\r
+  Retrieves the device path protocol from a handle.\r
 \r
 \r
-  @param  Handle The handle from which to retrieve the device path protocol.\r
+  This function returns the device path protocol from the handle specified by Handle.  If Handle is\r
+  NULL or Handle does not contain a device path protocol, then NULL is returned.\r
\r
+  @param  Handle                     The handle from which to retrieve the device path protocol.\r
 \r
 \r
-  @return This function returns the device path protocol from the handle specified by Handle.\r
-  If Handle is NULL or Handle does not contain a device path protocol, then NULL is returned.\r
+  @return The device path protocol from the handle specified by Handle.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 DevicePathFromHandle (\r
-  IN EFI_HANDLE  Handle\r
+  IN EFI_HANDLE                      Handle\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
   )\r
 {\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
@@ -227,24 +295,27 @@ DevicePathFromHandle (
 }\r
 \r
 /**\r
 }\r
 \r
 /**\r
-  This function allocates a device path for a file and appends it to an existing device path.\r
+  Allocates a device path for a file and appends it to an existing device path.\r
+\r
+  If Device is a valid device handle that contains a device path protocol, then a device path for\r
+  the file specified by FileName  is allocated and appended to the device path associated with the\r
+  handle Device.  The allocated device path is returned.  If Device is NULL or Device is a handle\r
+  that does not support the device path protocol, then a device path containing a single device\r
+  path node for the file specified by FileName is allocated and returned.\r
+  If FileName is NULL, then ASSERT().\r
 \r
 \r
-  @param  Device A pointer to a device handle.  This parameter is optional and may be NULL.\r
-  @param  FileName A pointer to a Null-terminated Unicode string.\r
+  @param  Device                     A pointer to a device handle.  This parameter is optional and\r
+                                     may be NULL.\r
+  @param  FileName                   A pointer to a Null-terminated Unicode string.\r
 \r
 \r
-  @return If Device is a valid device handle that contains a device path protocol,\r
-  then a device path for the file specified by FileName is allocated\r
-  and appended to the device path associated with the handle Device. The allocated device path is returned.\r
-  If Device is NULL or Device is a handle that does not support the device path protocol,\r
-  then a device path containing a single device path node for the file specified by FileName\r
-  is allocated and returned.\r
+  @return The allocated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
 FileDevicePath (\r
-  IN EFI_HANDLE    Device,     OPTIONAL\r
-  IN CONST CHAR16  *FileName\r
+  IN EFI_HANDLE                      Device,     OPTIONAL\r
+  IN CONST CHAR16                    *FileName\r
   )\r
 {\r
   UINTN                     Size;\r
   )\r
 {\r
   UINTN                     Size;\r
@@ -255,11 +326,11 @@ FileDevicePath (
   DevicePath = NULL;\r
 \r
   Size = StrSize (FileName);\r
   DevicePath = NULL;\r
 \r
   Size = StrSize (FileName);\r
-  FileDevicePathNode = mDevicePathUtilities->CreateDeviceNode (\r
-                                               MEDIA_DEVICE_PATH,\r
-                                               MEDIA_FILEPATH_DP,\r
-                                               (UINT16) (Size + SIZE_OF_FILEPATH_DEVICE_PATH)\r
-                                               );\r
+  FileDevicePathNode = CreateDeviceNode (\r
+                         MEDIA_DEVICE_PATH,\r
+                         MEDIA_FILEPATH_DP,\r
+                         (UINT16) (Size + SIZE_OF_FILEPATH_DEVICE_PATH)\r
+                         );\r
   if (FileDevicePathNode != NULL) {\r
     FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePathNode;\r
     CopyMem (&FilePath->PathName, FileName, Size);\r
   if (FileDevicePathNode != NULL) {\r
     FilePath = (FILEPATH_DEVICE_PATH *) FileDevicePathNode;\r
     CopyMem (&FilePath->PathName, FileName, Size);\r
@@ -269,6 +340,7 @@ FileDevicePath (
     DevicePath = AppendDevicePathNode (DevicePath, FileDevicePathNode);\r
     FreePool (FileDevicePathNode);\r
   }\r
     DevicePath = AppendDevicePathNode (DevicePath, FileDevicePathNode);\r
     FreePool (FileDevicePathNode);\r
   }\r
+\r
   return DevicePath;\r
 }\r
 \r
   return DevicePath;\r
 }\r
 \r
index bb3271035ea75edac4705ee8167a5647191a5737..0c98aef5fb0d09e4c02cd710fc7dc9a975fcf7d3 100644 (file)
     <Filename>Library/UefiDriverEntryPoint/UefiDriverEntryPoint.msa</Filename>\r
     <Filename>Library/UefiDriverModelLib/UefiDriverModelLib.msa</Filename>\r
     <Filename>Library/UefiLib/UefiLib.msa</Filename>\r
     <Filename>Library/UefiDriverEntryPoint/UefiDriverEntryPoint.msa</Filename>\r
     <Filename>Library/UefiDriverModelLib/UefiDriverModelLib.msa</Filename>\r
     <Filename>Library/UefiLib/UefiLib.msa</Filename>\r
-    <Filename>Library/UefiMemoryLib/UefiMemoryLib.msa</Filename>\r
+    <Filename>Library/DxeMemoryLib/DxeMemoryLib.msa</Filename>\r
     <Filename>Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.msa</Filename>\r
   </MsaFiles>\r
   <PackageHeaders>\r
     <Filename>Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.msa</Filename>\r
   </MsaFiles>\r
   <PackageHeaders>\r