From 081d1b5210126884daf7710fd746bc68f95e8360 Mon Sep 17 00:00:00 2001 From: Sergey Isakov Date: Tue, 3 Sep 2019 15:19:03 +0300 Subject: [PATCH] added absent files and fixed dependencies Signed-off-by: Sergey Isakov --- .gitignore | 1 + BaseTools/Bin/externals.txt | 1 + Clover.dsc | 560 +-- Clover.fdf | 190 +- CloverEFI/AcpiReset/Reset.inf | 2 +- CloverEFI/BiosKeyboard/KeyboardDxe.inf | 2 +- CloverEFI/BiosVideo/BiosVideo.inf | 2 +- CloverEFI/CpuDxe/Cpu.inf | 2 +- .../OsxAcpiPlatformDxe/AcpiPlatformDxe.inf | 2 +- CloverEFI/OsxBdsDxe/BdsDxe.inf | 2 +- CloverEFI/OsxDxeIpl/DxeIpl.inf | 2 +- CloverEFI/OsxEfiLdr/EfiLdr.inf | 2 +- .../PciBusNoEnumeration.inf | 2 +- CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf | 2 +- CloverEFI/PciRootBridgeDxe/PciRootBridge.inf | 2 +- Drivers/AudioDxe/AudioDxe.inf | 2 +- Drivers/Isa/IsaBusDxe/IsaBusDxe.inf | 1 + Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf | 2 +- Drivers/PartitionDxe/PartitionDxe.inf | 2 +- Drivers/UsbBusDxe/UsbBusDxe.inf | 2 +- Drivers/UsbKbDxe/UsbKbDxe.inf | 2 +- Drivers/UsbMouseDxe/UsbMouseDxe.inf | 2 +- Drivers/XhciDxe/XhciDxe.inf | 2 +- FSInject/FSInject.dec | 2 +- FSInject/FSInject.inf | 2 +- .../ApfsDriverLoader/ApfsDriverLoader.inf | 2 +- FileSystems/GrubFS/src/AFFS.inf | 4 +- FileSystems/GrubFS/src/AFS.inf | 4 +- FileSystems/GrubFS/src/BFS.inf | 4 +- FileSystems/GrubFS/src/BTRFS.inf | 4 +- FileSystems/GrubFS/src/CBFS.inf | 4 +- FileSystems/GrubFS/src/CPIO.inf | 4 +- FileSystems/GrubFS/src/CPIO_BE.inf | 4 +- FileSystems/GrubFS/src/EXFAT.inf | 4 +- FileSystems/GrubFS/src/EXT2.inf | 4 +- FileSystems/GrubFS/src/FAT.inf | 4 +- FileSystems/GrubFS/src/HFS.inf | 4 +- FileSystems/GrubFS/src/HFSPLUS.inf | 4 +- FileSystems/GrubFS/src/ISO9660.inf | 4 +- FileSystems/GrubFS/src/JFS.inf | 4 +- FileSystems/GrubFS/src/MINIX.inf | 4 +- FileSystems/GrubFS/src/MINIX2.inf | 4 +- FileSystems/GrubFS/src/MINIX2_BE.inf | 4 +- FileSystems/GrubFS/src/MINIX3.inf | 4 +- FileSystems/GrubFS/src/MINIX3_BE.inf | 4 +- FileSystems/GrubFS/src/MINIX_BE.inf | 4 +- FileSystems/GrubFS/src/NEWC.inf | 4 +- FileSystems/GrubFS/src/NILFS2.inf | 4 +- FileSystems/GrubFS/src/NTFS.inf | 4 +- FileSystems/GrubFS/src/ODC.inf | 4 +- FileSystems/GrubFS/src/PROC.inf | 4 +- FileSystems/GrubFS/src/REISERFS.inf | 4 +- FileSystems/GrubFS/src/ROMFS.inf | 4 +- FileSystems/GrubFS/src/SFS.inf | 4 +- FileSystems/GrubFS/src/SQUASH4.inf | 4 +- FileSystems/GrubFS/src/TAR.inf | 4 +- FileSystems/GrubFS/src/UDF.inf | 4 +- FileSystems/GrubFS/src/UFS.inf | 4 +- FileSystems/GrubFS/src/UFS2.inf | 4 +- FileSystems/GrubFS/src/UFS_BE.inf | 4 +- FileSystems/GrubFS/src/XFS.inf | 4 +- FileSystems/GrubFS/src/ZFS.inf | 4 +- FileSystems/VBoxFsDxe/VBoxExt2.inf | 2 +- FileSystems/VBoxFsDxe/VBoxExt4.inf | 2 +- FileSystems/VBoxFsDxe/VBoxHfs.inf | 2 +- FileSystems/VBoxFsDxe/VBoxIso9660.inf | 2 +- FileSystems/VBoxFsDxe/VBoxReiserFS.inf | 2 +- .../IntelFrameworkModulePkg.dec | 251 ++ .../IntelFrameworkModulePkg.dsc | 201 + .../IntelFrameworkModulePkg.uni | 169 + .../IntelFrameworkModulePkgExtra.uni | 20 + .../Include/Framework/BootScript.h | 47 + IntelFrameworkPkg/Include/Framework/DxeCis.h | 176 + .../Include/Framework/FirmwareVolumeHeader.h | 85 + .../Framework/FirmwareVolumeImageFormat.h | 38 + .../FrameworkInternalFormRepresentation.h | 403 ++ IntelFrameworkPkg/Include/Framework/Hob.h | 34 + IntelFrameworkPkg/Include/Framework/PeiCis.h | 211 + IntelFrameworkPkg/Include/Framework/SmmCis.h | 557 +++ .../Include/Framework/StatusCode.h | 161 + IntelFrameworkPkg/Include/FrameworkDxe.h | 32 + IntelFrameworkPkg/IntelFrameworkPkg.dec | 186 + IntelFrameworkPkg/IntelFrameworkPkg.dsc | 75 + IntelFrameworkPkg/IntelFrameworkPkg.uni | 22 + IntelFrameworkPkg/IntelFrameworkPkgExtra.uni | 18 + LegacyBios/BlockIoDxe/BlockIoDxe.inf | 2 +- LegacyBios/KeyboardDxe/KeyboardDxe.inf | 2 +- LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf | 2 +- LegacyBios/VideoDxe/VideoDxe.inf | 2 +- LegacyBios/VideoDxe/VideoDxe2.inf | 2 +- Library/DuetTimerLib/DuetTimerLib.inf | 2 +- Library/GenericBdsLib/GenericBdsLib.inf | 2 +- Library/MemLogLibDefault/MemLogLibDefault.inf | 2 +- Library/OpensslLib/OpensslLibNull.inf | 2 +- .../OpensslLib/openssl-1.0.1e/OpensslLib.inf | 2 +- Library/OsxBdsPlatformLib/PlatformBds.inf | 2 +- Library/VBoxPeCoffLib/VBoxPeCoffLib.inf | 2 +- .../VideoBiosPatchLib/VideoBiosPatchLib.inf | 2 +- Library/WaveLib/WaveLib.inf | 2 +- MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c | 2080 ++++++++++ MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h | 91 + .../Library/DxeHttpLib/DxeHttpLib.inf | 48 + .../Library/DxeHttpLib/DxeHttpLib.uni | 22 + MdeModulePkg/Library/DxeNetLib/DxeNetLib.c | 3397 +++++++++++++++++ MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf | 67 + MdeModulePkg/Library/DxeNetLib/DxeNetLib.uni | 22 + MdeModulePkg/Library/DxeNetLib/NetBuffer.c | 1896 +++++++++ MdeModulePkg/MdeModulePkg.dec | 9 + MdePkg/Library/BaseLib/X64/CpuId.S | 60 + MdePkg/Library/BaseLib/X64/CpuIdEx.S | 62 + MdePkg/Library/BaseLib/X64/DisableCache.S | 39 + MdePkg/Library/BaseLib/X64/DisablePaging64.S | 82 + MdePkg/Library/BaseLib/X64/EnableCache.S | 39 + .../BaseLib/X64/EnableDisableInterrupts.S | 36 + MdePkg/Library/BaseLib/X64/LongJump.S | 54 + MdePkg/Library/BaseLib/X64/RdRand.S | 72 + MdePkg/Library/BaseLib/X64/SetJump.S | 53 + MdePkg/Library/BaseLib/X64/SwitchStack.S | 52 + MdePkg/Library/BaseLib/X64/Thunk16.S | 334 ++ MdePkg/MdePkg.dec | 26 + OsxLowMemFixDrv/OsxLowMemFixDrv.inf | 2 +- .../8259InterruptControllerDxe/8259.inf | 1 + PcAtChipsetPkg/PcAtChipsetPkg.dec | 58 + Protocols/AppleImageCodec/AppleImageCodec.inf | 2 +- .../AppleKeyAggregator/AppleKeyAggregator.inf | 2 +- Protocols/AppleKeyFeeder/AppleKeyFeeder.inf | 2 +- Protocols/AppleUITheme/AppleUITheme.inf | 2 +- Protocols/DriverOverride/DriverOverride.inf | 2 +- Protocols/DumpUefiCalls/DumpUefiCalls.inf | 2 +- .../EmuVariableUefi/EmuVariableRuntimeDxe.inf | 2 +- Protocols/FirmwareVolume/FirmwareVolume.inf | 2 +- Protocols/HashServiceFix/HashServiceFix.inf | 2 +- Protocols/MsgLog/MsgLog.c | 2 +- Protocols/MsgLog/MsgLog.inf | 2 +- Protocols/SMCHelper/SMCHelper.inf | 2 +- ShellPkg/Application/Shell/Shell.inf | 2 +- .../ShellCTestApp/ShellCTestApp.inf | 2 +- .../ShellSortTestApp/ShellSortTestApp.inf | 2 +- .../DynamicCommand/DpDynamicCommand/DpApp.inf | 2 +- .../DpDynamicCommand/DpDynamicCommand.inf | 2 +- .../TftpDynamicCommand/TftpApp.inf | 2 +- .../TftpDynamicCommand/TftpDynamicCommand.inf | 2 +- .../UefiHandleParsingLib.inf | 2 +- .../UefiShellBcfgCommandLib.inf | 2 +- .../UefiShellCEntryLib/UefiShellCEntryLib.inf | 2 +- .../UefiShellCommandLib.inf | 2 +- .../UefiShellDebug1CommandsLib.inf | 2 +- .../UefiShellDriver1CommandsLib.inf | 2 +- .../UefiShellInstall1CommandsLib.inf | 2 +- .../UefiShellLevel1CommandsLib.inf | 2 +- .../UefiShellLevel2CommandsLib.inf | 2 +- .../UefiShellLevel3CommandsLib.inf | 2 +- .../Library/UefiShellLib/UefiShellLib.inf | 2 +- .../UefiShellNetwork1CommandsLib.inf | 2 +- .../UefiShellNetwork2CommandsLib.inf | 2 +- ShellPkg/ShellPkg.dsc | 26 +- ShellPkg/ShellPkgDX64.dsc | 60 +- ShellPkg/ShellPkgX64.dsc | 60 +- ShellPkg/build64.sh | 4 +- ShellPkg/build64D.sh | 4 +- Trash/BiosVideoAuto/BiosVideo.inf | 6 +- Trash/BiosVideoAuto/MsgLog.c | 2 +- Trash/IntelGmaDxe/Gop.inf | 2 +- Trash/OemSmbiosGenDxe/SmbiosGen.inf | 2 +- Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf | 2 +- bdmesg_efi/bdmesg.inf | 6 +- cbuild.bat | 13 +- edksetup.bat | 2 +- gptsync/gptsync.inf | 2 +- rEFIt_UEFI/refit.inf | 2 +- 170 files changed, 11906 insertions(+), 616 deletions(-) create mode 100644 BaseTools/Bin/externals.txt create mode 100644 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec create mode 100644 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc create mode 100644 IntelFrameworkModulePkg/IntelFrameworkModulePkg.uni create mode 100644 IntelFrameworkModulePkg/IntelFrameworkModulePkgExtra.uni create mode 100644 IntelFrameworkPkg/Include/Framework/BootScript.h create mode 100644 IntelFrameworkPkg/Include/Framework/DxeCis.h create mode 100644 IntelFrameworkPkg/Include/Framework/FirmwareVolumeHeader.h create mode 100644 IntelFrameworkPkg/Include/Framework/FirmwareVolumeImageFormat.h create mode 100644 IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h create mode 100644 IntelFrameworkPkg/Include/Framework/Hob.h create mode 100644 IntelFrameworkPkg/Include/Framework/PeiCis.h create mode 100644 IntelFrameworkPkg/Include/Framework/SmmCis.h create mode 100644 IntelFrameworkPkg/Include/Framework/StatusCode.h create mode 100644 IntelFrameworkPkg/Include/FrameworkDxe.h create mode 100644 IntelFrameworkPkg/IntelFrameworkPkg.dec create mode 100644 IntelFrameworkPkg/IntelFrameworkPkg.dsc create mode 100644 IntelFrameworkPkg/IntelFrameworkPkg.uni create mode 100644 IntelFrameworkPkg/IntelFrameworkPkgExtra.uni create mode 100644 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c create mode 100644 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h create mode 100644 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf create mode 100644 MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.uni create mode 100644 MdeModulePkg/Library/DxeNetLib/DxeNetLib.c create mode 100644 MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf create mode 100644 MdeModulePkg/Library/DxeNetLib/DxeNetLib.uni create mode 100644 MdeModulePkg/Library/DxeNetLib/NetBuffer.c create mode 100644 MdePkg/Library/BaseLib/X64/CpuId.S create mode 100644 MdePkg/Library/BaseLib/X64/CpuIdEx.S create mode 100644 MdePkg/Library/BaseLib/X64/DisableCache.S create mode 100644 MdePkg/Library/BaseLib/X64/DisablePaging64.S create mode 100644 MdePkg/Library/BaseLib/X64/EnableCache.S create mode 100644 MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S create mode 100644 MdePkg/Library/BaseLib/X64/LongJump.S create mode 100644 MdePkg/Library/BaseLib/X64/RdRand.S create mode 100644 MdePkg/Library/BaseLib/X64/SetJump.S create mode 100644 MdePkg/Library/BaseLib/X64/SwitchStack.S create mode 100644 MdePkg/Library/BaseLib/X64/Thunk16.S diff --git a/.gitignore b/.gitignore index 89795162b..421f5895a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # OS X temporary files that should never be committed +.vs .DS_Store *.swp *.lock diff --git a/BaseTools/Bin/externals.txt b/BaseTools/Bin/externals.txt new file mode 100644 index 000000000..c2c4ab729 --- /dev/null +++ b/BaseTools/Bin/externals.txt @@ -0,0 +1 @@ +Win32 https://svn.code.sf.net/p/edk2-toolbinaries/code/trunk/Win32 diff --git a/Clover.dsc b/Clover.dsc index 4ca9c1a51..0d2c82a22 100644 --- a/Clover.dsc +++ b/Clover.dsc @@ -24,7 +24,7 @@ SUPPORTED_ARCHITECTURES = X64|IA32 BUILD_TARGETS = RELEASE|DEBUG SKUID_IDENTIFIER = DEFAULT - FLASH_DEFINITION = Clover/Clover.fdf + FLASH_DEFINITION = Clover.fdf !ifndef OPENSSL_VERSION DEFINE OPENSSL_VERSION = 1.0.1e @@ -39,150 +39,150 @@ # # Entry point # - PeimEntryPoint|Clover/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - DxeCoreEntryPoint|Clover/MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - UefiDriverEntryPoint|Clover/MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf - UefiApplicationEntryPoint|Clover/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf # # Basic # - BaseLib|Clover/MdePkg/Library/BaseLib/BaseLib.inf - SynchronizationLib|Clover/MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf - BaseMemoryLib|Clover/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - #BaseMemoryLib|Clover/MdePkg/Library/UefiMemoryLib/UefiMemoryLib.inf - #BaseMemoryLib|Clover/MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf - PrintLib|Clover/MdePkg/Library/BasePrintLib/BasePrintLib.inf - CpuLib|Clover/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf - IoLib|Clover/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf - PciLib|Clover/MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - PciCf8Lib|Clover/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf - PciExpressLib|Clover/MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf - #PciLib|Clover/MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf - #PciExpressLib|Clover/MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf - CacheMaintenanceLib|Clover/MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf - #PeCoffLib|Clover/MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - PeCoffLib|Clover/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf - PeCoffExtraActionLib|Clover/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf - PeCoffGetEntryPointLib|Clover/MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - CustomizedDisplayLib|Clover/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + #BaseMemoryLib|MdePkg/Library/UefiMemoryLib/UefiMemoryLib.inf + #BaseMemoryLib|MdePkg/Library/BaseMemoryLibSse2/BaseMemoryLibSse2.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf + PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf + PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf + #PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf + #PciExpressLib|MdePkg/Library/DxeRuntimePciExpressLib/DxeRuntimePciExpressLib.inf + CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf + #PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PeCoffLib|Library/VBoxPeCoffLib/VBoxPeCoffLib.inf + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf # # UEFI & PI # - UefiBootServicesTableLib|Clover/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf - UefiRuntimeServicesTableLib|Clover/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf - UefiRuntimeLib|Clover/MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - UefiLib|Clover/MdePkg/Library/UefiLib/UefiLib.inf - #UefiHiiServicesLib|Clover/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - UefiHiiServicesLib|Clover/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - HiiLib|Clover/MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - DevicePathLib|Clover/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiDecompressLib|Clover/MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf - DxeServicesLib|Clover/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - DxeServicesTableLib|Clover/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf - UefiBootManagerLib|Clover/MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + #UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf + UefiHiiServicesLib|Library/UefiHiiServicesLib/UefiHiiServicesLib.inf + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf #EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf #EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf #EblCmdLib|EmbeddedPkg/Library/EblCmdLibNull/EblCmdLibNull.inf - FileHandleLib|Clover/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf - SortLib|Clover/MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - UefiCpuLib|Clover/CloverEFI/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf + UefiCpuLib|CloverEFI/UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf !ifdef ENABLE_SECURE_BOOT - OpensslLib|Clover/Library/OpensslLib/openssl-$(OPENSSL_VERSION)/OpensslLib.inf - IntrinsicLib|Clover/Library/IntrinsicLib/IntrinsicLib.inf + OpensslLib|Library/OpensslLib/openssl-$(OPENSSL_VERSION)/OpensslLib.inf + IntrinsicLib|Library/IntrinsicLib/IntrinsicLib.inf !else - OpensslLib|Clover/Library/OpensslLib/OpensslLibNull.inf + OpensslLib|Library/OpensslLib/OpensslLibNull.inf !endif # # Generic Modules # - UefiUsbLib|Clover/MdePkg/Library/UefiUsbLib/UefiUsbLib.inf - UefiScsiLib|Clover/MdePkg/Library/UefiScsiLib/UefiScsiLib.inf - OemHookStatusCodeLib|Clover/MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf + UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf #GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf - GenericBdsLib|Clover/Library/GenericBdsLib/GenericBdsLib.inf - SecurityManagementLib|Clover/MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf - CapsuleLib|Clover/MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf - #PeCoffExtraActionLib|Clover/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf - NetLib|Clover/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf + GenericBdsLib|Library/GenericBdsLib/GenericBdsLib.inf + SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf + #PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf # # Platform # #PlatformBdsLib|DuetPkg/Library/DuetBdsLib/PlatformBds.inf - PlatformBdsLib|Clover/Library/OsxBdsPlatformLib/PlatformBds.inf + PlatformBdsLib|Library/OsxBdsPlatformLib/PlatformBds.inf #TimerLib|DuetPkg/Library/DuetTimerLib/DuetTimerLib.inf - TimerLib|Clover/Library/DuetTimerLib/DuetTimerLib.inf + TimerLib|Library/DuetTimerLib/DuetTimerLib.inf # # Misc # - PerformanceLib|Clover/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf - DebugAgentLib|Clover/MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf - PcdLib|Clover/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf -# PcdLib|Clover/MdePkg/Library/DxePcdLib/DxePcdLib.inf - PeiServicesLib|Clover/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - MemoryAllocationLib|Clover/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf - HobLib|Clover/MdePkg/Library/DxeHobLib/DxeHobLib.inf - LockBoxLib|Clover/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf - CpuExceptionHandlerLib|Clover/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf - SmbusLib|Clover/MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf - S3BootScriptLib|Clover/MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf - ExtractGuidedSectionLib|Clover/MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf - PlatformHookLib|Clover/MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf + PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf +# PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf + CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf + SmbusLib|MdePkg/Library/DxeSmbusLib/DxeSmbusLib.inf + S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf + ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf + PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf #SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf - SerialPortLib|Clover/MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf - MtrrLib|Clover/CloverEFI/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - IoApicLib|Clover/PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf - LocalApicLib|Clover/CloverEFI/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf - #LocalApicLib|Clover/CloverEFI/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf + MtrrLib|CloverEFI/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf + IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf + LocalApicLib|CloverEFI/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf + #LocalApicLib|CloverEFI/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf # # To save size, use NULL library for DebugLib and ReportStatusCodeLib. # If need status code output, do library instance overriden as below DxeMain.inf does # - DebugLib|Clover/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - DebugPrintErrorLevelLib|Clover/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf - ReportStatusCodeLib|Clover/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf - TpmMeasurementLib|Clover/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf - AuthVariableLib|Clover/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf - VarCheckLib|Clover/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf + AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf # # Our libs # - MemLogLib|Clover/Library/MemLogLibDefault/MemLogLibDefault.inf - VideoBiosPatchLib|Clover/Library/VideoBiosPatchLib/VideoBiosPatchLib.inf - WaveLib|Clover/Library/WaveLib/WaveLib.inf + MemLogLib|Library/MemLogLibDefault/MemLogLibDefault.inf + VideoBiosPatchLib|Library/VideoBiosPatchLib/VideoBiosPatchLib.inf + WaveLib|Library/WaveLib/WaveLib.inf - ShellLib|Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf !ifndef NO_CLOVER_SHELL #Shell - ShellCommandLib|Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - ShellCEntryLib|Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - HandleParsingLib|Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf - BcfgCommandLib|Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf !endif [LibraryClasses.common.DXE_CORE] - HobLib|Clover/MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf - BaseMemoryLib|Clover/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - MemoryAllocationLib|Clover/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf + HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf [LibraryClasses.common.PEIM] - MemoryAllocationLib|Clover/MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf - HobLib|Clover/MdePkg/Library/PeiHobLib/PeiHobLib.inf - LockBoxLib|Clover/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.inf [LibraryClasses.IA32.PEIM, LibraryClasses.X64.PEIM] - PeiServicesTablePointerLib|Clover/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf [LibraryClasses.common.DXE_DRIVER] - MemoryAllocationLib|Clover/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf [LibraryClasses.common.DXE_SMM_DRIVER] - SmmServicesTableLib|Clover/MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf - MemoryAllocationLib|Clover/MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf + SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf + MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf @@ -208,18 +208,18 @@ #DuetPkg/BootSector/BootSector.inf #DuetPkg/DxeIpl/DxeIpl.inf { - Clover/CloverEFI/OsxDxeIpl/DxeIpl.inf { + CloverEFI/OsxDxeIpl/DxeIpl.inf { # # If no following overriden for ReportStatusCodeLib library class, # All other module can *not* output debug information even they are use not NULL library # instance for DebugLib and ReportStatusCodeLib # - #ReportStatusCodeLib|Clover/MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf - ReportStatusCodeLib|Clover/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf + #ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf } - #Clover/MdeModulePkg/Core/Dxe/DxeMain.inf { - Clover/CloverEFI/OsxDxeCore/DxeMain.inf { + #MdeModulePkg/Core/Dxe/DxeMain.inf { + CloverEFI/OsxDxeCore/DxeMain.inf { # # Enable debug output for DxeCore module, this is a sample for how to enable debug output # for a module. If need turn on debug output for other module, please copy following overriden @@ -232,267 +232,267 @@ gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042 #0x80000042 - BaseMemoryLib|Clover/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf - MemoryAllocationLib|Clover/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf # DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf # ReportStatusCodeLib|DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/DxeCoreReportStatusCodeLibFromHob.inf - DebugLib|Clover/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - ReportStatusCodeLib|Clover/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf - PeCoffLib|Clover/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf + PeCoffLib|Library/VBoxPeCoffLib/VBoxPeCoffLib.inf } - Clover/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - Clover/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf - Clover/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - Clover/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf + MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf #DuetPkg/FSVariable/FSVariable.inf !ifndef REAL_NVRAM !ifdef HAVE_LEGACY_EMURUNTIMEDXE - Clover/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf !else - Clover/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE - AuthVariableLib|Clover/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf - TpmMeasurementLib|Clover/MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf - VarCheckLib|Clover/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf + AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf } !endif !else - Clover/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf - Clover/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { - NULL|Clover/MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf } !endif - Clover/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - Clover/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf - Clover/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf - Clover/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf - Clover/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf { + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf + MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf + MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf + MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf { - PcdLib|Clover/MdePkg/Library/DxePcdLib/DxePcdLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0 } - Clover/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf - Clover/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf - Clover/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf - #Clover/MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf - Clover/CloverEFI/GraphicsConsoleDxe/GraphicsConsoleDxe.inf - #Clover/MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - Clover/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf - Clover/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf + MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf + MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf + MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf + #MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf + CloverEFI/GraphicsConsoleDxe/GraphicsConsoleDxe.inf + #MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf + MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf #DuetPkg/SmbiosGenDxe/SmbiosGen.inf - #Clover/OsxSmbiosDxe/SmbiosDxe.inf - Clover/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf + #OsxSmbiosDxe/SmbiosDxe.inf + CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf #DuetPkg/EfiLdr/EfiLdr.inf { - Clover/CloverEFI/OsxEfiLdr/EfiLdr.inf { + CloverEFI/OsxEfiLdr/EfiLdr.inf { - DebugLib|Clover/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - BaseMemoryLib|Clover/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf #NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf - NULL|Clover/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf + NULL|Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf } #IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf { - Clover/CloverEFI/OsxBdsDxe/BdsDxe.inf { + CloverEFI/OsxBdsDxe/BdsDxe.inf { - PcdLib|Clover/MdePkg/Library/DxePcdLib/DxePcdLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf } - Clover/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf - Clover/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + MdeModulePkg/Universal/EbcDxe/EbcDxe.inf + CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf #UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - #Clover/UefiCpuPkg/CpuDxe/CpuDxe.inf #UefiCpuPkg/CpuDxe/CpuDxe.inf - Clover/CloverEFI/CpuDxe/Cpu.inf - Clover/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf { + #UefiCpuPkg/CpuDxe/CpuDxe.inf + CloverEFI/CpuDxe/Cpu.inf + PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf { gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeMask|0xFFFC } #DuetPkg/AcpiResetDxe/Reset.inf - Clover/CloverEFI/AcpiReset/Reset.inf + CloverEFI/AcpiReset/Reset.inf #DuetPkg/LegacyMetronome/Metronome.inf - Clover/MdeModulePkg/Universal/Metronome/Metronome.inf + MdeModulePkg/Universal/Metronome/Metronome.inf # EdkCompatibilityPkg/Compatibility/MpServicesOnFrameworkMpServicesThunk/MpServicesOnFrameworkMpServicesThunk.inf #Chipset #PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf - Clover/CloverEFI/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf - Clover/PcAtChipsetPkg/8254TimerDxe/8254Timer.inf + CloverEFI/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf + PcAtChipsetPkg/8254TimerDxe/8254Timer.inf #PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf #PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf #DuetPkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf - Clover/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf + CloverEFI/PciRootBridgeDxe/PciRootBridge.inf #DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf - Clover/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf - #Clover/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf - #Clover/PciBusDxe/PciBusDxe.inf - Clover/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf + CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf + #MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf + #PciBusDxe/PciBusDxe.inf + MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf #DataHub - #Clover/VBoxAppleSim/VBoxAppleSim.inf + #VBoxAppleSim/VBoxAppleSim.inf #IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe.inf - Clover/Protocols/DataHubDxe/DataHubDxe.inf - #Clover/Protocols/DataHubStdErrDxe/DataHubStdErrDxe.inf + Protocols/DataHubDxe/DataHubDxe.inf + #Protocols/DataHubStdErrDxe/DataHubStdErrDxe.inf # foreign file system support - Clover/Protocols/DriverOverride/DriverOverride.inf - Clover/FileSystems/VBoxFsDxe/VBoxHfs.inf - Clover/FileSystems/VBoxFsDxe/VBoxIso9660.inf - #Clover/FileSystems/VBoxFsDxe/VBoxFsDxe.inf - Clover/FileSystems/VBoxFsDxe/VBoxExt2.inf - Clover/FileSystems/VBoxFsDxe/VBoxExt4.inf - Clover/FileSystems/VBoxFsDxe/VBoxReiserFS.inf + Protocols/DriverOverride/DriverOverride.inf + FileSystems/VBoxFsDxe/VBoxHfs.inf + FileSystems/VBoxFsDxe/VBoxIso9660.inf + #FileSystems/VBoxFsDxe/VBoxFsDxe.inf + FileSystems/VBoxFsDxe/VBoxExt2.inf + FileSystems/VBoxFsDxe/VBoxExt4.inf + FileSystems/VBoxFsDxe/VBoxReiserFS.inf #EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf - #Clover/OsxMmcDxe/MmcDxe.inf - Clover/FileSystems/FatPkg/EnhancedFatDxe/Fat.inf - Clover/FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf + #OsxMmcDxe/MmcDxe.inf + FileSystems/FatPkg/EnhancedFatDxe/Fat.inf + FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf # FS from grub !ifndef NO_GRUB_DRIVERS - Clover/FileSystems/GrubFS/src/EXFAT.inf - Clover/FileSystems/GrubFS/src/HFSPLUS.inf - Clover/FileSystems/GrubFS/src/ISO9660.inf - Clover/FileSystems/GrubFS/src/NTFS.inf - Clover/FileSystems/GrubFS/src/UDF.inf - #Clover/FileSystems/GrubFS/src/ZFS.inf - #Clover/FileSystems/GrubFS/src/UFS.inf - #Clover/FileSystems/GrubFS/src/UFS2.inf - #Clover/FileSystems/GrubFS/src/XFS.inf + FileSystems/GrubFS/src/EXFAT.inf + FileSystems/GrubFS/src/HFSPLUS.inf + FileSystems/GrubFS/src/ISO9660.inf + FileSystems/GrubFS/src/NTFS.inf + FileSystems/GrubFS/src/UDF.inf + #FileSystems/GrubFS/src/ZFS.inf + #FileSystems/GrubFS/src/UFS.inf + #FileSystems/GrubFS/src/UFS2.inf + #FileSystems/GrubFS/src/XFS.inf !endif #Video #IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf - #Clover/VBoxVgaMiniPort/VgaMiniPortDxe.inf + #VBoxVgaMiniPort/VgaMiniPortDxe.inf #IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf - #Clover/VgaClassDxe/VgaClassDxe.inf - #Clover/IntelGmaDxe/Gop.inf + #VgaClassDxe/VgaClassDxe.inf + #IntelGmaDxe/Gop.inf #DuetPkg/BiosVideoThunkDxe/BiosVideo.inf - Clover/CloverEFI/BiosVideo/BiosVideo.inf - #Clover/BiosVideoAuto/BiosVideo.inf - Clover/LegacyBios/VideoDxe/VideoDxe.inf - #Clover/LegacyBios/VideoDxe/VideoDxe2.inf + CloverEFI/BiosVideo/BiosVideo.inf + #BiosVideoAuto/BiosVideo.inf + LegacyBios/VideoDxe/VideoDxe.inf + #LegacyBios/VideoDxe/VideoDxe2.inf # IDE/AHCI Support !ifdef USE_BIOS_BLOCKIO - Clover/LegacyBios/BlockIoDxe/BlockIoDxe.inf + LegacyBios/BlockIoDxe/BlockIoDxe.inf !else - #Clover/Trash/VBoxIdeControllerDxe/VBoxIdeControllerDxe.inf - #Clover/Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf + #Trash/VBoxIdeControllerDxe/VBoxIdeControllerDxe.inf + #Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf #DuetPkg/SataControllerDxe/SataControllerDxe.inf - Clover/Drivers/SataControllerDxe/SataControllerDxe.inf - #Clover/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf - Clover/Drivers/AtaAtapi/AtaAtapiPassThru.inf - #Clover/MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf - Clover/Drivers/AtaBus/AtaBusDxe.inf - #Clover/MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf - Clover/Drivers/DVDBus/ScsiBusDxe.inf - #Clover/MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf - Clover/Drivers/DVDDisk/ScsiDiskDxe.inf + Drivers/SataControllerDxe/SataControllerDxe.inf + #MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf + Drivers/AtaAtapi/AtaAtapiPassThru.inf + #MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf + Drivers/AtaBus/AtaBusDxe.inf + #MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf + Drivers/DVDBus/ScsiBusDxe.inf + #MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf + Drivers/DVDDisk/ScsiDiskDxe.inf #IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf !endif # Usb Support - Clover/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf - Clover/Drivers/OhciDxe/OhciDxe.inf - Clover/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf -# Clover/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf - Clover/Drivers/XhciDxe/XhciDxe.inf -# Clover/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf - Clover/Drivers/UsbBusDxe/UsbBusDxe.inf -# Clover/MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf - Clover/Drivers/UsbKbDxe/UsbKbDxe.inf - Clover/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - Clover/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf - #Clover/Drivers/UsbMouseDxe/UsbMouseDxe.inf + MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf + Drivers/OhciDxe/OhciDxe.inf + MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf +# MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf + Drivers/XhciDxe/XhciDxe.inf +# MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf + Drivers/UsbBusDxe/UsbBusDxe.inf +# MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf + Drivers/UsbKbDxe/UsbKbDxe.inf + MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf + #Drivers/UsbMouseDxe/UsbMouseDxe.inf # ISA Support - Clover/PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf - Clover/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf + PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf + Drivers/Isa/IsaBusDxe/IsaBusDxe.inf #IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf - Clover/Drivers/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf + Drivers/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf #IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf - Clover/Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointerDxe.inf + Drivers/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointerDxe.inf #IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf - Clover/Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf + Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf # ACPI Support - #Clover/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - Clover/CloverEFI/OsxAcpiTableDxe/AcpiTableDxe.inf - #Clover/MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf - #Clover/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf + #MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + CloverEFI/OsxAcpiTableDxe/AcpiTableDxe.inf + #MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf + #CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf - Clover/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf - Clover/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf { + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf { - PcdLib|Clover/MdePkg/Library/DxePcdLib/DxePcdLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf } - #Clover/MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf - Clover/Drivers/PartitionDxe/PartitionDxe.inf + #MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf + Drivers/PartitionDxe/PartitionDxe.inf #FD #IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf - #Clover/SaveResume/AcpiS3SaveDxe/AcpiS3SaveDxe.inf - #Clover/MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf - #Clover/MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf - #Clover/MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf - #Clover/SaveResume/BootScriptExecutorDxe/BootScriptExecutorDxe.inf - #Clover/CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf + #SaveResume/AcpiS3SaveDxe/AcpiS3SaveDxe.inf + #MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf + #MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf + #MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf + #SaveResume/BootScriptExecutorDxe/BootScriptExecutorDxe.inf + #CloverEFI/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf # Bios Thunk #IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf #IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf #IntelFrameworkModulePkg/Csm/BiosThunk/BlockIoDxe/BlockIoDxe.inf #IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf - Clover/CloverEFI/BiosKeyboard/KeyboardDxe.inf + CloverEFI/BiosKeyboard/KeyboardDxe.inf #IntelFrameworkModulePkg/Universal/LegacyRegionDxe/LegacyRegionDxe.inf - #Clover/MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2Dxe.inf - Clover/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf + #MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2Dxe.inf + LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf # Misc - Clover/FSInject/FSInject.inf - Clover/Protocols/MsgLog/MsgLog.inf - Clover/Protocols/SMCHelper/SMCHelper.inf - Clover/Protocols/FirmwareVolume/FirmwareVolume.inf - Clover/Protocols/AppleImageCodec/AppleImageCodec.inf - Clover/Protocols/AppleUITheme/AppleUITheme.inf - Clover/Protocols/HashServiceFix/HashServiceFix.inf - Clover/Protocols/AppleKeyAggregator/AppleKeyAggregator.inf - Clover/Protocols/AppleKeyFeeder/AppleKeyFeeder.inf + FSInject/FSInject.inf + Protocols/MsgLog/MsgLog.inf + Protocols/SMCHelper/SMCHelper.inf + Protocols/FirmwareVolume/FirmwareVolume.inf + Protocols/AppleImageCodec/AppleImageCodec.inf + Protocols/AppleUITheme/AppleUITheme.inf + Protocols/HashServiceFix/HashServiceFix.inf + Protocols/AppleKeyAggregator/AppleKeyAggregator.inf + Protocols/AppleKeyFeeder/AppleKeyFeeder.inf !ifdef DEBUG_ON_SERIAL_PORT - Clover/Protocols/DumpUefiCalls/DumpUefiCalls.inf { + Protocols/DumpUefiCalls/DumpUefiCalls.inf { gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x07 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF - DebugLib|Clover/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf - SerialPortLib|Clover/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf } !else - Clover/Protocols/DumpUefiCalls/DumpUefiCalls.inf { + Protocols/DumpUefiCalls/DumpUefiCalls.inf { - PeCoffLib|Clover/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf + PeCoffLib|Library/VBoxPeCoffLib/VBoxPeCoffLib.inf } !endif # Drivers for Aptio loading - should go to Clover's /EFI/drivers64UEFI dir - Clover/Protocols/OsxFatBinaryDrv/OsxFatBinaryDrv.inf + Protocols/OsxFatBinaryDrv/OsxFatBinaryDrv.inf # Drivers for Phoenix UEFI loading - should go to Clover's /EFI/drivers64UEFI dir - Clover/Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf { + Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf { gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x3000 @@ -503,23 +503,23 @@ } # Driver Audio - Clover/Drivers/AudioDxe/AudioDxe.inf + Drivers/AudioDxe/AudioDxe.inf # # Sample Application # - #Clover/MdeModulePkg/Application/HelloWorld/HelloWorld.inf - #Clover/MdeModulePkg/Application/VariableInfo/VariableInfo.inf - #Clover/Sample/Application/Sample.inf - #Clover/gptsync/gptsync.inf - Clover/bdmesg_efi/bdmesg.inf + #MdeModulePkg/Application/HelloWorld/HelloWorld.inf + #MdeModulePkg/Application/VariableInfo/VariableInfo.inf + #Sample/Application/Sample.inf + #gptsync/gptsync.inf + bdmesg_efi/bdmesg.inf !ifndef NO_CLOVER_SHELL - Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf - Clover/ShellPkg/Application/Shell/Shell.inf { + ShellPkg/Application/Shell/Shell.inf { gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE @@ -529,23 +529,23 @@ !endif #$(NO_SHELL_PROFILES) - PcdLib|Clover/MdePkg/Library/DxePcdLib/DxePcdLib.inf - PeCoffGetEntryPointLib|Clover/MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - UefiHiiServicesLib|Clover/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf !ifndef $(NO_SHELL_PROFILES) - NULL|Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf !ifdef $(INCLUDE_DP) - NULL|Clover/ShellPkg/Library/UefiDpLib/UefiDpLib.inf + NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf !endif #$(INCLUDE_DP) !ifdef $(INCLUDE_TFTP_COMMAND) - NULL|Clover/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf + NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf !endif #$(INCLUDE_TFTP_COMMAND) !endif #$(NO_SHELL_PROFILES) } @@ -553,7 +553,7 @@ !ifdef DEBUG_ON_SERIAL_PORT - Clover/rEFIt_UEFI/refit.inf { + rEFIt_UEFI/refit.inf { # # Enable debug output. # @@ -561,24 +561,24 @@ gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x07 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF - SerialPortLib|Clover/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf - DebugLib|Clover/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf - DebugPrintErrorLevelLib|Clover/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf } !else - Clover/rEFIt_UEFI/refit.inf { + rEFIt_UEFI/refit.inf { - BaseMemoryLib|Clover/MdePkg/Library/UefiMemoryLib/UefiMemoryLib.inf + BaseMemoryLib|MdePkg/Library/UefiMemoryLib/UefiMemoryLib.inf } !endif [Components.X64] - Clover/OsxAptioFixDrv/OsxAptioFixDrv.inf -# Clover/OsxAptioFixDrv/OsxAptioFix2Drv.inf - Clover/OsxAptioFixDrv/OsxAptioFix3Drv.inf - Clover/OsxLowMemFixDrv/OsxLowMemFixDrv.inf - #Clover/OsxAptioFixDrv/OsxAptioFixDrv.inf { + OsxAptioFixDrv/OsxAptioFixDrv.inf +# OsxAptioFixDrv/OsxAptioFix2Drv.inf + OsxAptioFixDrv/OsxAptioFix3Drv.inf + OsxLowMemFixDrv/OsxLowMemFixDrv.inf + #OsxAptioFixDrv/OsxAptioFixDrv.inf { # # Enable debug output. # @@ -586,9 +586,9 @@ # gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x07 # gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xFFFFFFFF # - # SerialPortLib|Clover/MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf - # DebugLib|Clover/MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf - # DebugPrintErrorLevelLib|Clover/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + # SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf + # DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf + # DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf #} ################################################################################################### diff --git a/Clover.fdf b/Clover.fdf index e23d4f1ab..febb5fdf8 100644 --- a/Clover.fdf +++ b/Clover.fdf @@ -62,145 +62,145 @@ READ_LOCK_STATUS = TRUE # } APRIORI DXE { - INF Clover/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - INF Clover/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf - INF Clover/Protocols/MsgLog/MsgLog.inf + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf + INF PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf + INF Protocols/MsgLog/MsgLog.inf } -INF Clover/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf -INF Clover/MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf -INF Clover/MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf -INF Clover/MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf +INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf +INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf +INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf +INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf #INF DuetPkg/FSVariable/FSVariable.inf !ifdef REAL_NVRAM - INF Clover/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf - INF Clover/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf !else !ifdef HAVE_LEGACY_EMURUNTIMEDXE - INF Clover/MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf !else - INF Clover/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf + INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf !endif !endif -INF Clover/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf -INF Clover/MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf -INF Clover/MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf -INF Clover/MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf -INF Clover/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf -INF Clover/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf -INF Clover/MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf -INF Clover/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf +INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf +INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf +INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf +INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf +INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf +INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf +INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf +INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf #INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf -INF Clover/CloverEFI/GraphicsConsoleDxe/GraphicsConsoleDxe.inf +INF CloverEFI/GraphicsConsoleDxe/GraphicsConsoleDxe.inf #INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf -INF Clover/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf +INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf #INF DuetPkg/SmbiosGenDxe/SmbiosGen.inf -#INF Clover/OsxSmbiosDxe/SmbiosDxe.inf -INF Clover/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf +#INF OsxSmbiosDxe/SmbiosDxe.inf +INF CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf #INF IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf -INF Clover/CloverEFI/OsxBdsDxe/BdsDxe.inf -INF Clover/MdeModulePkg/Universal/EbcDxe/EbcDxe.inf -INF Clover/MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf -INF Clover/CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf -#INF Clover/UefiCpuPkg/CpuDxe/CpuDxe.inf +INF CloverEFI/OsxBdsDxe/BdsDxe.inf +INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf +INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf +INF CloverEFI/UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf +#INF UefiCpuPkg/CpuDxe/CpuDxe.inf #INF IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIoDxe.inf -INF Clover/CloverEFI/CpuDxe/Cpu.inf +INF CloverEFI/CpuDxe/Cpu.inf !ifndef CLANG #INF UefiCpuPkg/CpuDxe/CpuDxe.inf !else -#INF RuleOverride=BINARY Clover/CpuDxeBin/CpuDxeBin.inf +#INF RuleOverride=BINARY CpuDxeBin/CpuDxeBin.inf !endif # DataHub -#INF Clover/VBoxAppleSim/VBoxAppleSim.inf -INF Clover/Protocols/DataHubDxe/DataHubDxe.inf -#INF Clover/Protocols/DataHubStdErrDxe/DataHubStdErrDxe.inf +#INF VBoxAppleSim/VBoxAppleSim.inf +INF Protocols/DataHubDxe/DataHubDxe.inf +#INF Protocols/DataHubStdErrDxe/DataHubStdErrDxe.inf #INF EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/PiSmbiosRecordOnDataHubSmbiosRecordThunk.inf # foreign file system support -INF Clover/Protocols/DriverOverride/DriverOverride.inf +INF Protocols/DriverOverride/DriverOverride.inf !ifndef NO_GRUB_DRIVERS_EMBEDDED !ifndef NO_GRUB_DRIVERS -INF Clover/FileSystems/GrubFS/src/EXFAT.inf -#INF Clover/FileSystems/GrubFS/src/NTFS.inf +INF FileSystems/GrubFS/src/EXFAT.inf +#INF FileSystems/GrubFS/src/NTFS.inf !endif !endif -#INF Clover/FileSystems/VBoxFsDxe/VBoxFsDxe.inf -#INF Clover/FileSystems/VBoxFsDxe/VBoxIso9660.inf -#INF Clover/FileSystems/VBoxFsDxe/VBoxExt2.inf -#INF Clover/FileSystems/VBoxFsDxe/VBoxExt4.inf -#INF Clover/FileSystems/VBoxFsDxe/VBoxReiserFS.inf +#INF FileSystems/VBoxFsDxe/VBoxFsDxe.inf +#INF FileSystems/VBoxFsDxe/VBoxIso9660.inf +#INF FileSystems/VBoxFsDxe/VBoxExt2.inf +#INF FileSystems/VBoxFsDxe/VBoxExt4.inf +#INF FileSystems/VBoxFsDxe/VBoxReiserFS.inf !if $(USE_APPLE_HFSPLUS_DRIVER) AND ( $(ARCH) == X64 ) -INF RuleOverride=BINARY Clover/FileSystems/HFSPlus/HFSPlus.inf +INF RuleOverride=BINARY FileSystems/HFSPlus/HFSPlus.inf !else -INF Clover/FileSystems/VBoxFsDxe/VBoxHfs.inf +INF FileSystems/VBoxFsDxe/VBoxHfs.inf !endif -INF Clover/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf +INF PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf #INF DuetPkg/AcpiResetDxe/Reset.inf -INF Clover/CloverEFI/AcpiReset/Reset.inf +INF CloverEFI/AcpiReset/Reset.inf #INF DuetPkg/LegacyMetronome/Metronome.inf -INF Clover/MdeModulePkg/Universal/Metronome/Metronome.inf -INF Clover/PcAtChipsetPkg/8254TimerDxe/8254Timer.inf +INF MdeModulePkg/Universal/Metronome/Metronome.inf +INF PcAtChipsetPkg/8254TimerDxe/8254Timer.inf #INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf #INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf -INF Clover/CloverEFI/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf +INF CloverEFI/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf #INF PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf #INF DuetPkg/PciRootBridgeNoEnumerationDxe/PciRootBridgeNoEnumeration.inf -INF Clover/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf +INF CloverEFI/PciRootBridgeDxe/PciRootBridge.inf #INF DuetPkg/PciBusNoEnumerationDxe/PciBusNoEnumeration.inf -INF Clover/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf +INF CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf #INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf -#INF Clover/CloverEFI/PciBusDxe/PciBusDxe.inf +#INF CloverEFI/PciBusDxe/PciBusDxe.inf # Video #INF IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf -#INF Clover/VBoxVgaMiniPort/VgaMiniPortDxe.inf +#INF VBoxVgaMiniPort/VgaMiniPortDxe.inf #INF IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf -#INF Clover/VgaClassDxe/VgaClassDxe.inf +#INF VgaClassDxe/VgaClassDxe.inf #INF DuetPkg/BiosVideoThunkDxe/BiosVideo.inf -INF Clover/CloverEFI/BiosVideo/BiosVideo.inf -#INF Clover/BiosVideoAuto/BiosVideo.inf -#INF Clover/IntelGmaDxe/Gop.inf -#INF Clover/LegacyBios/VideoDxe/VideoDxe.inf +INF CloverEFI/BiosVideo/BiosVideo.inf +#INF BiosVideoAuto/BiosVideo.inf +#INF IntelGmaDxe/Gop.inf +#INF LegacyBios/VideoDxe/VideoDxe.inf # BIOS CSM #INF IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf #INF IntelFrameworkModulePkg/Csm/BiosThunk/BlockIoDxe/BlockIoDxe.inf #INF IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf -INF Clover/CloverEFI/BiosKeyboard/KeyboardDxe.inf +INF CloverEFI/BiosKeyboard/KeyboardDxe.inf #INF IntelFrameworkModulePkg/Universal/LegacyRegionDxe/LegacyRegionDxe.inf #INF MdeModulePkg/Universal/LegacyRegion2Dxe/LegacyRegion2Dxe.inf -#INF Clover/LegacyBios/RegionDxe/LegacyRegion2Dxe.inf -INF Clover/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf +#INF LegacyBios/RegionDxe/LegacyRegion2Dxe.inf +INF LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf #INF IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf # IDE/AHCI Support !ifdef USE_BIOS_BLOCKIO - INF Clover/LegacyBios/BlockIoDxe/BlockIoDxe.inf + INF LegacyBios/BlockIoDxe/BlockIoDxe.inf !ifdef DISABLE_USB_CONTROLLERS_WHEN_BLOCKIO DEFINE DISABLE_USB_CONTROLLERS = 1 !endif !else !ifdef USE_ION - INF RuleOverride=BINARY Clover/ION/ION.inf + INF RuleOverride=BINARY ION/ION.inf !else - #INF Clover/VBoxIdeControllerDxe/VBoxIdeControllerDxe.inf - #INF Clover/VBoxIdeBusDxe/VBoxIdeBusDxe.inf + #INF VBoxIdeControllerDxe/VBoxIdeControllerDxe.inf + #INF VBoxIdeBusDxe/VBoxIdeBusDxe.inf #INF DuetPkg/SataControllerDxe/SataControllerDxe.inf - INF Clover/Drivers/SataControllerDxe/SataControllerDxe.inf + INF Drivers/SataControllerDxe/SataControllerDxe.inf #INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf - INF Clover/Drivers/AtaAtapi/AtaAtapiPassThru.inf + INF Drivers/AtaAtapi/AtaAtapiPassThru.inf #INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf - INF Clover/Drivers/AtaBus/AtaBusDxe.inf + INF Drivers/AtaBus/AtaBusDxe.inf #INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf - INF Clover/Drivers/DVDBus/ScsiBusDxe.inf + INF Drivers/DVDBus/ScsiBusDxe.inf #INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf - INF Clover/Drivers/DVDDisk/ScsiDiskDxe.inf + INF Drivers/DVDDisk/ScsiDiskDxe.inf #INF IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf !endif !endif @@ -209,67 +209,67 @@ INF Clover/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf !ifndef DISABLE_USB_SUPPORT !ifndef DISABLE_USB_CONTROLLERS - INF Clover/MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf + INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf !ifndef DISABLE_USB_MASS_STORAGE - INF Clover/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf + INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf !endif !endif !ifdef ENABLE_USB_OHCI - INF Clover/Drivers/OhciDxe/OhciDxe.inf + INF Drivers/OhciDxe/OhciDxe.inf !endif !ifdef ENABLE_USB_XHCI - #INF Clover/MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf - INF Clover/Drivers/XhciDxe/XhciDxe.inf + #INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf + INF Drivers/XhciDxe/XhciDxe.inf !endif - #INF Clover/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf - INF Clover/Drivers/UsbBusDxe/UsbBusDxe.inf - #INF Clover/MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf - INF Clover/Drivers/UsbKbDxe/UsbKbDxe.inf - INF Clover/MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf + #INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf + INF Drivers/UsbBusDxe/UsbBusDxe.inf + #INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf + INF Drivers/UsbKbDxe/UsbKbDxe.inf + INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf !ifndef DISABLE_USB_MASS_STORAGE - INF Clover/MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf !endif !endif # ISA Support -INF Clover/PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf -INF Clover/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf -#INF Clover/Drivers/Isa/IsaSerialDxe/IsaSerialDxe.inf -#INF Clover/Drivers/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf -#INF Clover/Drivers/Isa/IsaFloppyDxe/IsaFloppyDxe.inf +INF PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf +INF Drivers/Isa/IsaBusDxe/IsaBusDxe.inf +#INF Drivers/Isa/IsaSerialDxe/IsaSerialDxe.inf +#INF Drivers/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf +#INF Drivers/Isa/IsaFloppyDxe/IsaFloppyDxe.inf -INF Clover/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf -INF Clover/MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf +INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf +INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf #INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf -INF Clover/Drivers/PartitionDxe/PartitionDxe.inf +INF Drivers/PartitionDxe/PartitionDxe.inf # ACPI Support #INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF Clover/CloverEFI/OsxAcpiTableDxe/AcpiTableDxe.inf +INF CloverEFI/OsxAcpiTableDxe/AcpiTableDxe.inf #INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf -#INF Clover/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf +#INF CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf # FD #INF IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf -#INF Clover/SaveResume/AcpiS3SaveDxe/AcpiS3SaveDxe.inf +#INF SaveResume/AcpiS3SaveDxe/AcpiS3SaveDxe.inf #INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf #INF MdeModulePkg/Universal/Acpi/SmmS3SaveState/SmmS3SaveState.inf #INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf -#INF Clover/SaveResume/BootScriptExecutorDxe/BootScriptExecutorDxe.inf +#INF SaveResume/BootScriptExecutorDxe/BootScriptExecutorDxe.inf #INF UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf # Misc -INF Clover/Protocols/MsgLog/MsgLog.inf +INF Protocols/MsgLog/MsgLog.inf # Binary INF file to support toggle among different CPU architectures. #INF RuleOverride=BINARY FatBinPkg/EnhancedFatDxe/Fat.inf -INF Clover/FileSystems/FatPkg/EnhancedFatDxe/Fat.inf +INF FileSystems/FatPkg/EnhancedFatDxe/Fat.inf #FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) { -# SECTION RAW = Clover/Logo/Logo.bmp +# SECTION RAW = Logo/Logo.bmp # } [Rule.Common.SEC] diff --git a/CloverEFI/AcpiReset/Reset.inf b/CloverEFI/AcpiReset/Reset.inf index 3140099f6..376e28bf9 100644 --- a/CloverEFI/AcpiReset/Reset.inf +++ b/CloverEFI/AcpiReset/Reset.inf @@ -22,7 +22,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] DebugLib diff --git a/CloverEFI/BiosKeyboard/KeyboardDxe.inf b/CloverEFI/BiosKeyboard/KeyboardDxe.inf index 59d301c49..a7ebade74 100644 --- a/CloverEFI/BiosKeyboard/KeyboardDxe.inf +++ b/CloverEFI/BiosKeyboard/KeyboardDxe.inf @@ -46,7 +46,7 @@ [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/CloverEFI/BiosVideo/BiosVideo.inf b/CloverEFI/BiosVideo/BiosVideo.inf index 596b8f293..a39004a5b 100644 --- a/CloverEFI/BiosVideo/BiosVideo.inf +++ b/CloverEFI/BiosVideo/BiosVideo.inf @@ -26,7 +26,7 @@ IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec # DuetPkg/DuetPkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] UefiLib diff --git a/CloverEFI/CpuDxe/Cpu.inf b/CloverEFI/CpuDxe/Cpu.inf index e39e66efd..7bba235a2 100644 --- a/CloverEFI/CpuDxe/Cpu.inf +++ b/CloverEFI/CpuDxe/Cpu.inf @@ -26,7 +26,7 @@ ENTRY_POINT = InitializeCpu [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf index 613b1e2ff..06894f8f1 100644 --- a/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/CloverEFI/OsxAcpiPlatformDxe/AcpiPlatformDxe.inf @@ -30,7 +30,7 @@ AcpiPlatform.c [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/CloverEFI/OsxBdsDxe/BdsDxe.inf b/CloverEFI/OsxBdsDxe/BdsDxe.inf index 31bdc1147..48b767661 100644 --- a/CloverEFI/OsxBdsDxe/BdsDxe.inf +++ b/CloverEFI/OsxBdsDxe/BdsDxe.inf @@ -88,7 +88,7 @@ [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/CloverEFI/OsxDxeIpl/DxeIpl.inf b/CloverEFI/OsxDxeIpl/DxeIpl.inf index 4d4ef48aa..bc8b97b41 100644 --- a/CloverEFI/OsxDxeIpl/DxeIpl.inf +++ b/CloverEFI/OsxDxeIpl/DxeIpl.inf @@ -24,7 +24,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/CloverEFI/OsxEfiLdr/EfiLdr.inf b/CloverEFI/OsxEfiLdr/EfiLdr.inf index 76aa9cfc0..60a133c44 100644 --- a/CloverEFI/OsxEfiLdr/EfiLdr.inf +++ b/CloverEFI/OsxEfiLdr/EfiLdr.inf @@ -24,7 +24,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec # MdeModulePkg/MdeModulePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf b/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf index 90163f85b..9f1d54f18 100644 --- a/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf +++ b/CloverEFI/OsxPciBusNoEnumerationDxe/PciBusNoEnumeration.inf @@ -25,7 +25,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] DebugLib diff --git a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf index c7183212e..05a1a97ee 100644 --- a/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf +++ b/CloverEFI/OsxSmbiosGenDxe/SmbiosGen.inf @@ -28,7 +28,7 @@ ENTRY_POINT = SmbiosGenEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf b/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf index ce7c62837..c10b2475e 100644 --- a/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf +++ b/CloverEFI/PciRootBridgeDxe/PciRootBridge.inf @@ -27,7 +27,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/Drivers/AudioDxe/AudioDxe.inf b/Drivers/AudioDxe/AudioDxe.inf index 94485f9a7..638413c30 100644 --- a/Drivers/AudioDxe/AudioDxe.inf +++ b/Drivers/AudioDxe/AudioDxe.inf @@ -31,7 +31,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec [LibraryClasses] diff --git a/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf b/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf index be6dd43ea..558aa8385 100644 --- a/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf +++ b/Drivers/Isa/IsaBusDxe/IsaBusDxe.inf @@ -42,6 +42,7 @@ ComponentName.h [Packages] + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf b/Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf index bc9075707..56e77c18e 100644 --- a/Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf +++ b/Drivers/Isa/Ps2MouseDxe/Ps2MouseDxe.inf @@ -38,7 +38,7 @@ Ps2Mouse.c [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Drivers/PartitionDxe/PartitionDxe.inf b/Drivers/PartitionDxe/PartitionDxe.inf index 67618fd13..56850263f 100644 --- a/Drivers/PartitionDxe/PartitionDxe.inf +++ b/Drivers/PartitionDxe/PartitionDxe.inf @@ -51,7 +51,7 @@ Partition.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec diff --git a/Drivers/UsbBusDxe/UsbBusDxe.inf b/Drivers/UsbBusDxe/UsbBusDxe.inf index 70ea9b61f..9db8c004a 100644 --- a/Drivers/UsbBusDxe/UsbBusDxe.inf +++ b/Drivers/UsbBusDxe/UsbBusDxe.inf @@ -49,7 +49,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] diff --git a/Drivers/UsbKbDxe/UsbKbDxe.inf b/Drivers/UsbKbDxe/UsbKbDxe.inf index 3cf245fde..0ed8acd79 100644 --- a/Drivers/UsbKbDxe/UsbKbDxe.inf +++ b/Drivers/UsbKbDxe/UsbKbDxe.inf @@ -55,7 +55,7 @@ KeyBoard.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Drivers/UsbMouseDxe/UsbMouseDxe.inf b/Drivers/UsbMouseDxe/UsbMouseDxe.inf index 48d1ee6dd..4e86cc74f 100644 --- a/Drivers/UsbMouseDxe/UsbMouseDxe.inf +++ b/Drivers/UsbMouseDxe/UsbMouseDxe.inf @@ -49,7 +49,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] MemoryAllocationLib diff --git a/Drivers/XhciDxe/XhciDxe.inf b/Drivers/XhciDxe/XhciDxe.inf index cde4d2433..a68b287c1 100644 --- a/Drivers/XhciDxe/XhciDxe.inf +++ b/Drivers/XhciDxe/XhciDxe.inf @@ -50,7 +50,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] MemoryAllocationLib diff --git a/FSInject/FSInject.dec b/FSInject/FSInject.dec index b4512b78e..4123f9e01 100644 --- a/FSInject/FSInject.dec +++ b/FSInject/FSInject.dec @@ -11,7 +11,7 @@ PACKAGE_VERSION = 0.1 [Includes] - ../Include +# ../Include Include [Protocols] diff --git a/FSInject/FSInject.inf b/FSInject/FSInject.inf index 69502e7de..3406abbc4 100644 --- a/FSInject/FSInject.inf +++ b/FSInject/FSInject.inf @@ -23,7 +23,7 @@ ENTRY_POINT = FSInjectEntrypoint [Packages] - Clover/FSInject/FSInject.dec + FSInject/FSInject.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf index cda6aba0e..0613516a6 100644 --- a/FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf +++ b/FileSystems/ApfsDriverLoader/ApfsDriverLoader.inf @@ -31,7 +31,7 @@ EfiComponentName.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec # AppleSupportPkg/AppleSupportPkg.dec MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/FileSystems/GrubFS/src/AFFS.inf b/FileSystems/GrubFS/src/AFFS.inf index 10ae4974b..1c377fa35 100644 --- a/FileSystems/GrubFS/src/AFFS.inf +++ b/FileSystems/GrubFS/src/AFFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/AFS.inf b/FileSystems/GrubFS/src/AFS.inf index 3cd364388..ceab17eae 100644 --- a/FileSystems/GrubFS/src/AFS.inf +++ b/FileSystems/GrubFS/src/AFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/BFS.inf b/FileSystems/GrubFS/src/BFS.inf index 9620920c7..63631042c 100644 --- a/FileSystems/GrubFS/src/BFS.inf +++ b/FileSystems/GrubFS/src/BFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/BTRFS.inf b/FileSystems/GrubFS/src/BTRFS.inf index 10fa1f690..cfe577473 100644 --- a/FileSystems/GrubFS/src/BTRFS.inf +++ b/FileSystems/GrubFS/src/BTRFS.inf @@ -37,9 +37,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/CBFS.inf b/FileSystems/GrubFS/src/CBFS.inf index 79d999a2a..d90117b98 100644 --- a/FileSystems/GrubFS/src/CBFS.inf +++ b/FileSystems/GrubFS/src/CBFS.inf @@ -36,9 +36,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/CPIO.inf b/FileSystems/GrubFS/src/CPIO.inf index b3645312e..2d4d56008 100644 --- a/FileSystems/GrubFS/src/CPIO.inf +++ b/FileSystems/GrubFS/src/CPIO.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/CPIO_BE.inf b/FileSystems/GrubFS/src/CPIO_BE.inf index 14b765aa6..a97e62b7d 100644 --- a/FileSystems/GrubFS/src/CPIO_BE.inf +++ b/FileSystems/GrubFS/src/CPIO_BE.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/EXFAT.inf b/FileSystems/GrubFS/src/EXFAT.inf index 9dbd4d37e..5e5d50b83 100644 --- a/FileSystems/GrubFS/src/EXFAT.inf +++ b/FileSystems/GrubFS/src/EXFAT.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/EXT2.inf b/FileSystems/GrubFS/src/EXT2.inf index e39bc154e..4b87a5454 100644 --- a/FileSystems/GrubFS/src/EXT2.inf +++ b/FileSystems/GrubFS/src/EXT2.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/FAT.inf b/FileSystems/GrubFS/src/FAT.inf index 33307b9cd..823574f8c 100644 --- a/FileSystems/GrubFS/src/FAT.inf +++ b/FileSystems/GrubFS/src/FAT.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/HFS.inf b/FileSystems/GrubFS/src/HFS.inf index ba1419d66..37489e9d3 100644 --- a/FileSystems/GrubFS/src/HFS.inf +++ b/FileSystems/GrubFS/src/HFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/HFSPLUS.inf b/FileSystems/GrubFS/src/HFSPLUS.inf index 04469a3b5..85ae6553b 100644 --- a/FileSystems/GrubFS/src/HFSPLUS.inf +++ b/FileSystems/GrubFS/src/HFSPLUS.inf @@ -36,9 +36,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/ISO9660.inf b/FileSystems/GrubFS/src/ISO9660.inf index c2cc2ccd5..10fd350f6 100644 --- a/FileSystems/GrubFS/src/ISO9660.inf +++ b/FileSystems/GrubFS/src/ISO9660.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/JFS.inf b/FileSystems/GrubFS/src/JFS.inf index c1858196b..0ba16d4e1 100644 --- a/FileSystems/GrubFS/src/JFS.inf +++ b/FileSystems/GrubFS/src/JFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX.inf b/FileSystems/GrubFS/src/MINIX.inf index 99448dfaa..3d759c11a 100644 --- a/FileSystems/GrubFS/src/MINIX.inf +++ b/FileSystems/GrubFS/src/MINIX.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX2.inf b/FileSystems/GrubFS/src/MINIX2.inf index bfcc178fc..04041136f 100644 --- a/FileSystems/GrubFS/src/MINIX2.inf +++ b/FileSystems/GrubFS/src/MINIX2.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX2_BE.inf b/FileSystems/GrubFS/src/MINIX2_BE.inf index 0695c5032..ad24b8a36 100644 --- a/FileSystems/GrubFS/src/MINIX2_BE.inf +++ b/FileSystems/GrubFS/src/MINIX2_BE.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX3.inf b/FileSystems/GrubFS/src/MINIX3.inf index 2253ff72b..4e18f1233 100644 --- a/FileSystems/GrubFS/src/MINIX3.inf +++ b/FileSystems/GrubFS/src/MINIX3.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX3_BE.inf b/FileSystems/GrubFS/src/MINIX3_BE.inf index d0aac0dda..316e0ce4c 100644 --- a/FileSystems/GrubFS/src/MINIX3_BE.inf +++ b/FileSystems/GrubFS/src/MINIX3_BE.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/MINIX_BE.inf b/FileSystems/GrubFS/src/MINIX_BE.inf index 8fdf5bf6f..45cc478ec 100644 --- a/FileSystems/GrubFS/src/MINIX_BE.inf +++ b/FileSystems/GrubFS/src/MINIX_BE.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/NEWC.inf b/FileSystems/GrubFS/src/NEWC.inf index 7eb6a5355..ef4c579bf 100644 --- a/FileSystems/GrubFS/src/NEWC.inf +++ b/FileSystems/GrubFS/src/NEWC.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/NILFS2.inf b/FileSystems/GrubFS/src/NILFS2.inf index 466149fd5..b14c81e3b 100644 --- a/FileSystems/GrubFS/src/NILFS2.inf +++ b/FileSystems/GrubFS/src/NILFS2.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/NTFS.inf b/FileSystems/GrubFS/src/NTFS.inf index 27f9878db..333db7311 100644 --- a/FileSystems/GrubFS/src/NTFS.inf +++ b/FileSystems/GrubFS/src/NTFS.inf @@ -36,9 +36,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/ODC.inf b/FileSystems/GrubFS/src/ODC.inf index 812b0b437..e3e329153 100644 --- a/FileSystems/GrubFS/src/ODC.inf +++ b/FileSystems/GrubFS/src/ODC.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/PROC.inf b/FileSystems/GrubFS/src/PROC.inf index c8ffee2d0..f5cd73449 100644 --- a/FileSystems/GrubFS/src/PROC.inf +++ b/FileSystems/GrubFS/src/PROC.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/REISERFS.inf b/FileSystems/GrubFS/src/REISERFS.inf index 82b2f310c..392be0d97 100644 --- a/FileSystems/GrubFS/src/REISERFS.inf +++ b/FileSystems/GrubFS/src/REISERFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/ROMFS.inf b/FileSystems/GrubFS/src/ROMFS.inf index a47cdcf5f..3dde75e55 100644 --- a/FileSystems/GrubFS/src/ROMFS.inf +++ b/FileSystems/GrubFS/src/ROMFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/SFS.inf b/FileSystems/GrubFS/src/SFS.inf index 6cd305724..8f41060bd 100644 --- a/FileSystems/GrubFS/src/SFS.inf +++ b/FileSystems/GrubFS/src/SFS.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/SQUASH4.inf b/FileSystems/GrubFS/src/SQUASH4.inf index ca1dd7ec2..23d3a06f5 100644 --- a/FileSystems/GrubFS/src/SQUASH4.inf +++ b/FileSystems/GrubFS/src/SQUASH4.inf @@ -42,9 +42,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/TAR.inf b/FileSystems/GrubFS/src/TAR.inf index f848f19eb..e1d84d472 100644 --- a/FileSystems/GrubFS/src/TAR.inf +++ b/FileSystems/GrubFS/src/TAR.inf @@ -35,9 +35,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/UDF.inf b/FileSystems/GrubFS/src/UDF.inf index 6a98a8b5c..e7187da5e 100644 --- a/FileSystems/GrubFS/src/UDF.inf +++ b/FileSystems/GrubFS/src/UDF.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/UFS.inf b/FileSystems/GrubFS/src/UFS.inf index f587f4422..3ae40a531 100644 --- a/FileSystems/GrubFS/src/UFS.inf +++ b/FileSystems/GrubFS/src/UFS.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/UFS2.inf b/FileSystems/GrubFS/src/UFS2.inf index 5d05e74e7..30852b9ab 100644 --- a/FileSystems/GrubFS/src/UFS2.inf +++ b/FileSystems/GrubFS/src/UFS2.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/UFS_BE.inf b/FileSystems/GrubFS/src/UFS_BE.inf index d32d5d07d..104e67fe6 100644 --- a/FileSystems/GrubFS/src/UFS_BE.inf +++ b/FileSystems/GrubFS/src/UFS_BE.inf @@ -33,9 +33,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/XFS.inf b/FileSystems/GrubFS/src/XFS.inf index 7f36a3e96..eafcb173d 100644 --- a/FileSystems/GrubFS/src/XFS.inf +++ b/FileSystems/GrubFS/src/XFS.inf @@ -34,9 +34,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec [LibraryClasses] diff --git a/FileSystems/GrubFS/src/ZFS.inf b/FileSystems/GrubFS/src/ZFS.inf index 0edaa1205..436d5bb42 100644 --- a/FileSystems/GrubFS/src/ZFS.inf +++ b/FileSystems/GrubFS/src/ZFS.inf @@ -46,9 +46,9 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec Clover/FileSystems/GrubFS/efifs.dec diff --git a/FileSystems/VBoxFsDxe/VBoxExt2.inf b/FileSystems/VBoxFsDxe/VBoxExt2.inf index eef8c3ee1..924684876 100644 --- a/FileSystems/VBoxFsDxe/VBoxExt2.inf +++ b/FileSystems/VBoxFsDxe/VBoxExt2.inf @@ -42,7 +42,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec # VBoxPkg/VBoxPkg.dec [LibraryClasses] diff --git a/FileSystems/VBoxFsDxe/VBoxExt4.inf b/FileSystems/VBoxFsDxe/VBoxExt4.inf index 3549d66f2..e80283c27 100644 --- a/FileSystems/VBoxFsDxe/VBoxExt4.inf +++ b/FileSystems/VBoxFsDxe/VBoxExt4.inf @@ -42,7 +42,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec # VBoxPkg/VBoxPkg.dec [LibraryClasses] diff --git a/FileSystems/VBoxFsDxe/VBoxHfs.inf b/FileSystems/VBoxFsDxe/VBoxHfs.inf index 8a1736389..497662be7 100644 --- a/FileSystems/VBoxFsDxe/VBoxHfs.inf +++ b/FileSystems/VBoxFsDxe/VBoxHfs.inf @@ -44,7 +44,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec # VBoxPkg/VBoxPkg.dec [LibraryClasses] diff --git a/FileSystems/VBoxFsDxe/VBoxIso9660.inf b/FileSystems/VBoxFsDxe/VBoxIso9660.inf index d36e657bb..8e8f34369 100644 --- a/FileSystems/VBoxFsDxe/VBoxIso9660.inf +++ b/FileSystems/VBoxFsDxe/VBoxIso9660.inf @@ -39,7 +39,7 @@ VBoxFswParam.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec # VBoxPkg/VBoxPkg.dec diff --git a/FileSystems/VBoxFsDxe/VBoxReiserFS.inf b/FileSystems/VBoxFsDxe/VBoxReiserFS.inf index aa6129a0b..c503b7896 100644 --- a/FileSystems/VBoxFsDxe/VBoxReiserFS.inf +++ b/FileSystems/VBoxFsDxe/VBoxReiserFS.inf @@ -44,7 +44,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec # VBoxPkg/VBoxPkg.dec [LibraryClasses] diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec new file mode 100644 index 000000000..532724217 --- /dev/null +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec @@ -0,0 +1,251 @@ +## @file +# Intel Framework Module Package. +# +# This package contains the definitions and module implementation +# which follows Intel EFI Framework Specification. +# +# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010005 + PACKAGE_NAME = IntelFrameworkModulePkg + PACKAGE_UNI_FILE = IntelFrameworkModulePkg.uni + PACKAGE_GUID = 88894582-7553-4822-B484-624E24B6DECF + PACKAGE_VERSION = 0.96 + +[Includes] + Include # Root include for the package + +[LibraryClasses] + ## @libraryclass Platform BDS library definition about platform specific behavior. + PlatformBdsLib|Include/Library/PlatformBdsLib.h + + ## @libraryclass Generic BDS library definition, include the data structure and function. + GenericBdsLib|Include/Library/GenericBdsLib.h + +[Guids] + ## IntelFrameworkModule package token space guid + # Include/Guid/IntelFrameworkModulePkgTokenSpace.h + gEfiIntelFrameworkModulePkgTokenSpaceGuid = { 0xD3705011, 0xBC19, 0x4af7, { 0xBE, 0x16, 0xF6, 0x80, 0x30, 0x37, 0x8C, 0x15 }} + + ## GUID identifies Data Hub records logged by Status Code Runtime Protocol. + # Include/Guid/DataHubStatusCodeRecord.h + gEfiDataHubStatusCodeRecordGuid = { 0xD083E94C, 0x6560, 0x42E4, { 0xB6, 0xD4, 0x2D, 0xF7, 0x5A, 0xDF, 0x6A, 0x2A }} + + ## GUID indicates the tiano custom compress/decompress algorithm. + # Include/Guid/TianoDecompress.h + gTianoCustomDecompressGuid = { 0xA31280AD, 0x481E, 0x41B6, { 0x95, 0xE8, 0x12, 0x7F, 0x4C, 0x98, 0x47, 0x79 }} + + ## Include/Guid/AcpiVariable.h + gEfiAcpiVariableCompatiblityGuid = { 0xc020489e, 0x6db2, 0x4ef2, { 0x9a, 0xa5, 0xca, 0x6, 0xfc, 0x11, 0xd3, 0x6a }} + + ## Include/Guid/LegacyBios.h + gEfiLegacyBiosGuid = { 0x2E3044AC, 0x879F, 0x490F, { 0x97, 0x60, 0xBB, 0xDF, 0xAF, 0x69, 0x5F, 0x50 }} + + ## Include/Guid/LegacyDevOrder.h + gEfiLegacyDevOrderVariableGuid = { 0xa56074db, 0x65fe, 0x45f7, {0xbd, 0x21, 0x2d, 0x2b, 0xdd, 0x8e, 0x96, 0x52 }} + + ## Include/Guid/CapsuleDataFile.h + gEfiUpdateDataFileGuid = { 0x283fa2ee, 0x532c, 0x484d, { 0x93, 0x83, 0x9f, 0x93, 0xb3, 0x6f, 0xb, 0x7e }} + + ## Include/Guid/BlockIoVendor.h + gBlockIoVendorGuid = { 0xcf31fac5, 0xc24e, 0x11d2, {0x85, 0xf3, 0x0, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b }} + + ## Include/Guid/BdsHii.h + gFrontPageFormSetGuid = { 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe }} + gBootManagerFormSetGuid = { 0x847bc3fe, 0xb974, 0x446d, {0x94, 0x49, 0x5a, 0xd5, 0x41, 0x2e, 0x99, 0x3b }} + gDeviceManagerFormSetGuid = { 0x3ebfa8e6, 0x511d, 0x4b5b, {0xa9, 0x5f, 0xfb, 0x38, 0x26, 0xf, 0x1c, 0x27 }} + gDriverHealthFormSetGuid = { 0xf76e0a70, 0xb5ed, 0x4c38, {0xac, 0x9a, 0xe5, 0xf5, 0x4b, 0xf1, 0x6e, 0x34 }} + gBootMaintFormSetGuid = { 0x642237c7, 0x35d4, 0x472d, {0x83, 0x65, 0x12, 0xe0, 0xcc, 0xf2, 0x7a, 0x22 }} + gFileExploreFormSetGuid = { 0x1f2d63e1, 0xfebd, 0x4dc7, {0x9c, 0xc5, 0xba, 0x2b, 0x1c, 0xef, 0x9c, 0x5b }} + + ## Include/Guid/BdsLibHii.h + gBdsLibStringPackageGuid = { 0x3b4d9b23, 0x95ac, 0x44f6, {0x9f, 0xcd, 0xe, 0x95, 0x94, 0x58, 0x6c, 0x72 }} + + ## Include/Guid/LastEnumLang.h + gLastEnumLangGuid = { 0xe8c545b, 0xa2ee, 0x470d, {0x8e, 0x26, 0xbd, 0xa1, 0xa1, 0x3c, 0xa, 0xa3 }} + + ## Include/Guid/HdBootVariable.h + gHdBootDevicePathVariablGuid = { 0xfab7e9e1, 0x39dd, 0x4f2b, {0x84, 0x8, 0xe2, 0xe, 0x90, 0x6c, 0xb6, 0xde }} + +[Protocols] + ## Vga Mini port binding for a VGA controller + # Include/Protocol/VgaMiniPort.h + gEfiVgaMiniPortProtocolGuid = { 0xc7735a2f, 0x88f5, 0x4882, { 0xae, 0x63, 0xfa, 0xac, 0x8c, 0x8b, 0x86, 0xb3 }} + + ## ISA I/O Protocol is used to perform ISA device Io/Mem operations. + # Include/Protocol/IsaIo.h + gEfiIsaIoProtocolGuid = { 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }} + + ## ISA Acpi Protocol is used to operate and communicate with ISA device. + # Include/Protocol/IsaAcpi.h + gEfiIsaAcpiProtocolGuid = { 0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 }} + + ## OEM Badging Protocol defines the interface to get the OEM badging image with the dispaly attribute. + # Include/Protocol/OEMBadging.h + gEfiOEMBadgingProtocolGuid = { 0x170E13C0, 0xBF1B, 0x4218, { 0x87, 0x1D, 0x2A, 0xBD, 0xC6, 0xF8, 0x87, 0xBC }} + + ## Include/Protocol/ExitPmAuth.h + gExitPmAuthProtocolGuid = { 0xd088a413, 0xa70, 0x4217, { 0xba, 0x55, 0x9a, 0x3c, 0xb6, 0x5c, 0x41, 0xb3 }} + +# +# [Error.gEfiIntelFrameworkModulePkgTokenSpaceGuid] +# 0x80000001 | Invalid value provided. +# 0x80000002 | Reserved bits must be set to zero. +# + +[PcdsFeatureFlag] + ## Indicates if OEM device is enabled as StatusCode report device. + # It is only used in Framework StatusCode implementation.

+ # TRUE - Enable OEM device.
+ # FALSE - Disable OEM device.
+ # @Prompt Report StatusCode via OEM Device + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseOEM|FALSE|BOOLEAN|0x00010024 + + ## Indicates if StatusCode report is loged into DataHub.

+ # TRUE - Log StatusCode report into DataHub.
+ # FALSE - Does not log StatusCode report into DataHub.
+ # @Prompt Log StatusCode into DataHub + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdStatusCodeUseDataHub|FALSE|BOOLEAN|0x00010029 + + ## Indicates if Serial device uses half hand shake.

+ # TRUE - Serial device uses half hand shake.
+ # FALSE - Serial device doesn't use half hand shake.
+ # @Prompt Enable Serial device Half Hand Shake + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE|BOOLEAN|0x00010043 + + ## Indicates if Legacy support is needed for ACPI S3 Save.

+ # TRUE - Support Legacy OS with S3 boot.
+ # FALSE - Does not support Legacy OS with S3 boot.
+ # @Prompt Turn on Legacy Support in S3 Boot + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformCsmSupport|TRUE|BOOLEAN|0x00010044 + + ## Indicates if Framework Acpi Support protocol is installed.

+ # TRUE - Install Framework Acpi Support protocol.
+ # FALSE - Doesn't install Framework Acpi Support protocol.
+ # @Prompt Enable Framework Acpi Support + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdInstallAcpiSupportProtocol|TRUE|BOOLEAN|0x00010046 + + ## Indicates if only Boot logo is showed and all message output is disabled in BDS.

+ # TRUE - Only Boot Logo is showed in boot.
+ # FALSE - All messages and Boot Logo are showed in boot.
+ # @Prompt Enable Boot Logo only + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable|FALSE|BOOLEAN|0x00010048 + +[PcdsFixedAtBuild, PcdsPatchableInModule] + ## FFS filename to find the default BMP Logo file. + # @Prompt FFS Name of Boot Logo File + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile |{ 0x99, 0x8b, 0xB2, 0x7B, 0xBB, 0x61, 0xD5, 0x11, 0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }|VOID*|0x40000003 + + ## FFS filename to find the shell application. + # @Prompt FFS Name of Shell Application + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0xB7, 0xD6, 0x7A, 0xC5, 0x15, 0x05, 0xA8, 0x40, 0x9D, 0x21, 0x55, 0x16, 0x52, 0x85, 0x4E, 0x37 }|VOID*|0x40000004 + + ## ISA Bus features to support DMA, SlaveDMA and ISA Memory.

+ # BIT0 indicates if DMA is supported
+ # BIT1 indicates if only slave DMA is supported
+ # BIT2 indicates if ISA memory is supported
+ # Other BITs are reseved and must be zero. + # If more than one features are supported, the different BIT will be enabled at the same time. + # @Prompt ISA Bus Features + # @Expression 0x80000002 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures & 0xF8) == 0 + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSupportedFeatures|0x05|UINT8|0x00010040 + +[PcdsDynamic, PcdsDynamicEx] + ## Indicates if the machine has completed one boot cycle before. + # After the complete boot, BootState will be set to FALSE.

+ # TRUE - The complete boot cycle has not happened before.
+ # FALSE - The complete boot cycle has happened before.
+ # @Prompt Boot State Flag + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootState|TRUE|BOOLEAN|0x0001002f + +[PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule] + ## I/O Base address of floppy device controller. + # @Prompt I/O Base Address of Floppy Device Controller + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdFdcBaseAddress|0x3f0|UINT16|0x30000000 + + ## Indicates if BiosVideo driver will switch to 80x25 Text VGA Mode when exiting boot service.

+ # TRUE - Switch to Text VGA Mode.
+ # FALSE - Does not switch to Text VGA Mode.
+ # @Prompt Switch to Text VGA Mode on UEFI Boot + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoSetTextVgaModeEnable|FALSE|BOOLEAN|0x30000001 + + ## Indicates if BiosVideo driver will check for VESA BIOS Extension service support.

+ # TRUE - Check for VESA BIOS Extension service.
+ # FALSE - Does not check for VESA BIOS Extension service.
+ # @Prompt Enable Check for VESA BIOS Extension Service + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoCheckVbeEnable|TRUE|BOOLEAN|0x30000002 + + ## Indicates if BiosVideo driver will check for VGA service support. + # NOTE: If both PcdBiosVideoCheckVbeEnable and PcdBiosVideoCheckVgaEnable are set to FALSE, + # that means Graphics Output protocol will not be installed, the VGA miniport protocol will be installed instead.

+ # TRUE - Check for VGA service.
+ # FALSE - Does not check for VGA service.
+ # @Prompt Enable Check for VGA Service + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBiosVideoCheckVgaEnable|TRUE|BOOLEAN|0x30000003 + + ## Indicates if memory space for legacy region will be set as cacheable.

+ # TRUE - Set cachebility for legacy region.
+ # FALSE - Does not set cachebility for legacy region.
+ # @Prompt Enable Cachebility for Legacy Region + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLegacyBiosCacheLegacyRegion|TRUE|BOOLEAN|0x00000004 + + ## Specify memory size with bytes to reserve EBDA below 640K for OPROM. + # The value should be a multiple of 4KB. + # @Prompt Reserved EBDA Memory Size + # @Expression 0x80000001 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEbdaReservedMemorySize < 0xA0000) AND ((gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEbdaReservedMemorySize & 0x1000) == 0) + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEbdaReservedMemorySize|0x8000|UINT32|0x30000005 + + ## Specify memory base address for OPROM to find free memory. + # Some OPROMs do not use EBDA or PMM to allocate memory for its usage, + # instead they find the memory filled with zero from 0x20000. + # The value should be a multiple of 4KB. + # The range should be below the EBDA reserved range from + # (CONVENTIONAL_MEMORY_TOP - Reserved EBDA Memory Size) to CONVENTIONAL_MEMORY_TOP. + # @Prompt Reserved Memory Base Address for OPROM + # @Expression 0x80000001 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemoryBase >= 0x20000) AND ((gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemoryBase & 0x1000) == 0) + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemoryBase|0x60000|UINT32|0x3000000c + + ## Specify memory size with bytes for OPROM to find free memory. + # The value should be a multiple of 4KB. And the range should be below the EBDA reserved range from + # (CONVENTIONAL_MEMORY_TOP - Reserved EBDA Memory Size) to CONVENTIONAL_MEMORY_TOP. + # @Prompt Reserved Memory Size for OPROM + # @Expression 0x80000001 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemorySize < 0x80000) AND ((gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemorySize & 0x1000) == 0) + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdOpromReservedMemorySize|0x28000|UINT32|0x3000000d + + ## Specify memory size with page number for a pre-allocated reserved memory to be used + # by PEI in S3 phase. The default size 32K. When changing the value make sure the memory size + # is large enough to meet PEI requirement in the S3 phase. + # @Prompt Reserved S3 Boot ACPI Memory Size + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdS3AcpiReservedMemorySize|0x8000|UINT32|0x30000006 + + ## Specify the end of address below 1MB for the OPROM. + # The last shadowed OpROM should not exceed this address. + # @Prompt Top Address of Shadowed Legacy OpROM + # @Expression 0x80000001 | gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEndOpromShadowAddress < 0x100000 + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdEndOpromShadowAddress|0xdffff|UINT32|0x30000008 + + ## Specify the low PMM (Post Memory Manager) size with bytes below 1MB. + # The value should be a multiple of 4KB. + # @Prompt Low PMM (Post Memory Manager) Size + # @Expression 0x80000001 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLowPmmMemorySize < 0x100000) AND ((gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLowPmmMemorySize & 0x1000) == 0) + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLowPmmMemorySize|0x10000|UINT32|0x30000009 + + ## Specify the high PMM (Post Memory Manager) size with bytes above 1MB. + # The value should be a multiple of 4KB. + # @Prompt High PMM (Post Memory Manager) Size + # @Expression 0x80000001 | (gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize & 0x1000) == 0 + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdHighPmmMemorySize|0x400000|UINT32|0x3000000a + +[UserExtensions.TianoCore."ExtraFiles"] + IntelFrameworkModulePkgExtra.uni diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc new file mode 100644 index 000000000..a9a01aa64 --- /dev/null +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc @@ -0,0 +1,201 @@ +## @file +# Intel Framework Reference Module Package for All Architectures +# +# This file is used to build all modules in IntelFrameworkModulePkg. +# +#Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+#This program and the accompanying materials are licensed and made available under +#the terms and conditions of the BSD License that 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. +# +## + +################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + PLATFORM_NAME = IntelFrameworkModuleAll + PLATFORM_GUID = FFF87D9A-E5BB-4AFF-9ADE-8645492E8087 + PLATFORM_VERSION = 0.96 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/IntelFrameworkModuleAll + SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT + +################################################################################ +# +# SKU Identification section - list of all SKU IDs supported by this +# Platform. +# +################################################################################ +[SkuIds] + 0|DEFAULT # The entry: 0|DEFAULT is reserved and always required. + +[LibraryClasses] + CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf + GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf + PlatformBdsLib|IntelFrameworkModulePkg/Library/PlatformBdsLibNull/PlatformBdsLibNull.inf + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf + ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf + PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + PalLib|MdePkg/Library/BasePalLibNull/BasePalLibNull.inf + +[LibraryClasses.common.PEIM] + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + +[LibraryClasses.EBC.PEIM] + IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf + +[LibraryClasses.common.DXE_DRIVER] + LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxDxeLib.inf + +[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, LibraryClasses.common.UEFI_DRIVER] + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + +[LibraryClasses.common.DXE_RUNTIME_DRIVER] + DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf + +################################################################################ +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +################################################################################ +[PcdsFeatureFlag] + gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdIsaBusSerialUseHalfHandshake|FALSE + +[PcdsFixedAtBuild] + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06 + gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE0000000 + +[PcdsFixedAtBuild.IPF] + gEfiMdePkgTokenSpaceGuid.PcdIoBlockBaseAddressForIpf|0x0ffffc000000 + +################################################################################################### +# +# Components Section - list of the modules and components that will be processed by compilation +# tools and the EDK II tools to generate PE32/PE32+/Coff image files. +# +# Note: The EDK II DSC file is not used to specify how compiled binary images get placed +# into firmware volume images. This section is just a list of modules to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary files into firmware +# volume images, whose concept is beyond UEFI and is described in PI specification. +# Binary modules do not need to be listed in this section, as they should be +# specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi), +# Logo (Logo.bmp), and etc. +# There may also be modules listed in this section that are not required in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be +# generated for it, but the binary will not be put into any firmware volume. +# +################################################################################################### + +[Components] + IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf + IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf + IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf + IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf + IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf + IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/SmmRuntimeDxeReportStatusCodeLibFramework.inf + IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf + IntelFrameworkModulePkg/Library/PlatformBdsLibNull/PlatformBdsLibNull.inf + IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf + IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.inf + IntelFrameworkModulePkg/Library/LegacyBootManagerLib/LegacyBootManagerLib.inf + IntelFrameworkModulePkg/Library/LegacyBootMaintUiLib/LegacyBootMaintUiLib.inf + + IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBusDxe.inf + IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf + IntelFrameworkModulePkg/Bus/Isa/IsaIoDxe/IsaIoDxe.inf + IntelFrameworkModulePkg/Bus/Isa/IsaFloppyPei/IsaFloppyPei.inf + IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf + IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf + IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf + IntelFrameworkModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf + IntelFrameworkModulePkg/Bus/Isa/Ps2MouseAbsolutePointerDxe/Ps2MouseAbsolutePointerDxe.inf + IntelFrameworkModulePkg/Bus/Pci/VgaMiniPortDxe/VgaMiniPortDxe.inf + + IntelFrameworkModulePkg/Csm/BiosThunk/KeyboardDxe/KeyboardDxe.inf + IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/VideoDxe.inf + IntelFrameworkModulePkg/Csm/BiosThunk/BlockIoDxe/BlockIoDxe.inf + IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/Snp16Dxe.inf + + IntelFrameworkModulePkg/Universal/Acpi/AcpiSupportDxe/AcpiSupportDxe.inf + IntelFrameworkModulePkg/Universal/SectionExtractionDxe/SectionExtractionDxe.inf + IntelFrameworkModulePkg/Universal/DataHubDxe/DataHubDxe.inf + IntelFrameworkModulePkg/Universal/DataHubStdErrDxe/DataHubStdErrDxe.inf + IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf + IntelFrameworkModulePkg/Universal/Console/VgaClassDxe/VgaClassDxe.inf + IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf + IntelFrameworkModulePkg/Universal/LegacyRegionDxe/LegacyRegionDxe.inf + IntelFrameworkModulePkg/Universal/StatusCode/DatahubStatusCodeHandlerDxe/DatahubStatusCodeHandlerDxe.inf + IntelFrameworkModulePkg/Universal/FirmwareVolume/FwVolDxe/FwVolDxe.inf + IntelFrameworkModulePkg/Universal/FirmwareVolume/UpdateDriverDxe/UpdateDriverDxe.inf + +[Components.IA32,Components.X64] + IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf + IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaArchCustomDecompressLib.inf + +[Components.IA32,Components.X64,Components.IPF] + IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf + +[Components.IA32] + IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf + IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIoDxe.inf { + + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + } + +[Components.X64] + IntelFrameworkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCodeRuntimeDxe.inf + IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIoDxe.inf { + + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + } + +[Components.IPF] + IntelFrameworkModulePkg/Universal/CpuIoDxe/CpuIoDxe.inf { + + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + } + +[BuildOptions] + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.uni b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.uni new file mode 100644 index 000000000..f858537cd --- /dev/null +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.uni @@ -0,0 +1,169 @@ +// /** @file +// Intel Framework Module Package. +// +// This package contains the definitions and module implementation +// which follows Intel EFI Framework Specification. +// +// Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the BSD License +// which accompanies this distribution. The full text of the license may be found at +// http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + + +#string STR_PACKAGE_ABSTRACT #language en-US "Intel Framework Module Package" + +#string STR_PACKAGE_DESCRIPTION #language en-US "This package contains the definitions and module implementation that follow the Intel EFI Framework Specification." + + + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLogoFile_PROMPT #language en-US "FFS Name of Boot Logo File" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLogoFile_HELP #language en-US "FFS filename to find the default BMP Logo file." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdShellFile_PROMPT #language en-US "FFS Name of Shell Application" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdShellFile_HELP #language en-US "FFS filename to find the shell application." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdIsaBusSupportedFeatures_PROMPT #language en-US "ISA Bus Features" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdIsaBusSupportedFeatures_HELP #language en-US "ISA Bus features to support DMA, Slave DMA and ISA Memory.

\n" + "BIT0 indicates if DMA is supported
\n" + "BIT1 indicates if only slave DMA is supported
\n" + "BIT2 indicates if ISA memory is supported
\n" + "Other BITs are reserved and must be zero. If more than one features are supported, the different BIT will be enabled at the same time." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_ERR_80000002 #language en-US "Reserved bits must be set to zero." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdFdcBaseAddress_PROMPT #language en-US "I/O Base Address of Floppy Device Controller" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdFdcBaseAddress_HELP #language en-US "I/O Base address of floppy device controller." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoSetTextVgaModeEnable_PROMPT #language en-US "Switch to Text VGA Mode on UEFI Boot" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoSetTextVgaModeEnable_HELP #language en-US "Indicates if BiosVideo driver will switch to 80x25 Text VGA Mode when exiting boot service.

\n" + "TRUE - Switch to Text VGA Mode.
\n" + "FALSE - Does not switch to Text VGA Mode.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoCheckVbeEnable_PROMPT #language en-US "Enable Check for VESA BIOS Extension Service" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoCheckVbeEnable_HELP #language en-US "Indicates if BiosVideo driver will check for VESA BIOS Extension service support.

\n" + "TRUE - Check for VESA BIOS Extension service.
\n" + "FALSE - Does not check for VESA BIOS Extension service.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoCheckVgaEnable_PROMPT #language en-US "Enable Check for VGA Service" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBiosVideoCheckVgaEnable_HELP #language en-US "Indicates if BiosVideo driver will check for VGA service support. NOTE: If both PcdBiosVideoCheckVbeEnable and PcdBiosVideoCheckVgaEnable are set to FALSE, that means Graphics Output protocol will not be installed, the VGA miniport protocol will be installed instead.

\n" + "TRUE - Check for VGA service
\n" + "FALSE - Does not check for VGA service
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLegacyBiosCacheLegacyRegion_PROMPT #language en-US "Enable Cacheability for Legacy Region" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLegacyBiosCacheLegacyRegion_HELP #language en-US "Set memory space for legacy region cacheable?

\n" + "TRUE - Cacheable
\n" + "FALSE - Non cacheable
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdEbdaReservedMemorySize_PROMPT #language en-US "Reserved EBDA Memory Size" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdEbdaReservedMemorySize_HELP #language en-US "Specify memory size with bytes to reserve EBDA below 640K for OPROM. The value should be a multiple of 4KB." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_ERR_80000001 #language en-US "Invalid value provided." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdS3AcpiReservedMemorySize_PROMPT #language en-US "Reserved S3 Boot ACPI Memory Size" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdS3AcpiReservedMemorySize_HELP #language en-US "Specify memory size with page number for a pre-allocated reserved memory to be used by PEI in S3 phase. The default size 32K. When changing the value make sure the memory size is large enough to meet PEI requirement in the S3 phase." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdEndOpromShadowAddress_PROMPT #language en-US "Top Address of Shadowed Legacy OpROM" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdEndOpromShadowAddress_HELP #language en-US "Specify the end of address below 1MB for the OPROM. The last shadowed OpROM should not exceed this address." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLowPmmMemorySize_PROMPT #language en-US "Low PMM (Post Memory Manager) Size" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdLowPmmMemorySize_HELP #language en-US "Specify the low PMM (Post Memory Manager) size with bytes below 1MB. The value should be a multiple of 4KB." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdHighPmmMemorySize_PROMPT #language en-US "High PMM (Post Memory Manager) Size" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdHighPmmMemorySize_HELP #language en-US "Specify the high PMM (Post Memory Manager) size with bytes above 1MB. The value should be a multiple of 4KB." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdFastPS2Detection_PROMPT #language en-US "Enable fast PS2 detection" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdFastPS2Detection_HELP #language en-US "Indicates if to use the optimized timing for best PS2 detection performance.\n" + "Note this PCD could be set to TRUE for best boot performance and set to FALSE for best device compatibility.

\n" + "TRUE - Use the optimized timing for best PS2 detection performance.
\n" + "FALSE - Use the normal timing to detect PS2.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdStatusCodeUseOEM_PROMPT #language en-US "Report StatusCode via OEM Device" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdStatusCodeUseOEM_HELP #language en-US "Indicates if OEM device is enabled as StatusCode report device. It is only used in Framework StatusCode implementation.

\n" + "TRUE - Enable OEM device.
\n" + "FALSE - Disable OEM device.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdStatusCodeUseDataHub_PROMPT #language en-US "Log StatusCode into DataHub" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdStatusCodeUseDataHub_HELP #language en-US "Indicates if StatusCode report is loged into DataHub.

\n" + "TRUE - Log StatusCode report into DataHub.
\n" + "FALSE - Does not log StatusCode report into DataHub.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdIsaBusSerialUseHalfHandshake_PROMPT #language en-US "Enable Serial device Half Hand Shake" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdIsaBusSerialUseHalfHandshake_HELP #language en-US "Indicates if Serial device uses half hand shake.

\n" + "TRUE - Serial device uses half hand shake.
\n" + "FALSE - Serial device doesn't use half hand shake.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPlatformCsmSupport_PROMPT #language en-US "Turn on Legacy Support in S3 boot" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPlatformCsmSupport_HELP #language en-US "Enable Legacy OS support during ACPI S3 boot.

\n" + "TRUE - Support Legacy OS with S3 boot.
\n" + "FALSE - Does not support Legacy OS with S3 boot.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPs2KbdExtendedVerification_PROMPT #language en-US "Turn on PS2 Keyboard Extended Verification" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPs2KbdExtendedVerification_HELP #language en-US "Enable PS2 keyboard extended verification. Extended verification will increase boot time.

\n" + "TRUE - Enable extended verification.
\n" + "FALSE - Disable extended verification.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdInstallAcpiSupportProtocol_PROMPT #language en-US "Enable Framework ACPI Support" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdInstallAcpiSupportProtocol_HELP #language en-US "Indicates if Framework Acpi Support protocol is installed.

\n" + "TRUE - Install Framework Acpi Support protocol.
\n" + "FALSE - Doesn't install Framework Acpi Support protocol.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPs2MouseExtendedVerification_PROMPT #language en-US "Turn on PS2 Mouse Extended Verification" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdPs2MouseExtendedVerification_HELP #language en-US "Enable PS2 mouse extended verification. Extended verification will increase boot time.

\n" + "TRUE - Enable extended verification.
\n" + "FALSE - Disable extended verification.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBootlogoOnlyEnable_PROMPT #language en-US "Enable Boot Logo only" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBootlogoOnlyEnable_HELP #language en-US "Indicates if only Boot logo is showed and all message output is disabled in BDS.

\n" + "TRUE - Only Boot Logo is showed in boot.
\n" + "FALSE - All messages and Boot Logo are showed in boot.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBootState_PROMPT #language en-US "Boot State Flag" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdBootState_HELP #language en-US "Indicates if the machine has completed one boot cycle before. After the complete boot, BootState will be set to FALSE.

\n" + "TRUE - The complete boot cycle has not happened before.
\n" + "FALSE - The complete boot cycle has happened before.
" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdOpromReservedMemoryBase_PROMPT #language en-US "Reserved Memory Base Address for OPROM" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdOpromReservedMemoryBase_HELP #language en-US "Specify memory base address for OPROM to find free memory.\n" + "Some OPROMs do not use EBDA or PMM to allocate memory for its usage,\n" + "instead they find the memory filled with zero from 0x20000.\n" + "The value should be a multiple of 4KB.\n" + "The range should be below the EBDA reserved range from\n" + "(CONVENTIONAL_MEMORY_TOP - Reserved EBDA Memory Size) to CONVENTIONAL_MEMORY_TOP." + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdOpromReservedMemorySize_PROMPT #language en-US "Reserved Memory Size for OPROM" + +#string STR_gEfiIntelFrameworkModulePkgTokenSpaceGuid_PcdOpromReservedMemorySize_HELP #language en-US "Specify memory size with bytes for OPROM to find free memory.\n" + "The value should be a multiple of 4KB. And the range should be below the EBDA reserved range from\n" + "(CONVENTIONAL_MEMORY_TOP - Reserved EBDA Memory Size) to CONVENTIONAL_MEMORY_TOP." + diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkgExtra.uni b/IntelFrameworkModulePkg/IntelFrameworkModulePkgExtra.uni new file mode 100644 index 000000000..87e60d38d --- /dev/null +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkgExtra.uni @@ -0,0 +1,20 @@ +// /** @file +// IntelFrameworkModule Package Localized Strings and Content. +// +// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the BSD License +// which accompanies this distribution. The full text of the license may be found at +// http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + +#string STR_PROPERTIES_PACKAGE_NAME +#language en-US +"IntelFrameworkModule package" + + diff --git a/IntelFrameworkPkg/Include/Framework/BootScript.h b/IntelFrameworkPkg/Include/Framework/BootScript.h new file mode 100644 index 000000000..9a16d722e --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/BootScript.h @@ -0,0 +1,47 @@ +/** @file + This file contains the boot script defintions that are shared between the + Boot Script Executor PPI and the Boot Script Save Protocol. + +Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + +**/ + +#ifndef _BOOT_SCRIPT_H_ +#define _BOOT_SCRIPT_H_ + +#include +/// +/// The framework implementation defines follow opcode that are different from the PI specification: +/// Add FRAMEWORK_ prefix to avoid naming conflict. +/// +/// S3 Boot Script Table identifier. +/// +#define FRAMEWORK_EFI_ACPI_S3_RESUME_SCRIPT_TABLE 0x00 +/// +/// The opcode is used to add a record for memory reads of the memory location and continues when the +/// exit criteria is satisfied, or after a defined duration. +/// +#define FRAMEWORK_EFI_BOOT_SCRIPT_MEM_POLL_OPCODE 0x09 +/// +/// The opcode is used to add a record for dispatching specified arbitrary code into a specified +/// boot script table. +/// +#define FRAMEWORK_EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE 0x0D +/// +/// The opcode indicates the start of the boot script table. +/// +#define FRAMEWORK_EFI_BOOT_SCRIPT_TABLE_OPCODE 0xAA +/// +/// The opcode indicates the end of the boot script table. +/// +#define FRAMEWORK_EFI_BOOT_SCRIPT_TERMINATE_OPCODE 0xFF + + +#endif diff --git a/IntelFrameworkPkg/Include/Framework/DxeCis.h b/IntelFrameworkPkg/Include/Framework/DxeCis.h new file mode 100644 index 000000000..0f1b737ac --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/DxeCis.h @@ -0,0 +1,176 @@ +/** @file + Include file for definitions in the Intel Platform Innovation Framework for EFI + Driver Execution Environment Core Interface Specification (DXE CIS) Version 0.91. + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + +**/ + +#ifndef _DXECIS_H_ +#define _DXECIS_H_ + +#include + +/** + Functions of this type are used with the Framework MP Services Protocol and + the SMM Services Table to execute a procedure on enabled APs. The context + the AP should use durng execution is specified by Buffer. + + @param[in] Buffer The pointer to the procedure's argument. + +**/ +typedef +VOID +(EFIAPI *FRAMEWORK_EFI_AP_PROCEDURE)( + IN VOID *Buffer + ); + +/// +/// The Framework EFI Runtime Services Table as an extension to the EFI 1.10 Runtime Services Table. +/// +typedef struct { + // + // Table header for the Framework EFI Runtime Services Table + // + EFI_TABLE_HEADER Hdr; + // + // Time services + // + EFI_GET_TIME GetTime; + EFI_SET_TIME SetTime; + EFI_GET_WAKEUP_TIME GetWakeupTime; + EFI_SET_WAKEUP_TIME SetWakeupTime; + // + // Virtual memory services + // + EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap; + EFI_CONVERT_POINTER ConvertPointer; + // + // Variable services + // + EFI_GET_VARIABLE GetVariable; + EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName; + EFI_SET_VARIABLE SetVariable; + // + // Misc + // + EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount; + EFI_RESET_SYSTEM ResetSystem; + /// + /// A Framework extension to the EFI 1.10 runtime table. + /// It was moved to a protocol to avoid conflict with UEFI 2.0. + /// + EFI_REPORT_STATUS_CODE ReportStatusCode; +} FRAMEWORK_EFI_RUNTIME_SERVICES; + +/// +/// The Framework EFI Boot Services Table. Complies with the DxeCis specification. +/// +typedef struct { + /// + /// The table header for the EFI Boot Services Table. + /// + EFI_TABLE_HEADER Hdr; + + // + // Task Priority Services + // + EFI_RAISE_TPL RaiseTPL; + EFI_RESTORE_TPL RestoreTPL; + + // + // Memory Services + // + EFI_ALLOCATE_PAGES AllocatePages; + EFI_FREE_PAGES FreePages; + EFI_GET_MEMORY_MAP GetMemoryMap; + EFI_ALLOCATE_POOL AllocatePool; + EFI_FREE_POOL FreePool; + + // + // Event & Timer Services + // + EFI_CREATE_EVENT CreateEvent; + EFI_SET_TIMER SetTimer; + EFI_WAIT_FOR_EVENT WaitForEvent; + EFI_SIGNAL_EVENT SignalEvent; + EFI_CLOSE_EVENT CloseEvent; + EFI_CHECK_EVENT CheckEvent; + + // + // Protocol Handler Services + // + EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface; + EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface; + EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface; + EFI_HANDLE_PROTOCOL HandleProtocol; + EFI_HANDLE_PROTOCOL PcHandleProtocol; + EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify; + EFI_LOCATE_HANDLE LocateHandle; + EFI_LOCATE_DEVICE_PATH LocateDevicePath; + EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable; + + // + // Image Services + // + EFI_IMAGE_LOAD LoadImage; + EFI_IMAGE_START StartImage; + EFI_EXIT Exit; + EFI_IMAGE_UNLOAD UnloadImage; + EFI_EXIT_BOOT_SERVICES ExitBootServices; + + // + // Miscellaneous Services + // + EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount; + EFI_STALL Stall; + EFI_SET_WATCHDOG_TIMER SetWatchdogTimer; + + // + // DriverSupport Services + // + EFI_CONNECT_CONTROLLER ConnectController; + EFI_DISCONNECT_CONTROLLER DisconnectController; + + // + // Open and Close Protocol Services + // + EFI_OPEN_PROTOCOL OpenProtocol; + EFI_CLOSE_PROTOCOL CloseProtocol; + EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation; + + // + // Library Services + // + EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle; + EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer; + EFI_LOCATE_PROTOCOL LocateProtocol; + EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces; + EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces; + + // + // 32-bit CRC Services + // + EFI_CALCULATE_CRC32 CalculateCrc32; + + // + // Miscellaneous Services + // + EFI_COPY_MEM CopyMem; + EFI_SET_MEM SetMem; +} FRAMEWORK_EFI_BOOT_SERVICES; + +#define EFI_EVENT_RUNTIME_CONTEXT 0x20000000 +#define EFI_EVENT_NOTIFY_SIGNAL_ALL 0x00000400 +#define EFI_EVENT_SIGNAL_READY_TO_BOOT 0x00000203 +#define EFI_EVENT_SIGNAL_LEGACY_BOOT 0x00000204 + +#endif + diff --git a/IntelFrameworkPkg/Include/Framework/FirmwareVolumeHeader.h b/IntelFrameworkPkg/Include/Framework/FirmwareVolumeHeader.h new file mode 100644 index 000000000..7b471f1c7 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/FirmwareVolumeHeader.h @@ -0,0 +1,85 @@ +/** @file + Defines the data structure that is the volume header found at the beginning of + all firmware volumes that are either memory mapped or have an + associated FirmwareVolumeBlock protocol. + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + + @par Revision Reference: + These definitions are from the Firmware Volume Block Spec 0.9. + +**/ + +#ifndef __EFI_FIRMWARE_VOLUME_HEADER_H__ +#define __EFI_FIRMWARE_VOLUME_HEADER_H__ + +/// +/// Firmware Volume Block Attributes bit definitions. +///@{ +#define EFI_FVB_READ_DISABLED_CAP 0x00000001 +#define EFI_FVB_READ_ENABLED_CAP 0x00000002 +#define EFI_FVB_READ_STATUS 0x00000004 + +#define EFI_FVB_WRITE_DISABLED_CAP 0x00000008 +#define EFI_FVB_WRITE_ENABLED_CAP 0x00000010 +#define EFI_FVB_WRITE_STATUS 0x00000020 + +#define EFI_FVB_LOCK_CAP 0x00000040 +#define EFI_FVB_LOCK_STATUS 0x00000080 + +#define EFI_FVB_STICKY_WRITE 0x00000200 +#define EFI_FVB_MEMORY_MAPPED 0x00000400 +#define EFI_FVB_ERASE_POLARITY 0x00000800 + +#define EFI_FVB_ALIGNMENT_CAP 0x00008000 +#define EFI_FVB_ALIGNMENT_2 0x00010000 +#define EFI_FVB_ALIGNMENT_4 0x00020000 +#define EFI_FVB_ALIGNMENT_8 0x00040000 +#define EFI_FVB_ALIGNMENT_16 0x00080000 +#define EFI_FVB_ALIGNMENT_32 0x00100000 +#define EFI_FVB_ALIGNMENT_64 0x00200000 +#define EFI_FVB_ALIGNMENT_128 0x00400000 +#define EFI_FVB_ALIGNMENT_256 0x00800000 +#define EFI_FVB_ALIGNMENT_512 0x01000000 +#define EFI_FVB_ALIGNMENT_1K 0x02000000 +#define EFI_FVB_ALIGNMENT_2K 0x04000000 +#define EFI_FVB_ALIGNMENT_4K 0x08000000 +#define EFI_FVB_ALIGNMENT_8K 0x10000000 +#define EFI_FVB_ALIGNMENT_16K 0x20000000 +#define EFI_FVB_ALIGNMENT_32K 0x40000000 +#define EFI_FVB_ALIGNMENT_64K 0x80000000 +///@} + +/// This is a simple macro defined as the set of all FV Block Attributes signifying capabilities. +#define EFI_FVB_CAPABILITIES ( EFI_FVB_READ_DISABLED_CAP | \ + EFI_FVB_READ_ENABLED_CAP | \ + EFI_FVB_WRITE_DISABLED_CAP | \ + EFI_FVB_WRITE_ENABLED_CAP | \ + EFI_FVB_LOCK_CAP \ + ) + +/** A parameterized macro defining a boolean expression that tests the state of a particular bit. + * + * @param FvbAttributes Indicates a test for CLEAR if EFI_FVB_ERASE_POLARITY is 1, else test for SET. + * + * @param TestAttributes The set of bits to test. + * + * @param Bit A value indicating the bit(s) to test. + * If multiple bits are set, the logical OR of their tests is the expression's value. +**/ +#define EFI_TEST_FFS_ATTRIBUTES_BIT( FvbAttributes, TestAttributes, Bit) \ + ((BOOLEAN) \ + ((FvbAttributes & EFI_FVB_ERASE_POLARITY) ? (((~TestAttributes) & Bit) == Bit) : ((TestAttributes & Bit) == Bit)) \ + ) + +/// A simple macro defined as the set of all FV Block Attribute bits that indicate status. +#define EFI_FVB_STATUS (EFI_FVB_READ_STATUS | EFI_FVB_WRITE_STATUS | EFI_FVB_LOCK_STATUS) + +#endif /* __EFI_FIRMWARE_VOLUME_HEADER_H__ */ diff --git a/IntelFrameworkPkg/Include/Framework/FirmwareVolumeImageFormat.h b/IntelFrameworkPkg/Include/Framework/FirmwareVolumeImageFormat.h new file mode 100644 index 000000000..81a9045e6 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/FirmwareVolumeImageFormat.h @@ -0,0 +1,38 @@ +/** @file + This file defines the data structures that are architecturally defined for file + images loaded via the FirmwareVolume protocol. The Firmware Volume specification + is the basis for these definitions. + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + + @par Revision Reference: + These definitions are from the Firmware Volume Spec 0.9. + +**/ + +#ifndef __FIRMWARE_VOLUME_IMAGE_FORMAT_H__ +#define __FIRMWARE_VOLUME_IMAGE_FORMAT_H__ + +// +// Bit values for AuthenticationStatus +// +#define EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE 0x000001 +#define EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED 0x000002 +#define EFI_AGGREGATE_AUTH_STATUS_NOT_TESTED 0x000004 +#define EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED 0x000008 +#define EFI_AGGREGATE_AUTH_STATUS_ALL 0x00000f + +#define EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE 0x010000 +#define EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED 0x020000 +#define EFI_LOCAL_AUTH_STATUS_NOT_TESTED 0x040000 +#define EFI_LOCAL_AUTH_STATUS_TEST_FAILED 0x080000 +#define EFI_LOCAL_AUTH_STATUS_ALL 0x0f0000 + +#endif diff --git a/IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h b/IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h new file mode 100644 index 000000000..61d020ec3 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/FrameworkInternalFormRepresentation.h @@ -0,0 +1,403 @@ +/** @file + This file defines the encoding for the VFR (Visual Form Representation) language. + Framework IFR is primarily consumed by the EFI presentation engine, and produced by EFI + internal application and drivers as well as all add-in card option-ROM drivers + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + + @par Revision Reference: + These definitions are from the Framework Specification HII 0.92. + +**/ + +#ifndef __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__ +#define __FRAMEWORK_INTERNAL_FORMREPRESENTATION_H__ + +typedef UINT16 STRING_REF; + +// +// IFR Op codes +// +#define FRAMEWORK_EFI_IFR_FORM_OP 0x01 +#define FRAMEWORK_EFI_IFR_SUBTITLE_OP 0x02 +#define FRAMEWORK_EFI_IFR_TEXT_OP 0x03 +#define EFI_IFR_GRAPHIC_OP 0x04 +#define FRAMEWORK_EFI_IFR_ONE_OF_OP 0x05 +#define FRAMEWORK_EFI_IFR_CHECKBOX_OP 0x06 +#define FRAMEWORK_EFI_IFR_NUMERIC_OP 0x07 +#define FRAMEWORK_EFI_IFR_PASSWORD_OP 0x08 +#define FRAMEWORK_EFI_IFR_ONE_OF_OPTION_OP 0x09 ///< ONEOF OPTION field. +#define FRAMEWORK_EFI_IFR_SUPPRESS_IF_OP 0x0A +#define EFI_IFR_END_FORM_OP 0x0B +#define EFI_IFR_HIDDEN_OP 0x0C +#define EFI_IFR_END_FORM_SET_OP 0x0D +#define FRAMEWORK_EFI_IFR_FORM_SET_OP 0x0E +#define FRAMEWORK_EFI_IFR_REF_OP 0x0F +#define EFI_IFR_END_ONE_OF_OP 0x10 +#define FRAMEWORK_EFI_IFR_END_OP EFI_IFR_END_ONE_OF_OP +#define FRAMEWORK_EFI_IFR_INCONSISTENT_IF_OP 0x11 +#define FRAMEWORK_EFI_IFR_EQ_ID_VAL_OP 0x12 +#define FRAMEWORK_EFI_IFR_EQ_ID_ID_OP 0x13 +#define FRAMEWORK_EFI_IFR_EQ_ID_LIST_OP 0x14 +#define FRAMEWORK_EFI_IFR_AND_OP 0x15 +#define FRAMEWORK_EFI_IFR_OR_OP 0x16 +#define FRAMEWORK_EFI_IFR_NOT_OP 0x17 +#define EFI_IFR_END_IF_OP 0x18 ///< For endif of inconsistentif, suppressif, grayoutif. +#define EFI_IFR_GRAYOUT_IF_OP 0x19 +#define FRAMEWORK_EFI_IFR_DATE_OP 0x1A +#define FRAMEWORK_EFI_IFR_TIME_OP 0x1B +#define FRAMEWORK_EFI_IFR_STRING_OP 0x1C +#define EFI_IFR_LABEL_OP 0x1D +#define EFI_IFR_SAVE_DEFAULTS_OP 0x1E +#define EFI_IFR_RESTORE_DEFAULTS_OP 0x1F +#define EFI_IFR_BANNER_OP 0x20 +#define EFI_IFR_INVENTORY_OP 0x21 +#define EFI_IFR_EQ_VAR_VAL_OP 0x22 +#define FRAMEWORK_EFI_IFR_ORDERED_LIST_OP 0x23 +#define FRAMEWORK_EFI_IFR_VARSTORE_OP 0x24 +#define EFI_IFR_VARSTORE_SELECT_OP 0x25 +#define EFI_IFR_VARSTORE_SELECT_PAIR_OP 0x26 +#define EFI_IFR_LAST_OPCODE EFI_IFR_VARSTORE_SELECT_PAIR_OP +#define EFI_IFR_OEM_OP 0xFE +#define EFI_IFR_NV_ACCESS_COMMAND 0xFF + +// +// Define values for the flags fields in some VFR opcodes. These are +// bitmasks. +// +#define EFI_IFR_FLAG_DEFAULT 0x01 +#define EFI_IFR_FLAG_MANUFACTURING 0x02 +#define EFI_IFR_FLAG_INTERACTIVE 0x04 +#define EFI_IFR_FLAG_NV_ACCESS 0x08 +#define EFI_IFR_FLAG_RESET_REQUIRED 0x10 +#define EFI_IFR_FLAG_LATE_CHECK 0x20 + +#define EFI_NON_DEVICE_CLASS 0x00 ///< Useful when you do not want something in the Device Manager. +#define EFI_DISK_DEVICE_CLASS 0x01 +#define EFI_VIDEO_DEVICE_CLASS 0x02 +#define EFI_NETWORK_DEVICE_CLASS 0x04 +#define EFI_INPUT_DEVICE_CLASS 0x08 +#define EFI_ON_BOARD_DEVICE_CLASS 0x10 +#define EFI_OTHER_DEVICE_CLASS 0x20 + +#define EFI_SETUP_APPLICATION_SUBCLASS 0x00 +#define EFI_GENERAL_APPLICATION_SUBCLASS 0x01 +#define EFI_FRONT_PAGE_SUBCLASS 0x02 +#define EFI_SINGLE_USE_SUBCLASS 0x03 ///< Used to display a single entity ,and then exit. + +/// +/// Used to flag dynamically created op-codes. This is meaningful to the IFR Library set +/// and the browser because we need to distinguish between compiled NV map data and created data. +/// We do not allow new entries to be created in the NV map dynamically, but we do need +/// to display this information correctly. To dynamically create op-codes and assume that their +/// data will be saved, ensure that the NV starting location they refer to is pre-defined in the +/// NV map. +/// +#define EFI_IFR_FLAG_CREATED 128 + + +#pragma pack(1) +// +// IFR Structure definitions +// +typedef struct { + UINT8 OpCode; + UINT8 Length; +} FRAMEWORK_EFI_IFR_OP_HEADER; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; + STRING_REF FormSetTitle; + STRING_REF Help; + EFI_PHYSICAL_ADDRESS CallbackHandle; + UINT16 Class; + UINT16 SubClass; + UINT16 NvDataSize; ///< Set once; the size of the NV data as defined in the script. +} FRAMEWORK_EFI_IFR_FORM_SET; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF FormTitle; +} FRAMEWORK_EFI_IFR_FORM; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 LabelId; +} EFI_IFR_LABEL; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF SubTitle; +} FRAMEWORK_EFI_IFR_SUBTITLE; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF Help; + STRING_REF Text; + STRING_REF TextTwo; + UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support. + UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code. +} FRAMEWORK_EFI_IFR_TEXT; + +// +// goto +// +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF Prompt; + STRING_REF Help; ///< The string Token for the context-help. + UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support. + UINT16 Key; ///< The value to be passed to the caller to identify this particular op-code. +} FRAMEWORK_EFI_IFR_REF; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_FORM; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_FORM_SET; + +// +// Also notice that the IFR_ONE_OF and IFR_CHECK_BOX are identical in structure...... +// code assumes this to be true, if this ever changes we need to revisit the InitializeTagStructures code +// +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The ID designating what the question is about... + UINT8 Width; ///< The Size of the Data being saved. + STRING_REF Prompt; ///< The String Token for the Prompt. + STRING_REF Help; ///< The string Token for the context-help. +} FRAMEWORK_EFI_IFR_ONE_OF; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The offset in NV for storage of the data. + UINT8 MaxEntries; ///< The maximum number of options in the ordered list (=size of NVStore). + STRING_REF Prompt; ///< The string token for the prompt. + STRING_REF Help; ///< The string token for the context-help. +} FRAMEWORK_EFI_IFR_ORDERED_LIST; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The ID designating what the question is about... + UINT8 Width; ///< The Size of the Data being saved. + STRING_REF Prompt; ///< The String Token for the Prompt. + STRING_REF Help; ///< The string Token for the context-help. + UINT8 Flags; ///< If non-zero, it means that it is the default option. + UINT16 Key; ///< Value to be passed to caller to identify this particular op-code. +} FRAMEWORK_EFI_IFR_CHECKBOX, EFI_IFR_CHECK_BOX; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF Option; ///< The string token describing the option. + UINT16 Value; ///< The value associated with this option that is stored in the NVRAM. + UINT8 Flags; ///< If non-zero, it means that it is the default option. + UINT16 Key; ///< Value to be passed to caller to identify this particular op-code. +} FRAMEWORK_EFI_IFR_ONE_OF_OPTION; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The ID designating what the question is about... + UINT8 Width; ///< The Size of the Data being saved. + STRING_REF Prompt; ///< The String Token for the Prompt. + STRING_REF Help; ///< The string Token for the context-help. + UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support. + UINT16 Key; ///< The value to be passed to caller to identify this particular op-code. + UINT16 Minimum; + UINT16 Maximum; + UINT16 Step; ///< Zero means manual input. Otherwise, arrow selection is called for. + UINT16 Default; +} FRAMEWORK_EFI_IFR_NUMERIC; + +// +// There is an interesting twist with regards to Time and Date. This is one of the few items which can accept input +// from a user, and may or may not need to use storage in the NVRAM space. The decided method for determining +// if NVRAM space will be used (only for a TimeOp or DateOp) is: If .QuestionId == 0 && .Width == 0 (normally an +// impossibility) then use system resources to store the data away and not NV resources. In other words, the setup +// engine will call gRT->SetTime, and gRT->SetDate for the saving of data, and the values displayed will be from the +// gRT->GetXXXX series of calls. +// +typedef struct { + FRAMEWORK_EFI_IFR_NUMERIC Hour; + FRAMEWORK_EFI_IFR_NUMERIC Minute; + FRAMEWORK_EFI_IFR_NUMERIC Second; +} FRAMEWORK_EFI_IFR_TIME; + +typedef struct { + FRAMEWORK_EFI_IFR_NUMERIC Year; + FRAMEWORK_EFI_IFR_NUMERIC Month; + FRAMEWORK_EFI_IFR_NUMERIC Day; +} FRAMEWORK_EFI_IFR_DATE; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId;///< The ID designating what the question is about... + UINT8 Width; ///< The Size of the Data being saved. + STRING_REF Prompt; ///< The String Token for the Prompt. + STRING_REF Help; ///< The string Token for the context-help. + UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support. + UINT16 Key; ///< The value to be passed to caller to identify this particular op-code. + UINT8 MinSize; ///< Minimum allowable sized password. + UINT8 MaxSize; ///< Maximum allowable sized password. + UINT16 Encoding; +} FRAMEWORK_EFI_IFR_PASSWORD; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The ID designating what the question is about... + UINT8 Width; ///< The Size of the Data being saved. + STRING_REF Prompt; ///< The String Token for the Prompt. + STRING_REF Help; ///< The string Token for the context-help. + UINT8 Flags; ///< This is included solely for purposes of interactive/dynamic support. + UINT16 Key; ///< The value to be passed to caller to identify this particular op-code. + UINT8 MinSize; ///< Minimum allowable sized password. + UINT8 MaxSize; ///< Maximum allowable sized password. +} FRAMEWORK_EFI_IFR_STRING; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_ONE_OF; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 Value; + UINT16 Key; +} EFI_IFR_HIDDEN; + +/// +/// Inconsistent with specification here: +/// The following defintion may not comply with Framework Specification HII 0.92. To +/// keep the inconsistant is for implementation needed. +///@{ +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT8 Flags; +} EFI_IFR_SUPPRESS; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT8 Flags; +} EFI_IFR_GRAY_OUT; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF Popup; + UINT8 Flags; +} EFI_IFR_INCONSISTENT; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The offset into variable storage. + UINT8 Width; ///< The size of variable storage. + UINT16 Value; ///< The value to compare against. +} FRAMEWORK_EFI_IFR_EQ_ID_VAL; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId; ///< The offset into variable storage. + UINT8 Width; ///< The size of variable storage. + UINT16 ListLength; + UINT16 ValueList[1]; +} FRAMEWORK_EFI_IFR_EQ_ID_LIST; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 QuestionId1; ///< The offset into variable storage for first value to compare. + UINT8 Width; ///< The size of variable storage (must be same for both). + UINT16 QuestionId2; ///< The offset into variable storage for second value to compare. +} FRAMEWORK_EFI_IFR_EQ_ID_ID; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 VariableId; ///< The offset into variable storage. + UINT16 Value; ///< The value to compare against. +} EFI_IFR_EQ_VAR_VAL; +///@} + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} FRAMEWORK_EFI_IFR_AND; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} FRAMEWORK_EFI_IFR_OR; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} FRAMEWORK_EFI_IFR_NOT; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; +} EFI_IFR_END_EXPR, EFI_IFR_END_IF; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 FormId; + STRING_REF Prompt; + STRING_REF Help; + UINT8 Flags; + UINT16 Key; +} EFI_IFR_SAVE_DEFAULTS; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF Help; + STRING_REF Text; + STRING_REF TextTwo; ///< Optional text. +} EFI_IFR_INVENTORY; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + EFI_GUID Guid; ///< GUID for the variable. + UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form. + UINT16 Size; ///< The size of the variable storage. +} FRAMEWORK_EFI_IFR_VARSTORE; + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form. +} EFI_IFR_VARSTORE_SELECT; + +/// +/// Used for the ideqid VFR statement where two variable stores may be referenced in the +/// same VFR statement. +/// A browser should treat this as an FRAMEWORK_EFI_IFR_VARSTORE_SELECT statement and assume that all following +/// IFR opcodes use the VarId as defined here. +/// +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + UINT16 VarId; ///< The variable store ID, as referenced elsewhere in the form. + UINT16 SecondaryVarId; ///< The variable store ID, as referenced elsewhere in the form. +} EFI_IFR_VARSTORE_SELECT_PAIR; + +/// +/// Save defaults and restore defaults have same structure. +/// +#define EFI_IFR_RESTORE_DEFAULTS EFI_IFR_SAVE_DEFAULTS + +typedef struct { + FRAMEWORK_EFI_IFR_OP_HEADER Header; + STRING_REF Title; ///< The string token for the banner title. + UINT16 LineNumber; ///< 1-based line number. + UINT8 Alignment; ///< Left, center, or right-aligned. +} EFI_IFR_BANNER; + +#define EFI_IFR_BANNER_ALIGN_LEFT 0 +#define EFI_IFR_BANNER_ALIGN_CENTER 1 +#define EFI_IFR_BANNER_ALIGN_RIGHT 2 +#define EFI_IFR_BANNER_TIMEOUT 0xFF + +#pragma pack() + +#endif diff --git a/IntelFrameworkPkg/Include/Framework/Hob.h b/IntelFrameworkPkg/Include/Framework/Hob.h new file mode 100644 index 000000000..070a23d19 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/Hob.h @@ -0,0 +1,34 @@ +/** @file + This file defines the data structures per HOB specification v0.9. + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + + @par Revision Reference: + These definitions are from the HOB Spec 0.9 that were not adopted by the PI specifications. + +**/ + +#ifndef _HOB_H_ +#define _HOB_H_ + +/// +/// Capsule volume HOB -- identical to a firmware volume. +/// This macro is defined to comply with the hob Framework Spec. And the marco was +/// retired in the PI1.0 specification. +/// +#define EFI_HOB_TYPE_CV 0x0008 + +typedef struct { + EFI_HOB_GENERIC_HEADER Header; + EFI_PHYSICAL_ADDRESS BaseAddress; + UINT64 Length; +} EFI_HOB_CAPSULE_VOLUME; + +#endif diff --git a/IntelFrameworkPkg/Include/Framework/PeiCis.h b/IntelFrameworkPkg/Include/Framework/PeiCis.h new file mode 100644 index 000000000..d823339ee --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/PeiCis.h @@ -0,0 +1,211 @@ +/** @file + The Include file for definitions in the Intel Platform Innovation Framework for EFI + Pre-EFI Initialization Core Interface Specification (PEI CIS) Version 0.91. + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + +**/ + +#ifndef __PEICIS_H__ +#define __PEICIS_H__ + +#include +// +// Framework PEI Specification Revision information +// +#define FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION 0 +#define FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION 91 + + +// +// PEI services signature and Revision defined in Framework PEI spec +// +#define FRAMEWORK_PEI_SERVICES_SIGNATURE 0x5652455320494550ULL +#define FRAMEWORK_PEI_SERVICES_REVISION ((FRAMEWORK_PEI_SPECIFICATION_MAJOR_REVISION<<16) | (FRAMEWORK_PEI_SPECIFICATION_MINOR_REVISION)) + + + +typedef struct _FRAMEWORK_EFI_PEI_SERVICES FRAMEWORK_EFI_PEI_SERVICES; + +/** + The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI + Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header. + + @param FfsHeader The pointer to the FFS file header. + @param PeiServices Describes the list of possible PEI Services. + + @return Status code + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEIM_ENTRY_POINT)( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ); + +/** + This service abstracts the capability of the PEI + Foundation to discover instances of firmware volumes in the system. + Given the input file pointer, this service searches for the next + matching file in the Firmware File System (FFS) volume. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV). + @param FwVolHeader The pointer to the firmware volume header of the volume to return. + + @retval EFI_SUCCESS The volume was found. + @retval EFI_NOT_FOUND The volume was not found. + @retval EFI_INVALID_PARAMETER FwVolHeader is NULL + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME)( + IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices, + IN UINTN Instance, + IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader + ); + +/** + This service abstracts the capability of the PEI + Foundation to discover instances of firmware files in the system. + Given the input file pointer, this service searches for the next matching + file in the Firmware File System (FFS) volume. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SearchType A filter to find files only of this type. + @param FwVolHeader The pointer to the firmware volume header of the volume to search. This parameter + must point to a valid FFS volume. + @param FileHeader The pointer to the current file from which to begin searching. Upon return this pointer will be + updated to reflect the file found. + + @retval EFI_SUCCESS The file was found. + @retval EFI_NOT_FOUND The file was not found. + @retval EFI_NOT_FOUND The header checksum was not zero. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE)( + IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices, + IN EFI_FV_FILETYPE SearchType, + IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader, + IN OUT EFI_FFS_FILE_HEADER **FileHeader + ); + +/** + Given the input file pointer, this service searches for the next + matching file in the Firmware File System (FFS) volume. + + @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. + @param SectionType The value of the section type to find. + @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched. + @param SectionData A pointer to the discovered section, if successful. + + @retval EFI_SUCCESS The section was found. + @retval EFI_NOT_FOUND The section was not found. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA)( + IN FRAMEWORK_EFI_PEI_SERVICES **PeiServices, + IN EFI_SECTION_TYPE SectionType, + IN EFI_FFS_FILE_HEADER *FfsFileHeader, + IN OUT VOID **SectionData + ); + +/// +/// FRAMEWORK_EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI +/// Foundation. The table may be located in the temporary or permanent memory, depending upon the capabilities +/// and phase of execution of PEI. +/// +/// These services fall into various classes, including the following: +/// - Managing the boot mode. +/// - Allocating both early and permanent memory. +/// - Supporting the Firmware File System (FFS). +/// - Abstracting the PPI database abstraction. +/// - Creating Hand-Off Blocks (HOBs). +/// +struct _FRAMEWORK_EFI_PEI_SERVICES { + EFI_TABLE_HEADER Hdr; + // + // PPI Functions + // + EFI_PEI_INSTALL_PPI InstallPpi; + EFI_PEI_REINSTALL_PPI ReInstallPpi; + EFI_PEI_LOCATE_PPI LocatePpi; + EFI_PEI_NOTIFY_PPI NotifyPpi; + // + // Boot Mode Functions + // + EFI_PEI_GET_BOOT_MODE GetBootMode; + EFI_PEI_SET_BOOT_MODE SetBootMode; + // + // HOB Functions + // + EFI_PEI_GET_HOB_LIST GetHobList; + EFI_PEI_CREATE_HOB CreateHob; + // + // Firmware Volume Functions + // + EFI_PEI_FFS_FIND_NEXT_VOLUME FfsFindNextVolume; + EFI_PEI_FFS_FIND_NEXT_FILE FfsFindNextFile; + EFI_PEI_FFS_FIND_SECTION_DATA FfsFindSectionData; + // + // PEI Memory Functions + // + EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory; + EFI_PEI_ALLOCATE_PAGES AllocatePages; + EFI_PEI_ALLOCATE_POOL AllocatePool; + EFI_PEI_COPY_MEM CopyMem; + EFI_PEI_SET_MEM SetMem; + // + // (the following interfaces are installed by publishing PEIM) + // Status Code + // + EFI_PEI_REPORT_STATUS_CODE ReportStatusCode; + // + // Reset + // + EFI_PEI_RESET_SYSTEM ResetSystem; + /// + /// Inconsistent with specification here: + /// In Framework Spec, PeiCis0.91, CpuIo and PciCfg are NOT pointers. + /// + + // + // I/O Abstractions + // + EFI_PEI_CPU_IO_PPI *CpuIo; + EFI_PEI_PCI_CFG_PPI *PciCfg; +}; +/// +/// Enumeration of reset types defined in the Framework Specification PeiCis. +/// +typedef enum { + /// + /// Used to induce a system-wide reset. This sets all circuitry within the + /// system to its initial state. This type of reset is asynchronous to system + /// operation and operates withgout regard to cycle boundaries. EfiColdReset + /// is tantamount to a system power cycle. + /// + EfiPeiResetCold, + /// + /// Used to induce a system-wide initialization. The processors are set to their + /// initial state, and pending cycles are not corrupted. If the system does + /// not support this reset type, then an EfiResetCold must be performed. + /// + EfiPeiResetWarm, +} EFI_PEI_RESET_TYPE; + +#endif + diff --git a/IntelFrameworkPkg/Include/Framework/SmmCis.h b/IntelFrameworkPkg/Include/Framework/SmmCis.h new file mode 100644 index 000000000..7aefd5b41 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/SmmCis.h @@ -0,0 +1,557 @@ +/** @file + Include file for definitions in the Intel Platform Innovation Framework for EFI + System Management Mode Core Interface Specification (SMM CIS) version 0.91. + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + +**/ + +#ifndef _SMM_CIS_H_ +#define _SMM_CIS_H_ + +// +// Share some common definitions with PI SMM +// +#include +#include + +typedef struct _EFI_SMM_SYSTEM_TABLE EFI_SMM_SYSTEM_TABLE; + +// +// SMM Base specification constant and types +// +#define EFI_SMM_SYSTEM_TABLE_REVISION (0 << 16) | (0x09) + +/** + Allocates pool memory from SMRAM for IA-32, or runtime memory for + the Itanium processor family. + + @param PoolType The type of pool to allocate. The only supported type + is EfiRuntimeServicesData. + @param Size The number of bytes to allocate from the pool. + @param Buffer A pointer to a pointer to the allocated buffer if the + call succeeds. Otherwise, undefined. + + @retval EFI_SUCCESS The requested number of bytes was allocated. + @retval EFI_OUT_OF_RESOURCES The pool requested could not be allocated. + @retval EFI_UNSUPPORTED In runtime. + @note Inconsistent with specification here: + In Framework Spec, this definition is named EFI_SMM_ALLOCATE_POOL. + To avoid a naming conflict, the definition is renamed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMMCORE_ALLOCATE_POOL)( + IN EFI_MEMORY_TYPE PoolType, + IN UINTN Size, + OUT VOID **Buffer + ); + +/** + Returns pool memory to the system. + + @param Buffer The pointer to the buffer to free. + + @retval EFI_SUCCESS The memory was returned to the system. + @retval EFI_INVALID_PARAMETER Buffer was invalid. + @retval EFI_UNSUPPORTED In runtime. + @note Inconsistent with specification here: + In Framework Spec, this definition is named EFI_SMM_FREE_POOL. + To avoid a naming conflict, the definition is renamed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMMCORE_FREE_POOL)( + IN VOID *Buffer + ); + +/** + Allocates memory pages from the system. + + @param Type The type of allocation to perform. + @param MemoryType The only supported type is EfiRuntimeServicesData. + @param NumberofPages The number of contiguous 4 KB pages to allocate. + @param Memory Pointer to a physical address. On input, the way in which + the address is used depends on the value of Type. On output, the address + is set to the base of the page range that was allocated. + + @retval EFI_SUCCESS The requested pages were allocated. + @retval EFI_OUT_OF_RESOURCES The pages requested could not be allocated. + @retval EFI_NOT_FOUND The requested pages could not be found. + @retval EFI_INVALID_PARAMETER Type is not AllocateAnyPages or AllocateMaxAddress + or AllocateAddress. Or, MemoryType is in the range EfiMaxMemoryType..0x7FFFFFFF. + @note Inconsistent with specification here: + In the Framework Spec, this definition is named EFI_SMM_ALLOCATE_PAGES. + To avoid a naming conflict, the definition here is renamed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMMCORE_ALLOCATE_PAGES)( + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN NumberOfPages, + OUT EFI_PHYSICAL_ADDRESS *Memory + ); + +/** + Frees memory pages for the system. + + @param Memory The base physical address of the pages to be freed. + @param NumberOfPages The number of contiguous 4 KB pages to free. + + @retval EFI_SUCCESS The requested memory pages were freed. + @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or NumberOfPages is invalid. + @retval EFI_NOT_FOUND The requested memory pages were not allocated with SmmAllocatePages(). + + @note Inconsistent with specification here: + In the Framework Spec, this definition is named EFI_SMM_FREE_PAGES. + To avoid a naming conflict, the definition here is renamed. +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMMCORE_FREE_PAGES)( + IN EFI_PHYSICAL_ADDRESS Memory, + IN UINTN NumberOfPages + ); + +/// +/// The processor save-state information for IA-32 processors. This information is important in that the +/// SMM drivers may need to ascertain the state of the processor before invoking the SMI. +/// +typedef struct { + /// + /// Reserved for future processors. As such, software should not attempt to interpret or + /// write to this region. + /// + UINT8 Reserved1[248]; + /// + /// The location of the processor SMBASE, which is the location where the processor + /// will pass control upon receipt of an SMI. + /// + UINT32 SMBASE; + /// + /// The revision of the SMM save state. This value is set by the processor. + /// + UINT32 SMMRevId; + /// + /// The value of the I/O restart field. Allows for restarting an in-process I/O instruction. + /// + UINT16 IORestart; + /// + /// Describes behavior that should be commenced in response to a halt instruction. + /// + UINT16 AutoHALTRestart; + /// + /// Reserved for future processors. As such, software should not attempt to interpret or + /// write to this region. + /// + UINT8 Reserved2[164]; + + // + // Registers in IA-32 processors. + // + UINT32 ES; + UINT32 CS; + UINT32 SS; + UINT32 DS; + UINT32 FS; + UINT32 GS; + UINT32 LDTBase; + UINT32 TR; + UINT32 DR7; + UINT32 DR6; + UINT32 EAX; + UINT32 ECX; + UINT32 EDX; + UINT32 EBX; + UINT32 ESP; + UINT32 EBP; + UINT32 ESI; + UINT32 EDI; + UINT32 EIP; + UINT32 EFLAGS; + UINT32 CR3; + UINT32 CR0; +} EFI_SMI_CPU_SAVE_STATE; + +/// +/// The processor save-state information for the Itanium processor family. This information is +/// important in that the SMM drivers may need to ascertain the state of the processor before invoking +/// the PMI. This structure is mandatory and must be 512 byte aligned. +/// +typedef struct { + UINT64 reserved; + UINT64 r1; + UINT64 r2; + UINT64 r3; + UINT64 r4; + UINT64 r5; + UINT64 r6; + UINT64 r7; + UINT64 r8; + UINT64 r9; + UINT64 r10; + UINT64 r11; + UINT64 r12; + UINT64 r13; + UINT64 r14; + UINT64 r15; + UINT64 r16; + UINT64 r17; + UINT64 r18; + UINT64 r19; + UINT64 r20; + UINT64 r21; + UINT64 r22; + UINT64 r23; + UINT64 r24; + UINT64 r25; + UINT64 r26; + UINT64 r27; + UINT64 r28; + UINT64 r29; + UINT64 r30; + UINT64 r31; + + UINT64 pr; + + UINT64 b0; + UINT64 b1; + UINT64 b2; + UINT64 b3; + UINT64 b4; + UINT64 b5; + UINT64 b6; + UINT64 b7; + + // application registers + UINT64 ar_rsc; + UINT64 ar_bsp; + UINT64 ar_bspstore; + UINT64 ar_rnat; + + UINT64 ar_fcr; + + UINT64 ar_eflag; + UINT64 ar_csd; + UINT64 ar_ssd; + UINT64 ar_cflg; + UINT64 ar_fsr; + UINT64 ar_fir; + UINT64 ar_fdr; + + UINT64 ar_ccv; + + UINT64 ar_unat; + + UINT64 ar_fpsr; + + UINT64 ar_pfs; + UINT64 ar_lc; + UINT64 ar_ec; + + // control registers + UINT64 cr_dcr; + UINT64 cr_itm; + UINT64 cr_iva; + UINT64 cr_pta; + UINT64 cr_ipsr; + UINT64 cr_isr; + UINT64 cr_iip; + UINT64 cr_ifa; + UINT64 cr_itir; + UINT64 cr_iipa; + UINT64 cr_ifs; + UINT64 cr_iim; + UINT64 cr_iha; + + // debug registers + UINT64 dbr0; + UINT64 dbr1; + UINT64 dbr2; + UINT64 dbr3; + UINT64 dbr4; + UINT64 dbr5; + UINT64 dbr6; + UINT64 dbr7; + + UINT64 ibr0; + UINT64 ibr1; + UINT64 ibr2; + UINT64 ibr3; + UINT64 ibr4; + UINT64 ibr5; + UINT64 ibr6; + UINT64 ibr7; + + // virtual registers + UINT64 int_nat; // nat bits for R1-R31 + +} EFI_PMI_SYSTEM_CONTEXT; + +/// +/// The processor save-state information for IA-32 and Itanium processors. This information is +/// important in that the SMM drivers may need to ascertain the state of the processor before invoking +/// the SMI or PMI. +/// +typedef union { + /// + /// The processor save-state information for IA-32 processors. + /// + EFI_SMI_CPU_SAVE_STATE Ia32SaveState; + /// + /// Note: Inconsistency with the Framework SMM CIS spec - Itanium save state not included. + /// + /// The processor save-state information for Itanium processors. + /// + /// EFI_PMI_SYSTEM_CONTEXT ItaniumSaveState; +} EFI_SMM_CPU_SAVE_STATE; + +/// +/// The optional floating point save-state information for IA-32 processors. If the optional floating +/// point save is indicated for any handler, the following data structure must be preserved. +/// +typedef struct { + UINT16 Fcw; + UINT16 Fsw; + UINT16 Ftw; + UINT16 Opcode; + UINT32 Eip; + UINT16 Cs; + UINT16 Rsvd1; + UINT32 DataOffset; + UINT16 Ds; + UINT8 Rsvd2[10]; + UINT8 St0Mm0[10], Rsvd3[6]; + UINT8 St0Mm1[10], Rsvd4[6]; + UINT8 St0Mm2[10], Rsvd5[6]; + UINT8 St0Mm3[10], Rsvd6[6]; + UINT8 St0Mm4[10], Rsvd7[6]; + UINT8 St0Mm5[10], Rsvd8[6]; + UINT8 St0Mm6[10], Rsvd9[6]; + UINT8 St0Mm7[10], Rsvd10[6]; + UINT8 Rsvd11[22*16]; +} EFI_SMI_OPTIONAL_FPSAVE_STATE; + +/// +/// The optional floating point save-state information for the Itanium processor family. If the optional +/// floating point save is indicated for any handler, then this data structure must be preserved. +/// +typedef struct { + UINT64 f2[2]; + UINT64 f3[2]; + UINT64 f4[2]; + UINT64 f5[2]; + UINT64 f6[2]; + UINT64 f7[2]; + UINT64 f8[2]; + UINT64 f9[2]; + UINT64 f10[2]; + UINT64 f11[2]; + UINT64 f12[2]; + UINT64 f13[2]; + UINT64 f14[2]; + UINT64 f15[2]; + UINT64 f16[2]; + UINT64 f17[2]; + UINT64 f18[2]; + UINT64 f19[2]; + UINT64 f20[2]; + UINT64 f21[2]; + UINT64 f22[2]; + UINT64 f23[2]; + UINT64 f24[2]; + UINT64 f25[2]; + UINT64 f26[2]; + UINT64 f27[2]; + UINT64 f28[2]; + UINT64 f29[2]; + UINT64 f30[2]; + UINT64 f31[2]; +} EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT; + +/// +/// The processor save-state information for IA-32 and Itanium processors. If the optional floating +/// point save is indicated for any handler, then this data structure must be preserved. +/// +typedef union { + /// + /// The optional floating point save-state information for IA-32 processors. + /// + EFI_SMI_OPTIONAL_FPSAVE_STATE Ia32FpSave; + /// + /// The optional floating point save-state information for Itanium processors. + /// + EFI_PMI_OPTIONAL_FLOATING_POINT_CONTEXT ItaniumFpSave; +} EFI_SMM_FLOATING_POINT_SAVE_STATE; + +/** + This function is the main entry point for an SMM handler dispatch + or communicate-based callback. + + @param SmmImageHandle A unique value returned by the SMM infrastructure + in response to registration for a communicate-based callback or dispatch. + @param CommunicationBuffer + An optional buffer that will be populated + by the SMM infrastructure in response to a non-SMM agent (preboot or runtime) + invoking the EFI_SMM_BASE_PROTOCOL.Communicate() service. + @param SourceSize If CommunicationBuffer is non-NULL, this field + indicates the size of the data payload in this buffer. + + @return Status Code + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_HANDLER_ENTRY_POINT)( + IN EFI_HANDLE SmmImageHandle, + IN OUT VOID *CommunicationBuffer OPTIONAL, + IN OUT UINTN *SourceSize OPTIONAL + ); + +/** + The SmmInstallConfigurationTable() function is used to maintain the list + of configuration tables that are stored in the System Management System + Table. The list is stored as an array of (GUID, Pointer) pairs. The list + must be allocated from pool memory with PoolType set to EfiRuntimeServicesData. + + @param SystemTable A pointer to the SMM System Table. + @param Guid A pointer to the GUID for the entry to add, update, or remove. + @param Table A pointer to the buffer of the table to add. + @param TableSize The size of the table to install. + + @retval EFI_SUCCESS The (Guid, Table) pair was added, updated, or removed. + @retval EFI_INVALID_PARAMETER Guid is not valid. + @retval EFI_NOT_FOUND An attempt was made to delete a non-existent entry. + @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_SMM_INSTALL_CONFIGURATION_TABLE)( + IN EFI_SMM_SYSTEM_TABLE *SystemTable, + IN EFI_GUID *Guid, + IN VOID *Table, + IN UINTN TableSize + ); + +// +// System Management System Table (SMST) +// +struct _EFI_SMM_SYSTEM_TABLE { + /// + /// The table header for the System Management System Table (SMST). + /// + EFI_TABLE_HEADER Hdr; + + /// + /// A pointer to a NULL-terminated Unicode string containing the vendor name. It is + /// permissible for this pointer to be NULL. + /// + CHAR16 *SmmFirmwareVendor; + /// + /// The particular revision of the firmware. + /// + UINT32 SmmFirmwareRevision; + + /// + /// Adds, updates, or removes a configuration table entry from the SMST. + /// + EFI_SMM_INSTALL_CONFIGURATION_TABLE SmmInstallConfigurationTable; + + // + // I/O Services + // + /// + /// A GUID that designates the particular CPU I/O services. + /// + EFI_GUID EfiSmmCpuIoGuid; + /// + /// Provides the basic memory and I/O interfaces that are used to abstract accesses to + /// devices. + /// + EFI_SMM_CPU_IO_INTERFACE SmmIo; + + // + // Runtime memory service + // + /// + /// + /// Allocates pool memory from SMRAM for IA-32 or runtime memory for the + /// Itanium processor family. + /// + EFI_SMMCORE_ALLOCATE_POOL SmmAllocatePool; + /// + /// Returns pool memory to the system. + /// + EFI_SMMCORE_FREE_POOL SmmFreePool; + /// + /// Allocates memory pages from the system. + /// + EFI_SMMCORE_ALLOCATE_PAGES SmmAllocatePages; + /// + /// Frees memory pages for the system. + /// + EFI_SMMCORE_FREE_PAGES SmmFreePages; + + // + // MP service + // + + /// Inconsistent with specification here: + /// In Framework Spec, this definition does not exist. This method is introduced in PI1.1 specification for + /// the implementation needed. + EFI_SMM_STARTUP_THIS_AP SmmStartupThisAp; + + // + // CPU information records + // + /// + /// A 1-relative number between 1 and the NumberOfCpus field. This field designates + /// which processor is executing the SMM infrastructure. This number also serves as an + /// index into the CpuSaveState and CpuOptionalFloatingPointState + /// fields. + /// + UINTN CurrentlyExecutingCpu; + /// + /// The number of EFI Configuration Tables in the buffer + /// SmmConfigurationTable. + /// + UINTN NumberOfCpus; + /// + /// A pointer to the EFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// + EFI_SMM_CPU_SAVE_STATE *CpuSaveState; + /// + /// A pointer to a catenation of the EFI_SMM_FLOATING_POINT_SAVE_STATE. + /// The size of this entire table is NumberOfCpus* size of the + /// EFI_SMM_FLOATING_POINT_SAVE_STATE. These fields are populated only if + /// there is at least one SMM driver that has registered for a callback with the + /// FloatingPointSave field in EFI_SMM_BASE_PROTOCOL.RegisterCallback() set to TRUE. + /// + EFI_SMM_FLOATING_POINT_SAVE_STATE *CpuOptionalFloatingPointState; + + // + // Extensibility table + // + /// + /// The number of EFI Configuration Tables in the buffer + /// SmmConfigurationTable. + /// + UINTN NumberOfTableEntries; + /// + /// A pointer to the EFI Configuration Tables. The number of entries in the table is + /// NumberOfTableEntries. + /// + EFI_CONFIGURATION_TABLE *SmmConfigurationTable; +}; + +#endif diff --git a/IntelFrameworkPkg/Include/Framework/StatusCode.h b/IntelFrameworkPkg/Include/Framework/StatusCode.h new file mode 100644 index 000000000..e237b15b9 --- /dev/null +++ b/IntelFrameworkPkg/Include/Framework/StatusCode.h @@ -0,0 +1,161 @@ +/** @file + Status Code Definitions, according to Intel Platform Innovation Framework + for EFI Status Codes Specification + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. + + @par Revision Reference: + Intel Platform Innovation Framework for EFI Status Codes Specification + Version 0.92. + +**/ + +#ifndef _FRAMEWORK_STATUS_CODE_H_ +#define _FRAMEWORK_STATUS_CODE_H_ + +// +// Required for X64 defines for CPU exception types +// +#include + +/// +/// Software Class DXE BS Driver Subclass Progress Code definitions. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_SW_DXE_BS_PC_BEGIN_CONNECTING_DRIVERS (EFI_SUBCLASS_SPECIFIC | 0x00000005) +#define EFI_SW_DXE_BS_PC_VERIFYING_PASSWORD (EFI_SUBCLASS_SPECIFIC | 0x00000006) +///@} + +/// +/// Software Class DXE RT Driver Subclass Progress Code definitions. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_SW_DXE_RT_PC_S0 (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_DXE_RT_PC_S1 (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_SW_DXE_RT_PC_S2 (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_SW_DXE_RT_PC_S3 (EFI_SUBCLASS_SPECIFIC | 0x00000003) +#define EFI_SW_DXE_RT_PC_S4 (EFI_SUBCLASS_SPECIFIC | 0x00000004) +#define EFI_SW_DXE_RT_PC_S5 (EFI_SUBCLASS_SPECIFIC | 0x00000005) +///@} + +/// +/// Software Subclass definitions. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +#define EFI_SOFTWARE_X64_EXCEPTION (EFI_SOFTWARE | 0x00130000) + +/// +/// Software Class X64 Exception Subclass Error Code definitions. +/// These exceptions are derived from the debug protocol definitions in the EFI +/// specification. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_SW_EC_X64_DIVIDE_ERROR EXCEPT_X64_DIVIDE_ERROR +#define EFI_SW_EC_X64_DEBUG EXCEPT_X64_DEBUG +#define EFI_SW_EC_X64_NMI EXCEPT_X64_NMI +#define EFI_SW_EC_X64_BREAKPOINT EXCEPT_X64_BREAKPOINT +#define EFI_SW_EC_X64_OVERFLOW EXCEPT_X64_OVERFLOW +#define EFI_SW_EC_X64_BOUND EXCEPT_X64_BOUND +#define EFI_SW_EC_X64_INVALID_OPCODE EXCEPT_X64_INVALID_OPCODE +#define EFI_SW_EC_X64_DOUBLE_FAULT EXCEPT_X64_DOUBLE_FAULT +#define EFI_SW_EC_X64_INVALID_TSS EXCEPT_X64_INVALID_TSS +#define EFI_SW_EC_X64_SEG_NOT_PRESENT EXCEPT_X64_SEG_NOT_PRESENT +#define EFI_SW_EC_X64_STACK_FAULT EXCEPT_X64_STACK_FAULT +#define EFI_SW_EC_X64_GP_FAULT EXCEPT_X64_GP_FAULT +#define EFI_SW_EC_X64_PAGE_FAULT EXCEPT_X64_PAGE_FAULT +#define EFI_SW_EC_X64_FP_ERROR EXCEPT_X64_FP_ERROR +#define EFI_SW_EC_X64_ALIGNMENT_CHECK EXCEPT_X64_ALIGNMENT_CHECK +#define EFI_SW_EC_X64_MACHINE_CHECK EXCEPT_X64_MACHINE_CHECK +#define EFI_SW_EC_X64_SIMD EXCEPT_X64_SIMD +///@} + +/// +/// Software Class EFI After Life Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_AL_PC_ENTRY_POINT (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_SW_AL_PC_RETURN_TO_LAST (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +/// +/// Software Class DXE Core Subclass Error Code definitions. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +#define EFI_SW_CSM_LEGACY_ROM_INIT (EFI_SUBCLASS_SPECIFIC | 0x00000000) + +/// +/// IO Bus Class ATA/ATAPI Subclass Progress Code definitions. +/// +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_IOB_ATA_BUS_SMART_ENABLE (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_ATA_BUS_SMART_DISABLE (EFI_SUBCLASS_SPECIFIC | 0x00000001) +#define EFI_IOB_ATA_BUS_SMART_OVERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000002) +#define EFI_IOB_ATA_BUS_SMART_UNDERTHRESHOLD (EFI_SUBCLASS_SPECIFIC | 0x00000003) +///@} + +/// +/// IO Bus Class ATA/ATAPI Subclass Error Code definitions. +/// +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_IOB_ATA_BUS_SMART_NOTSUPPORTED (EFI_SUBCLASS_SPECIFIC | 0x00000000) +#define EFI_IOB_ATA_BUS_SMART_DISABLED (EFI_SUBCLASS_SPECIFIC | 0x00000001) +///@} + +/// +/// The reason that the processor was disabled. +/// +/// Inconsistent with specification here: +/// The Framework Specification, StatusCodes 0.92, does not define the macros. +/// +///@{ +#define EFI_CPU_CAUSE_NOT_DISABLED 0x0000 +///@} + +/// +/// Software Class PEI Module Subclass Progress Code definitions. +/// +///@{ +#define EFI_SW_PEIM_PC_RECOVERY_BEGIN EFI_SW_PEI_PC_RECOVERY_BEGIN +#define EFI_SW_PEIM_PC_CAPSULE_LOAD EFI_SW_PEI_PC_CAPSULE_LOAD +#define EFI_SW_PEIM_PC_CAPSULE_START EFI_SW_PEI_PC_CAPSULE_START +#define EFI_SW_PEIM_PC_RECOVERY_USER EFI_SW_PEI_PC_RECOVERY_USER +#define EFI_SW_PEIM_PC_RECOVERY_AUTO EFI_SW_PEI_PC_RECOVERY_AUTO +///@} + +/// +/// Software Class PEI Core Subclass Error Code definitions. +/// +///@{ +#define EFI_SW_PEIM_CORE_EC_DXE_CORRUPT EFI_SW_PEI_CORE_EC_DXE_CORRUPT +#define EFI_SW_PEIM_CORE_EC_DXEIPL_NOT_FOUND EFI_SW_PEI_CORE_EC_DXEIPL_NOT_FOUND +///@} + +#endif diff --git a/IntelFrameworkPkg/Include/FrameworkDxe.h b/IntelFrameworkPkg/Include/FrameworkDxe.h new file mode 100644 index 000000000..23ad62a41 --- /dev/null +++ b/IntelFrameworkPkg/Include/FrameworkDxe.h @@ -0,0 +1,32 @@ +/** @file + The root header file that provides Framework extension to UEFI/PI for modules. It can be included by + DXE, RUNTIME and SMM type modules that use Framework definitions. + + + This header file includes Framework extension definitions common to DXE + modules. + +Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that 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. +**/ + +#ifndef _FRAMEWORK_DXE_H_ +#define _FRAMEWORK_DXE_H_ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dec b/IntelFrameworkPkg/IntelFrameworkPkg.dec new file mode 100644 index 000000000..5cfe99c53 --- /dev/null +++ b/IntelFrameworkPkg/IntelFrameworkPkg.dec @@ -0,0 +1,186 @@ +## @file +# Intel Framework Package Reference Implementations +# +# This package provides definitions and libraries that comply to Intel Framework Specifications. +# Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials are licensed and made available +# under the terms and conditions of the BSD License which accompanies this distribution. +# The full text of the license may be found at http://opensource.org/licenses/bsd-license.php +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES +# OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## + +[Defines] + DEC_SPECIFICATION = 0x00010005 + PACKAGE_NAME = IntelFrameworkPkg + PACKAGE_UNI_FILE = IntelFrameworkPkg.uni + PACKAGE_GUID = 2759ded5-bb57-4b06-af4f-c398fa552719 + PACKAGE_VERSION = 0.96 + +[Includes] + Include # Root include for the package + +[Guids] + ## Include/Guid/DataHubRecords.h + gEfiCacheSubClassGuid = { 0x7f0013a7, 0xdc79, 0x4b22, { 0x80, 0x99, 0x11, 0xf7, 0x5f, 0xdc, 0x82, 0x9d }} + + ## Include/Guid/DataHubRecords.h + gEfiMemorySubClassGuid = { 0x4E8F4EBB, 0x64B9, 0x4e05, { 0x9b, 0x18, 0x4c, 0xfe, 0x49, 0x23, 0x50, 0x97 }} + + ## Include/Guid/DataHubRecords.h + gEfiMiscSubClassGuid = { 0x772484B2, 0x7482, 0x4b91, { 0x9f, 0x9a, 0xad, 0x43, 0xf8, 0x1c, 0x58, 0x81 }} + + ## Include/Guid/DataHubRecords.h + gEfiProcessorSubClassGuid = { 0x26fdeb7e, 0xb8af, 0x4ccf, { 0xaa, 0x97, 0x02, 0x63, 0x3c, 0xe4, 0x8c, 0xa7 }} + + ## Include/Guid/Capsule.h + gEfiCapsuleGuid = { 0x3B6686BD, 0x0D76, 0x4030, { 0xB7, 0x0E, 0xB5, 0x51, 0x9E, 0x2F, 0xC5, 0xA0 }} + + ## Include/Guid/Capsule.h + gEfiConfigFileNameGuid = { 0x98B8D59B, 0xE8BA, 0x48EE, { 0x98, 0xDD, 0xC2, 0x95, 0x39, 0x2F, 0x1E, 0xDB }} + + ## Include/Guid/SmramMemoryReserve.h + gEfiSmmPeiSmramMemoryReserveGuid = { 0x6dadf1d1, 0xd4cc, 0x4910, { 0xbb, 0x6e, 0x82, 0xb1, 0xfd, 0x80, 0xff, 0x3d }} + + ## Include/Guid/SmmCommunicate.h + gSmmCommunicateHeaderGuid = { 0xf328e36c, 0x23b6, 0x4a95, { 0x85, 0x4b, 0x32, 0xe1, 0x95, 0x34, 0xcd, 0x75 }} + + ## Include/Guid/FirmwareFileSystem.h + gEfiFirmwareFileSystemGuid = { 0x7A9354D9, 0x0468, 0x444a, {0x81, 0xCE, 0x0B, 0xF6, 0x17, 0xD8, 0x90, 0xDF }} + + ## Include/Guid/BlockIo.h + gEfiPeiIdeBlockIoPpiGuid = { 0x964e5b22, 0x6459, 0x11d2, { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }} + + ## Include/Guid/BlockIo.h + gEfiPei144FloppyBlockIoPpiGuid = { 0xda6855bd, 0x07b7, 0x4c05, { 0x9e, 0xd8, 0xe2, 0x59, 0xfd, 0x36, 0x0e, 0x22 }} + +[Ppis] + ## Include/Ppi/BootScriptExecuter.h + gEfiPeiBootScriptExecuterPpiGuid = { 0xabd42895, 0x78cf, 0x4872, { 0x84, 0x44, 0x1b, 0x5c, 0x18, 0x0b, 0xfb, 0xff }} + + ## Include/Ppi/Security.h + gEfiPeiSecurityPpiGuid = { 0x1388066E, 0x3A57, 0x4EFA, { 0x98, 0xF3, 0xC1, 0x2F, 0x3A, 0x95, 0x8A, 0x29 }} + + ## Include/Ppi/Smbus.h + gEfiPeiSmbusPpiGuid = { 0xabd42895, 0x78cf, 0x4872, { 0x84, 0x44, 0x1b, 0x5c, 0x18, 0x0b, 0xfb, 0xda }} + + ## Include/Ppi/PciCfg.h + gEfiPciCfgPpiInServiceTableGuid = { 0xe1f2eba0, 0xf7b9, 0x4a26, { 0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 }} + + ## Include/Ppi/ReadOnlyVariable.h + gEfiPeiReadOnlyVariablePpiGuid = { 0x3CDC90C6, 0x13FB, 0x4A75, { 0x9E, 0x79, 0x59, 0xE9, 0xDD, 0x78, 0xB9, 0xFA }} + + ## Include/Ppi/SectionExtraction.h + gEfiPeiSectionExtractionPpiGuid = { 0x4F89E208, 0xE144, 0x4804, { 0x9E, 0xC8, 0x0F, 0x89, 0x4F, 0x7E, 0x36, 0xD7 }} + + ## Include/Ppi/FvLoadFile.h + gEfiPeiFvFileLoaderPpiGuid = { 0x7e1f0d85, 0x4ff, 0x4bb2, { 0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 }} + + ## Include/Ppi/FindFv.h + gEfiFindFvPpiGuid = { 0x36164812, 0xa023, 0x44e5, { 0xbd, 0x85, 0x05, 0xbf, 0x3c, 0x77, 0x00, 0xaa }} + + ## Include/Ppi/S3Resume.h + gEfiPeiS3ResumePpiGuid = { 0x4426CCB2, 0xE684, 0x4a8a, { 0xae, 0x40, 0x20, 0xd4, 0xb0, 0x25, 0xb7, 0x10 }} + +[Protocols] + ## Include/Protocol/AcpiS3Save.h + gEfiAcpiS3SaveProtocolGuid = { 0x125F2DE1, 0xFB85, 0x440C, { 0xA5, 0x4C, 0x4D, 0x99, 0x35, 0x8A, 0x8D, 0x38 }} + + ## Include/Protocol/AcpiSupport.h + gEfiAcpiSupportProtocolGuid = { 0xdbff9d55, 0x89b7, 0x46da, { 0xbd, 0xdf, 0x67, 0x7d, 0x3d, 0xc0, 0x24, 0x1d }} + + ## Include/Protocol/BootScriptSave.h + gEfiBootScriptSaveProtocolGuid = { 0x470e1529, 0xb79e, 0x4e32, { 0xa0, 0xfe, 0x6a, 0x15, 0x6d, 0x29, 0xf9, 0xb2 }} + + ## Include/Protocol/LegacyBios.h + gEfiLegacyBiosProtocolGuid = { 0xdb9a1e3d, 0x45cb, 0x4abb, { 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d }} + + ## Include/Protocol/LegacyBiosPlatform.h + gEfiLegacyBiosPlatformProtocolGuid = { 0x783658a3, 0x4172, 0x4421, { 0xa2, 0x99, 0xe0, 0x09, 0x07, 0x9c, 0x0c, 0xb4 }} + + ## Include/Protocol/LegacyInterrupt.h + gEfiLegacyInterruptProtocolGuid = { 0x31ce593d, 0x108a, 0x485d, { 0xad, 0xb2, 0x78, 0xf2, 0x1f, 0x29, 0x66, 0xbe }} + + ## Include/Protocol/LegacyRegion.h + gEfiLegacyRegionProtocolGuid = { 0x0fc9013a, 0x0568, 0x4ba9, { 0x9b, 0x7e, 0xc9, 0xc3, 0x90, 0xa6, 0x60, 0x9b }} + + ## Include/Protocol/Legacy8259.h + gEfiLegacy8259ProtocolGuid = { 0x38321dba, 0x4fe0, 0x4e17, { 0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1 }} + + ## Include/Protocol/CpuIo.h + gEfiCpuIoProtocolGuid = { 0xB0732526, 0x38C8, 0x4b40, { 0x88, 0x77, 0x61, 0xc7, 0xb0, 0x6a, 0xac, 0x45 }} + + ## Include/Protocol/DataHub.h + gEfiDataHubProtocolGuid = { 0xae80d021, 0x618e, 0x11d4, { 0xbc, 0xd7, 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} + + ## Include/Protocol/FirmwareVolume.h + gEfiFirmwareVolumeProtocolGuid = { 0x389F751F, 0x1838, 0x4388, { 0x83, 0x90, 0xcd, 0x81, 0x54, 0xbd, 0x27, 0xf8 }} + + ## Include/Protocol/SectionExtraction.h + gEfiSectionExtractionProtocolGuid = { 0x448F5DA4, 0x6DD7, 0x4FE1, { 0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D }} + + ## Include/Protocol/FrameworkHii.h + gEfiHiiProtocolGuid = { 0xd7ad636e, 0xb997, 0x459b, { 0xbf, 0x3f, 0x88, 0x46, 0x89, 0x79, 0x80, 0xe1 }} + + ## Include/Protocol/FrameworkHii.h + gEfiHiiCompatibilityProtocolGuid = { 0x5542cce1, 0xdf5c, 0x4d1b, { 0xab, 0xca, 0x36, 0x4f, 0x77, 0xd3, 0x99, 0xfb }} + + ## Include/Protocol/FrameworkMpService.h + gFrameworkEfiMpServiceProtocolGuid = { 0xf33261e7, 0x23cb, 0x11d5, {0xbd, 0x5c, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81}} + + ## Include/Protocol/SmmBase.h + gEfiSmmBaseProtocolGuid = { 0x1390954D, 0xda95, 0x4227, { 0x93, 0x28, 0x72, 0x82, 0xc2, 0x17, 0xda, 0xa8 }} + + ## Include/Protocol/SmmAccess.h + gEfiSmmAccessProtocolGuid = { 0x3792095a, 0xe309, 0x4c1e, { 0xaa, 0x01, 0x85, 0xf5, 0x65, 0x5a, 0x17, 0xf1 }} + + ## Include/Protocol/SmmControl.h + gEfiSmmControlProtocolGuid = { 0x8d12e231, 0xc667, 0x4fd1, { 0x98, 0xf2, 0x24, 0x49, 0xa7, 0xe7, 0xb2, 0xe5 }} + + ## Include/Protocol/SmmSwDispatch.h + gEfiSmmSwDispatchProtocolGuid = { 0xe541b773, 0xdd11, 0x420c, { 0xb0, 0x26, 0xdf, 0x99, 0x36, 0x53, 0xf8, 0xbf }} + + ## Include/Protocol/SmmSxDispatch.h + gEfiSmmSxDispatchProtocolGuid = { 0x14fc52be, 0x01dc, 0x426c, { 0x91, 0xae, 0xa2, 0x3c, 0x3e, 0x22, 0x0a, 0xe8 }} + + ## Include/Protocol/SmmPeriodicTimerDispatch.h + gEfiSmmPeriodicTimerDispatchProtocolGuid = { 0x9cca03fc, 0x4c9e, 0x4a19, { 0x9b, 0x06, 0xed, 0x7b, 0x47, 0x9b, 0xde, 0x55 }} + + ## Include/Protocol/SmmUsbDispatch.h + gEfiSmmUsbDispatchProtocolGuid = { 0xa05b6ffd, 0x87af, 0x4e42, { 0x95, 0xc9, 0x62, 0x28, 0xb6, 0x3c, 0xf3, 0xf3 }} + + ## Include/Protocol/SmmGpiDispatch.h + gEfiSmmGpiDispatchProtocolGuid = { 0xe0744b81, 0x9513, 0x49cd, { 0x8c, 0xea, 0xe9, 0x24, 0x5e, 0x70, 0x39, 0xda }} + + ## Include/Protocol/SmmStandbyButtonDispatch.h + gEfiSmmStandbyButtonDispatchProtocolGuid = { 0x78965b98, 0xb0bf, 0x449e, { 0x8b, 0x22, 0xd2, 0x91, 0x4e, 0x49, 0x8a, 0x98 }} + + ## Include/Protocol/SmmPowerButtonDispatch.h + gEfiSmmPowerButtonDispatchProtocolGuid = { 0xb709efa0, 0x47a6, 0x4b41, { 0xb9, 0x31, 0x12, 0xec, 0xe7, 0xa8, 0xee, 0x56 }} + + ## Include/Protocol/SmmIchnDispatch.h + gEfiSmmIchnDispatchProtocolGuid = { 0xc50b323e, 0x9075, 0x4f2a, { 0xac, 0x8e, 0xd2, 0x59, 0x6a, 0x10, 0x85, 0xcc }} + + ## Include/Protocol/SmmCpuIo.h + gEfiSmmCpuIoGuid = { 0x5f439a0b, 0x45d8, 0x4682, {0xa4, 0xf4, 0xf0, 0x57, 0x6b, 0x51, 0x34, 0x41}} + + ## Include/Protocol/FrameworkFormCallback.h + gEfiFormCallbackProtocolGuid = { 0xF3E4543D, 0xCF35, 0x6CEF, { 0x35, 0xC4, 0x4F, 0xE6, 0x34, 0x4D, 0xFC, 0x54 }} + + ## Include/Protocol/FrameworkFormBrowser.h + gEfiFormBrowserProtocolGuid = { 0xE5A1333E, 0xE1B4, 0x4D55, { 0xCE, 0xEB, 0x35, 0xC3, 0xEF, 0x13, 0x34, 0x43 }} + + ## Include/Protocol/FrameworkFormBrowser.h + gEfiFormBrowserCompatibilityProtocolGuid = { 0xfb7c852, 0xadca, 0x4853, { 0x8d, 0xf, 0xfb, 0xa7, 0x1b, 0x1c, 0xe1, 0x1a }} + + ## Include/Protocol/FrameworkFirmwareVolumeBlock.h + gFramerworkEfiFirmwareVolumeBlockProtocolGuid = { 0xDE28BC59, 0x6228, 0x41BD, { 0xBD, 0xF6, 0xA3, 0xB9, 0xAD, 0xB5, 0x8D, 0xA1 }} + + ## Include/Protocol/SmmCpuSaveState.h + gEfiSmmCpuSaveStateProtocolGuid = { 0x21f302ad, 0x6e94, 0x471b, {0x84, 0xbc, 0xb1, 0x48, 0x0, 0x40, 0x3a, 0x1d}} + + +[UserExtensions.TianoCore."ExtraFiles"] + IntelFrameworkPkgExtra.uni diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc b/IntelFrameworkPkg/IntelFrameworkPkg.dsc new file mode 100644 index 000000000..2985d38bb --- /dev/null +++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc @@ -0,0 +1,75 @@ +## @file +# Intel Framework Package Reference Implementations +# +# This DSC file is used for Package Level build. +# +# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +## + +################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + PLATFORM_NAME = IntelFramework + PLATFORM_GUID = E76EB141-6EDB-43f3-A455-EF24A79673DD + PLATFORM_VERSION = 0.96 + DSC_SPECIFICATION = 0x00010005 + OUTPUT_DIRECTORY = Build/IntelFramework + SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT + +################################################################################ +# +# Pcd Section - list of all EDK II PCD Entries defined by this Platform +# +################################################################################ +[PcdsFixedAtBuild] + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0f + +[PcdsPatchableInModule] + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000 + +[PcdsFeatureFlag] + gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|FALSE + gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|FALSE + +################################################################################################### +# +# Components Section - list of the modules and components that will be processed by compilation +# tools and the EDK II tools to generate PE32/PE32+/Coff image files. +# +# Note: The EDK II DSC file is not used to specify how compiled binary images get placed +# into firmware volume images. This section is just a list of modules to compile from +# source into UEFI-compliant binaries. +# It is the FDF file that contains information on combining binary files into firmware +# volume images, whose concept is beyond UEFI and is described in PI specification. +# Binary modules do not need to be listed in this section, as they should be +# specified in the FDF file. For example: Shell binary (Shell_Full.efi), FAT binary (Fat.efi), +# Logo (Logo.bmp), and etc. +# There may also be modules listed in this section that are not required in the FDF file, +# When a module listed here is excluded from FDF file, then UEFI-compliant binary will be +# generated for it, but the binary will not be put into any firmware volume. +# +################################################################################################### +[Components] + IntelFrameworkPkg/Library/DxeIoLibCpuIo/DxeIoLibCpuIo.inf + IntelFrameworkPkg/Library/FrameworkUefiLib/FrameworkUefiLib.inf + IntelFrameworkPkg/Library/DxeSmmDriverEntryPoint/DxeSmmDriverEntryPoint.inf + IntelFrameworkPkg/Library/PeiSmbusLibSmbusPpi/PeiSmbusLibSmbusPpi.inf + IntelFrameworkPkg/Library/PeiHobLibFramework/PeiHobLibFramework.inf + +[BuildOptions] + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES + diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.uni b/IntelFrameworkPkg/IntelFrameworkPkg.uni new file mode 100644 index 000000000..9b63fd4dd --- /dev/null +++ b/IntelFrameworkPkg/IntelFrameworkPkg.uni @@ -0,0 +1,22 @@ +// /** @file +// Intel Framework Package Reference Implementations +// +// This package provides definitions and libraries that comply to Intel Framework Specifications. +// +// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials are licensed and made available +// under the terms and conditions of the BSD License which accompanies this distribution. +// The full text of the license may be found at http://opensource.org/licenses/bsd-license.php +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES +// OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + + +#string STR_PACKAGE_ABSTRACT #language en-US "Intel Framework Package Reference Implementations" + +#string STR_PACKAGE_DESCRIPTION #language en-US "This package provides definitions and libraries that comply to Intel Framework specifications." + + + diff --git a/IntelFrameworkPkg/IntelFrameworkPkgExtra.uni b/IntelFrameworkPkg/IntelFrameworkPkgExtra.uni new file mode 100644 index 000000000..ca96cc874 --- /dev/null +++ b/IntelFrameworkPkg/IntelFrameworkPkgExtra.uni @@ -0,0 +1,18 @@ +// /** @file +// IntelFramework Package Localized Strings and Content. +// +// Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials are licensed and made available +// under the terms and conditions of the BSD License which accompanies this distribution. +// The full text of the license may be found at http://opensource.org/licenses/bsd-license.php +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES +// OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + +#string STR_PROPERTIES_PACKAGE_NAME +#language en-US +"IntelFramework package" + + diff --git a/LegacyBios/BlockIoDxe/BlockIoDxe.inf b/LegacyBios/BlockIoDxe/BlockIoDxe.inf index 9e0fcf947..d5b4b05f0 100644 --- a/LegacyBios/BlockIoDxe/BlockIoDxe.inf +++ b/LegacyBios/BlockIoDxe/BlockIoDxe.inf @@ -61,7 +61,7 @@ gBlockIoVendorGuid [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/LegacyBios/KeyboardDxe/KeyboardDxe.inf b/LegacyBios/KeyboardDxe/KeyboardDxe.inf index 4825e6506..2f2894e52 100644 --- a/LegacyBios/KeyboardDxe/KeyboardDxe.inf +++ b/LegacyBios/KeyboardDxe/KeyboardDxe.inf @@ -45,7 +45,7 @@ [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf b/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf index 81e61308c..529c5ca23 100644 --- a/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf +++ b/LegacyBios/Region2Dxe/LegacyRegion2Dxe.inf @@ -44,7 +44,7 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] UefiDriverEntryPoint diff --git a/LegacyBios/VideoDxe/VideoDxe.inf b/LegacyBios/VideoDxe/VideoDxe.inf index 63b7ad4cc..53f3b396f 100644 --- a/LegacyBios/VideoDxe/VideoDxe.inf +++ b/LegacyBios/VideoDxe/VideoDxe.inf @@ -42,7 +42,7 @@ # VesaBiosExtensions.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/LegacyBios/VideoDxe/VideoDxe2.inf b/LegacyBios/VideoDxe/VideoDxe2.inf index b1a1fe484..69af1018b 100644 --- a/LegacyBios/VideoDxe/VideoDxe2.inf +++ b/LegacyBios/VideoDxe/VideoDxe2.inf @@ -43,7 +43,7 @@ # VesaBiosExtensions.h [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Library/DuetTimerLib/DuetTimerLib.inf b/Library/DuetTimerLib/DuetTimerLib.inf index 1144d4c70..1168656e7 100644 --- a/Library/DuetTimerLib/DuetTimerLib.inf +++ b/Library/DuetTimerLib/DuetTimerLib.inf @@ -40,7 +40,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] BaseLib diff --git a/Library/GenericBdsLib/GenericBdsLib.inf b/Library/GenericBdsLib/GenericBdsLib.inf index 0804a976d..91586591f 100644 --- a/Library/GenericBdsLib/GenericBdsLib.inf +++ b/Library/GenericBdsLib/GenericBdsLib.inf @@ -44,7 +44,7 @@ GenericBdsStrings.uni [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Library/MemLogLibDefault/MemLogLibDefault.inf b/Library/MemLogLibDefault/MemLogLibDefault.inf index c89cb1ab8..221eb1419 100644 --- a/Library/MemLogLibDefault/MemLogLibDefault.inf +++ b/Library/MemLogLibDefault/MemLogLibDefault.inf @@ -21,7 +21,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] BaseLib diff --git a/Library/OpensslLib/OpensslLibNull.inf b/Library/OpensslLib/OpensslLibNull.inf index 251e35cac..5ced84c7e 100644 --- a/Library/OpensslLib/OpensslLibNull.inf +++ b/Library/OpensslLib/OpensslLibNull.inf @@ -22,7 +22,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [Sources] OpensslLibNull.c diff --git a/Library/OpensslLib/openssl-1.0.1e/OpensslLib.inf b/Library/OpensslLib/openssl-1.0.1e/OpensslLib.inf index 11636ca09..b07e0a321 100644 --- a/Library/OpensslLib/openssl-1.0.1e/OpensslLib.inf +++ b/Library/OpensslLib/openssl-1.0.1e/OpensslLib.inf @@ -24,7 +24,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec #CryptoPkg/CryptoPkg.dec # diff --git a/Library/OsxBdsPlatformLib/PlatformBds.inf b/Library/OsxBdsPlatformLib/PlatformBds.inf index f0c619eb4..cd279fd0c 100644 --- a/Library/OsxBdsPlatformLib/PlatformBds.inf +++ b/Library/OsxBdsPlatformLib/PlatformBds.inf @@ -36,7 +36,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf b/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf index bbd26dace..44f51803b 100644 --- a/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf +++ b/Library/VBoxPeCoffLib/VBoxPeCoffLib.inf @@ -56,7 +56,7 @@ [Packages] # VBoxPkg/VBoxPkg.dec - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec [LibraryClasses] diff --git a/Library/VideoBiosPatchLib/VideoBiosPatchLib.inf b/Library/VideoBiosPatchLib/VideoBiosPatchLib.inf index db3c7dbb9..25bdfbf04 100644 --- a/Library/VideoBiosPatchLib/VideoBiosPatchLib.inf +++ b/Library/VideoBiosPatchLib/VideoBiosPatchLib.inf @@ -29,7 +29,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/Library/WaveLib/WaveLib.inf b/Library/WaveLib/WaveLib.inf index cef5a8fba..457b41dc0 100644 --- a/Library/WaveLib/WaveLib.inf +++ b/Library/WaveLib/WaveLib.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] BaseMemoryLib diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c new file mode 100644 index 000000000..9774670d7 --- /dev/null +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.c @@ -0,0 +1,2080 @@ +/** @file + This library is used to share code between UEFI network stack modules. + It provides the helper routines to parse the HTTP message byte stream. + +Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+(C) Copyright 2016 Hewlett Packard Enterprise Development LP
+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. + +**/ + +#include "DxeHttpLib.h" + + + +/** + Decode a percent-encoded URI component to the ASCII character. + + Decode the input component in Buffer according to RFC 3986. The caller is responsible to make + sure ResultBuffer points to a buffer with size equal or greater than ((AsciiStrSize (Buffer)) + in bytes. + + @param[in] Buffer The pointer to a percent-encoded URI component. + @param[in] BufferLength Length of Buffer in bytes. + @param[out] ResultBuffer Point to the buffer to store the decode result. + @param[out] ResultLength Length of decoded string in ResultBuffer in bytes. + + @retval EFI_SUCCESS Successfully decoded the URI. + @retval EFI_INVALID_PARAMETER Buffer is not a valid percent-encoded string. + +**/ +EFI_STATUS +EFIAPI +UriPercentDecode ( + IN CHAR8 *Buffer, + IN UINT32 BufferLength, + OUT CHAR8 *ResultBuffer, + OUT UINT32 *ResultLength + ) +{ + UINTN Index; + UINTN Offset; + CHAR8 HexStr[3]; + + if (Buffer == NULL || BufferLength == 0 || ResultBuffer == NULL) { + return EFI_INVALID_PARAMETER; + } + + Index = 0; + Offset = 0; + HexStr[2] = '\0'; + while (Index < BufferLength) { + if (Buffer[Index] == '%') { + if (Index + 1 >= BufferLength || Index + 2 >= BufferLength || + !NET_IS_HEX_CHAR (Buffer[Index+1]) || !NET_IS_HEX_CHAR (Buffer[Index+2])) { + return EFI_INVALID_PARAMETER; + } + HexStr[0] = Buffer[Index+1]; + HexStr[1] = Buffer[Index+2]; + ResultBuffer[Offset] = (CHAR8) AsciiStrHexToUintn (HexStr); + Index += 3; + } else { + ResultBuffer[Offset] = Buffer[Index]; + Index++; + } + Offset++; + } + + *ResultLength = (UINT32) Offset; + + return EFI_SUCCESS; +} + +/** + This function return the updated state according to the input state and next character of + the authority. + + @param[in] Char Next character. + @param[in] State Current value of the parser state machine. + @param[in] IsRightBracket TRUE if there is an sign ']' in the authority component and + indicates the next part is ':' before Port. + + @return Updated state value. +**/ +HTTP_URL_PARSE_STATE +NetHttpParseAuthorityChar ( + IN CHAR8 Char, + IN HTTP_URL_PARSE_STATE State, + IN BOOLEAN *IsRightBracket + ) +{ + + // + // RFC 3986: + // The authority component is preceded by a double slash ("//") and is + // terminated by the next slash ("/"), question mark ("?"), or number + // sign ("#") character, or by the end of the URI. + // + if (Char == ' ' || Char == '\r' || Char == '\n') { + return UrlParserStateMax; + } + + // + // authority = [ userinfo "@" ] host [ ":" port ] + // + switch (State) { + case UrlParserUserInfo: + if (Char == '@') { + return UrlParserHostStart; + } + break; + + case UrlParserHost: + case UrlParserHostStart: + if (Char == '[') { + return UrlParserHostIpv6; + } + + if (Char == ':') { + return UrlParserPortStart; + } + + return UrlParserHost; + + case UrlParserHostIpv6: + if (Char == ']') { + *IsRightBracket = TRUE; + } + + if (Char == ':' && *IsRightBracket) { + return UrlParserPortStart; + } + return UrlParserHostIpv6; + + case UrlParserPort: + case UrlParserPortStart: + return UrlParserPort; + + default: + break; + } + + return State; +} + +/** + This function parse the authority component of the input URL and update the parser. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] FoundAt TRUE if there is an at sign ('@') in the authority component. + @param[in, out] UrlParser Pointer to the buffer of the parse result. + + @retval EFI_SUCCESS Successfully parse the authority. + @retval EFI_INVALID_PARAMETER The Url is invalid to parse the authority component. + +**/ +EFI_STATUS +NetHttpParseAuthority ( + IN CHAR8 *Url, + IN BOOLEAN FoundAt, + IN OUT HTTP_URL_PARSER *UrlParser + ) +{ + CHAR8 *Char; + CHAR8 *Authority; + UINT32 Length; + HTTP_URL_PARSE_STATE State; + UINT32 Field; + UINT32 OldField; + BOOLEAN IsrightBracket; + + ASSERT ((UrlParser->FieldBitMap & BIT (HTTP_URI_FIELD_AUTHORITY)) != 0); + + // + // authority = [ userinfo "@" ] host [ ":" port ] + // + if (FoundAt) { + State = UrlParserUserInfo; + } else { + State = UrlParserHost; + } + + IsrightBracket = FALSE; + Field = HTTP_URI_FIELD_MAX; + OldField = Field; + Authority = Url + UrlParser->FieldData[HTTP_URI_FIELD_AUTHORITY].Offset; + Length = UrlParser->FieldData[HTTP_URI_FIELD_AUTHORITY].Length; + for (Char = Authority; Char < Authority + Length; Char++) { + State = NetHttpParseAuthorityChar (*Char, State, &IsrightBracket); + switch (State) { + case UrlParserStateMax: + return EFI_INVALID_PARAMETER; + + case UrlParserHostStart: + case UrlParserPortStart: + continue; + + case UrlParserUserInfo: + Field = HTTP_URI_FIELD_USERINFO; + break; + + case UrlParserHost: + Field = HTTP_URI_FIELD_HOST; + break; + + case UrlParserHostIpv6: + Field = HTTP_URI_FIELD_HOST; + break; + + case UrlParserPort: + Field = HTTP_URI_FIELD_PORT; + break; + + default: + ASSERT (FALSE); + } + + // + // Field not changed, count the length. + // + ASSERT (Field < HTTP_URI_FIELD_MAX); + if (Field == OldField) { + UrlParser->FieldData[Field].Length++; + continue; + } + + // + // New field start + // + UrlParser->FieldBitMap |= BIT (Field); + UrlParser->FieldData[Field].Offset = (UINT32) (Char - Url); + UrlParser->FieldData[Field].Length = 1; + OldField = Field; + } + + return EFI_SUCCESS; +} + +/** + This function return the updated state according to the input state and next character of a URL. + + @param[in] Char Next character. + @param[in] State Current value of the parser state machine. + + @return Updated state value. + +**/ +HTTP_URL_PARSE_STATE +NetHttpParseUrlChar ( + IN CHAR8 Char, + IN HTTP_URL_PARSE_STATE State + ) +{ + if (Char == ' ' || Char == '\r' || Char == '\n') { + return UrlParserStateMax; + } + + // + // http_URL = "http:" "//" host [ ":" port ] [ abs_path [ "?" query ]] + // + // Request-URI = "*" | absolute-URI | path-absolute | authority + // + // absolute-URI = scheme ":" hier-part [ "?" query ] + // path-absolute = "/" [ segment-nz *( "/" segment ) ] + // authority = [ userinfo "@" ] host [ ":" port ] + // + switch (State) { + case UrlParserUrlStart: + if (Char == '*' || Char == '/') { + return UrlParserPath; + } + return UrlParserScheme; + + case UrlParserScheme: + if (Char == ':') { + return UrlParserSchemeColon; + } + break; + + case UrlParserSchemeColon: + if (Char == '/') { + return UrlParserSchemeColonSlash; + } + break; + + case UrlParserSchemeColonSlash: + if (Char == '/') { + return UrlParserSchemeColonSlashSlash; + } + break; + + case UrlParserAtInAuthority: + if (Char == '@') { + return UrlParserStateMax; + } + + case UrlParserAuthority: + case UrlParserSchemeColonSlashSlash: + if (Char == '@') { + return UrlParserAtInAuthority; + } + if (Char == '/') { + return UrlParserPath; + } + if (Char == '?') { + return UrlParserQueryStart; + } + if (Char == '#') { + return UrlParserFragmentStart; + } + return UrlParserAuthority; + + case UrlParserPath: + if (Char == '?') { + return UrlParserQueryStart; + } + if (Char == '#') { + return UrlParserFragmentStart; + } + break; + + case UrlParserQuery: + case UrlParserQueryStart: + if (Char == '#') { + return UrlParserFragmentStart; + } + return UrlParserQuery; + + case UrlParserFragmentStart: + return UrlParserFragment; + + default: + break; + } + + return State; +} +/** + Create a URL parser for the input URL string. + + This function will parse and dereference the input HTTP URL into it components. The original + content of the URL won't be modified and the result will be returned in UrlParser, which can + be used in other functions like NetHttpUrlGetHostName(). + + @param[in] Url The pointer to a HTTP URL string. + @param[in] Length Length of Url in bytes. + @param[in] IsConnectMethod Whether the Url is used in HTTP CONNECT method or not. + @param[out] UrlParser Pointer to the returned buffer to store the parse result. + + @retval EFI_SUCCESS Successfully dereferenced the HTTP URL. + @retval EFI_INVALID_PARAMETER UrlParser is NULL or Url is not a valid HTTP URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpParseUrl ( + IN CHAR8 *Url, + IN UINT32 Length, + IN BOOLEAN IsConnectMethod, + OUT VOID **UrlParser + ) +{ + HTTP_URL_PARSE_STATE State; + CHAR8 *Char; + UINT32 Field; + UINT32 OldField; + BOOLEAN FoundAt; + EFI_STATUS Status; + HTTP_URL_PARSER *Parser; + + Parser = NULL; + + if (Url == NULL || Length == 0 || UrlParser == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = AllocateZeroPool (sizeof (HTTP_URL_PARSER)); + if (Parser == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + if (IsConnectMethod) { + // + // According to RFC 2616, the authority form is only used by the CONNECT method. + // + State = UrlParserAuthority; + } else { + State = UrlParserUrlStart; + } + + Field = HTTP_URI_FIELD_MAX; + OldField = Field; + FoundAt = FALSE; + for (Char = Url; Char < Url + Length; Char++) { + // + // Update state machine according to next char. + // + State = NetHttpParseUrlChar (*Char, State); + + switch (State) { + case UrlParserStateMax: + FreePool (Parser); + return EFI_INVALID_PARAMETER; + + case UrlParserSchemeColon: + case UrlParserSchemeColonSlash: + case UrlParserSchemeColonSlashSlash: + case UrlParserQueryStart: + case UrlParserFragmentStart: + // + // Skip all the delimiting char: "://" "?" "@" + // + continue; + + case UrlParserScheme: + Field = HTTP_URI_FIELD_SCHEME; + break; + + case UrlParserAtInAuthority: + FoundAt = TRUE; + case UrlParserAuthority: + Field = HTTP_URI_FIELD_AUTHORITY; + break; + + case UrlParserPath: + Field = HTTP_URI_FIELD_PATH; + break; + + case UrlParserQuery: + Field = HTTP_URI_FIELD_QUERY; + break; + + case UrlParserFragment: + Field = HTTP_URI_FIELD_FRAGMENT; + break; + + default: + ASSERT (FALSE); + } + + // + // Field not changed, count the length. + // + ASSERT (Field < HTTP_URI_FIELD_MAX); + if (Field == OldField) { + Parser->FieldData[Field].Length++; + continue; + } + + // + // New field start + // + Parser->FieldBitMap |= BIT (Field); + Parser->FieldData[Field].Offset = (UINT32) (Char - Url); + Parser->FieldData[Field].Length = 1; + OldField = Field; + } + + // + // If has authority component, continue to parse the username, host and port. + // + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_AUTHORITY)) != 0) { + Status = NetHttpParseAuthority (Url, FoundAt, Parser); + if (EFI_ERROR (Status)) { + FreePool (Parser); + return Status; + } + } + + *UrlParser = Parser; + return EFI_SUCCESS; +} + +/** + Get the Hostname from a HTTP URL. + + This function will return the HostName according to the Url and previous parse result ,and + it is the caller's responsibility to free the buffer returned in *HostName. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] UrlParser URL Parse result returned by NetHttpParseUrl(). + @param[out] HostName Pointer to a buffer to store the HostName. + + @retval EFI_SUCCESS Successfully get the required component. + @retval EFI_INVALID_PARAMETER Uri is NULL or HostName is NULL or UrlParser is invalid. + @retval EFI_NOT_FOUND No hostName component in the URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpUrlGetHostName ( + IN CHAR8 *Url, + IN VOID *UrlParser, + OUT CHAR8 **HostName + ) +{ + CHAR8 *Name; + EFI_STATUS Status; + UINT32 ResultLength; + HTTP_URL_PARSER *Parser; + + if (Url == NULL || UrlParser == NULL || HostName == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_URL_PARSER *) UrlParser; + + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_HOST)) == 0) { + return EFI_NOT_FOUND; + } + + Name = AllocatePool (Parser->FieldData[HTTP_URI_FIELD_HOST].Length + 1); + if (Name == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Status = UriPercentDecode ( + Url + Parser->FieldData[HTTP_URI_FIELD_HOST].Offset, + Parser->FieldData[HTTP_URI_FIELD_HOST].Length, + Name, + &ResultLength + ); + if (EFI_ERROR (Status)) { + FreePool (Name); + return Status; + } + + Name[ResultLength] = '\0'; + *HostName = Name; + return EFI_SUCCESS; +} + + +/** + Get the IPv4 address from a HTTP URL. + + This function will return the IPv4 address according to the Url and previous parse result. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] UrlParser URL Parse result returned by NetHttpParseUrl(). + @param[out] Ip4Address Pointer to a buffer to store the IP address. + + @retval EFI_SUCCESS Successfully get the required component. + @retval EFI_INVALID_PARAMETER Uri is NULL or Ip4Address is NULL or UrlParser is invalid. + @retval EFI_NOT_FOUND No IPv4 address component in the URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpUrlGetIp4 ( + IN CHAR8 *Url, + IN VOID *UrlParser, + OUT EFI_IPv4_ADDRESS *Ip4Address + ) +{ + CHAR8 *Ip4String; + EFI_STATUS Status; + UINT32 ResultLength; + HTTP_URL_PARSER *Parser; + + if (Url == NULL || UrlParser == NULL || Ip4Address == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_URL_PARSER *) UrlParser; + + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_HOST)) == 0) { + return EFI_NOT_FOUND; + } + + Ip4String = AllocatePool (Parser->FieldData[HTTP_URI_FIELD_HOST].Length + 1); + if (Ip4String == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Status = UriPercentDecode ( + Url + Parser->FieldData[HTTP_URI_FIELD_HOST].Offset, + Parser->FieldData[HTTP_URI_FIELD_HOST].Length, + Ip4String, + &ResultLength + ); + if (EFI_ERROR (Status)) { + FreePool (Ip4String); + return Status; + } + + Ip4String[ResultLength] = '\0'; + Status = NetLibAsciiStrToIp4 (Ip4String, Ip4Address); + FreePool (Ip4String); + + return Status; +} + +/** + Get the IPv6 address from a HTTP URL. + + This function will return the IPv6 address according to the Url and previous parse result. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] UrlParser URL Parse result returned by NetHttpParseUrl(). + @param[out] Ip6Address Pointer to a buffer to store the IP address. + + @retval EFI_SUCCESS Successfully get the required component. + @retval EFI_INVALID_PARAMETER Uri is NULL or Ip6Address is NULL or UrlParser is invalid. + @retval EFI_NOT_FOUND No IPv6 address component in the URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpUrlGetIp6 ( + IN CHAR8 *Url, + IN VOID *UrlParser, + OUT EFI_IPv6_ADDRESS *Ip6Address + ) +{ + CHAR8 *Ip6String; + CHAR8 *Ptr; + UINT32 Length; + EFI_STATUS Status; + UINT32 ResultLength; + HTTP_URL_PARSER *Parser; + + if (Url == NULL || UrlParser == NULL || Ip6Address == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_URL_PARSER *) UrlParser; + + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_HOST)) == 0) { + return EFI_NOT_FOUND; + } + + // + // IP-literal = "[" ( IPv6address / IPvFuture ) "]" + // + Length = Parser->FieldData[HTTP_URI_FIELD_HOST].Length; + if (Length < 2) { + return EFI_INVALID_PARAMETER; + } + + Ptr = Url + Parser->FieldData[HTTP_URI_FIELD_HOST].Offset; + if ((Ptr[0] != '[') || (Ptr[Length - 1] != ']')) { + return EFI_INVALID_PARAMETER; + } + + Ip6String = AllocatePool (Length); + if (Ip6String == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Status = UriPercentDecode ( + Ptr + 1, + Length - 2, + Ip6String, + &ResultLength + ); + if (EFI_ERROR (Status)) { + FreePool (Ip6String); + return Status; + } + + Ip6String[ResultLength] = '\0'; + Status = NetLibAsciiStrToIp6 (Ip6String, Ip6Address); + FreePool (Ip6String); + + return Status; +} + +/** + Get the port number from a HTTP URL. + + This function will return the port number according to the Url and previous parse result. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] UrlParser URL Parse result returned by NetHttpParseUrl(). + @param[out] Port Pointer to a buffer to store the port number. + + @retval EFI_SUCCESS Successfully get the required component. + @retval EFI_INVALID_PARAMETER Uri is NULL or Port is NULL or UrlParser is invalid. + @retval EFI_NOT_FOUND No port number in the URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpUrlGetPort ( + IN CHAR8 *Url, + IN VOID *UrlParser, + OUT UINT16 *Port + ) +{ + CHAR8 *PortString; + EFI_STATUS Status; + UINTN Index; + UINTN Data; + UINT32 ResultLength; + HTTP_URL_PARSER *Parser; + + if (Url == NULL || UrlParser == NULL || Port == NULL) { + return EFI_INVALID_PARAMETER; + } + + *Port = 0; + Index = 0; + + Parser = (HTTP_URL_PARSER *) UrlParser; + + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_PORT)) == 0) { + return EFI_NOT_FOUND; + } + + PortString = AllocatePool (Parser->FieldData[HTTP_URI_FIELD_PORT].Length + 1); + if (PortString == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Status = UriPercentDecode ( + Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, + Parser->FieldData[HTTP_URI_FIELD_PORT].Length, + PortString, + &ResultLength + ); + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + + PortString[ResultLength] = '\0'; + + while (Index < ResultLength) { + if (!NET_IS_DIGIT (PortString[Index])) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; + } + Index ++; + } + + Status = AsciiStrDecimalToUintnS (Url + Parser->FieldData[HTTP_URI_FIELD_PORT].Offset, (CHAR8 **) NULL, &Data); + + if (Data > HTTP_URI_PORT_MAX_NUM) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; + } + + *Port = (UINT16) Data; + +ON_EXIT: + FreePool (PortString); + return Status; +} + +/** + Get the Path from a HTTP URL. + + This function will return the Path according to the Url and previous parse result,and + it is the caller's responsibility to free the buffer returned in *Path. + + @param[in] Url The pointer to a HTTP URL string. + @param[in] UrlParser URL Parse result returned by NetHttpParseUrl(). + @param[out] Path Pointer to a buffer to store the Path. + + @retval EFI_SUCCESS Successfully get the required component. + @retval EFI_INVALID_PARAMETER Uri is NULL or HostName is NULL or UrlParser is invalid. + @retval EFI_NOT_FOUND No hostName component in the URL. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + +**/ +EFI_STATUS +EFIAPI +HttpUrlGetPath ( + IN CHAR8 *Url, + IN VOID *UrlParser, + OUT CHAR8 **Path + ) +{ + CHAR8 *PathStr; + EFI_STATUS Status; + UINT32 ResultLength; + HTTP_URL_PARSER *Parser; + + if (Url == NULL || UrlParser == NULL || Path == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_URL_PARSER *) UrlParser; + + if ((Parser->FieldBitMap & BIT (HTTP_URI_FIELD_PATH)) == 0) { + return EFI_NOT_FOUND; + } + + PathStr = AllocatePool (Parser->FieldData[HTTP_URI_FIELD_PATH].Length + 1); + if (PathStr == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Status = UriPercentDecode ( + Url + Parser->FieldData[HTTP_URI_FIELD_PATH].Offset, + Parser->FieldData[HTTP_URI_FIELD_PATH].Length, + PathStr, + &ResultLength + ); + if (EFI_ERROR (Status)) { + FreePool (PathStr); + return Status; + } + + PathStr[ResultLength] = '\0'; + *Path = PathStr; + return EFI_SUCCESS; +} + +/** + Release the resource of the URL parser. + + @param[in] UrlParser Pointer to the parser. + +**/ +VOID +EFIAPI +HttpUrlFreeParser ( + IN VOID *UrlParser + ) +{ + FreePool (UrlParser); +} + +/** + Find a specified header field according to the field name. + + @param[in] HeaderCount Number of HTTP header structures in Headers list. + @param[in] Headers Array containing list of HTTP headers. + @param[in] FieldName Null terminated string which describes a field name. + + @return Pointer to the found header or NULL. + +**/ +EFI_HTTP_HEADER * +EFIAPI +HttpFindHeader ( + IN UINTN HeaderCount, + IN EFI_HTTP_HEADER *Headers, + IN CHAR8 *FieldName + ) +{ + UINTN Index; + + if (HeaderCount == 0 || Headers == NULL || FieldName == NULL) { + return NULL; + } + + for (Index = 0; Index < HeaderCount; Index++){ + // + // Field names are case-insensitive (RFC 2616). + // + if (AsciiStriCmp (Headers[Index].FieldName, FieldName) == 0) { + return &Headers[Index]; + } + } + return NULL; +} + +typedef enum { + BodyParserBodyStart, + BodyParserBodyIdentity, + BodyParserChunkSizeStart, + BodyParserChunkSize, + BodyParserChunkSizeEndCR, + BodyParserChunkExtStart, + BodyParserChunkDataStart, + BodyParserChunkDataEnd, + BodyParserChunkDataEndCR, + BodyParserTrailer, + BodyParserLastCRLF, + BodyParserLastCRLFEnd, + BodyParserComplete, + BodyParserStateMax +} HTTP_BODY_PARSE_STATE; + +typedef struct { + BOOLEAN IgnoreBody; // "MUST NOT" include a message-body + BOOLEAN IsChunked; // "chunked" transfer-coding. + BOOLEAN ContentLengthIsValid; + UINTN ContentLength; // Entity length (not the message-body length), invalid until ContentLengthIsValid is TRUE + + HTTP_BODY_PARSER_CALLBACK Callback; + VOID *Context; + UINTN ParsedBodyLength; + HTTP_BODY_PARSE_STATE State; + UINTN CurrentChunkSize; + UINTN CurrentChunkParsedSize; +} HTTP_BODY_PARSER; + +/** + + Convert an Ascii char to its uppercase. + + @param[in] Char Ascii character. + + @return Uppercase value of the input Char. + +**/ +CHAR8 +HttpIoCharToUpper ( + IN CHAR8 Char + ) +{ + if (Char >= 'a' && Char <= 'z') { + return Char - ('a' - 'A'); + } + + return Char; +} + +/** + Convert an hexadecimal char to a value of type UINTN. + + @param[in] Char Ascii character. + + @return Value translated from Char. + +**/ +UINTN +HttpIoHexCharToUintn ( + IN CHAR8 Char + ) +{ + if (Char >= '0' && Char <= '9') { + return Char - '0'; + } + + return (10 + HttpIoCharToUpper (Char) - 'A'); +} + +/** + Get the value of the content length if there is a "Content-Length" header. + + @param[in] HeaderCount Number of HTTP header structures in Headers. + @param[in] Headers Array containing list of HTTP headers. + @param[out] ContentLength Pointer to save the value of the content length. + + @retval EFI_SUCCESS Successfully get the content length. + @retval EFI_NOT_FOUND No "Content-Length" header in the Headers. + +**/ +EFI_STATUS +HttpIoParseContentLengthHeader ( + IN UINTN HeaderCount, + IN EFI_HTTP_HEADER *Headers, + OUT UINTN *ContentLength + ) +{ + EFI_HTTP_HEADER *Header; + + Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_CONTENT_LENGTH); + if (Header == NULL) { + return EFI_NOT_FOUND; + } + + return AsciiStrDecimalToUintnS (Header->FieldValue, (CHAR8 **) NULL, ContentLength); +} + +/** + + Check whether the HTTP message is using the "chunked" transfer-coding. + + @param[in] HeaderCount Number of HTTP header structures in Headers. + @param[in] Headers Array containing list of HTTP headers. + + @return The message is "chunked" transfer-coding (TRUE) or not (FALSE). + +**/ +BOOLEAN +HttpIoIsChunked ( + IN UINTN HeaderCount, + IN EFI_HTTP_HEADER *Headers + ) +{ + EFI_HTTP_HEADER *Header; + + + Header = HttpFindHeader (HeaderCount, Headers, HTTP_HEADER_TRANSFER_ENCODING); + if (Header == NULL) { + return FALSE; + } + + if (AsciiStriCmp (Header->FieldValue, "identity") != 0) { + return TRUE; + } + + return FALSE; +} + +/** + Check whether the HTTP message should have a message-body. + + @param[in] Method The HTTP method (e.g. GET, POST) for this HTTP message. + @param[in] StatusCode Response status code returned by the remote host. + + @return The message should have a message-body (FALSE) or not (TRUE). + +**/ +BOOLEAN +HttpIoNoMessageBody ( + IN EFI_HTTP_METHOD Method, + IN EFI_HTTP_STATUS_CODE StatusCode + ) +{ + // + // RFC 2616: + // All responses to the HEAD request method + // MUST NOT include a message-body, even though the presence of entity- + // header fields might lead one to believe they do. All 1xx + // (informational), 204 (no content), and 304 (not modified) responses + // MUST NOT include a message-body. All other responses do include a + // message-body, although it MAY be of zero length. + // + if (Method == HttpMethodHead) { + return TRUE; + } + + if ((StatusCode == HTTP_STATUS_100_CONTINUE) || + (StatusCode == HTTP_STATUS_101_SWITCHING_PROTOCOLS) || + (StatusCode == HTTP_STATUS_204_NO_CONTENT) || + (StatusCode == HTTP_STATUS_304_NOT_MODIFIED)) + { + return TRUE; + } + + return FALSE; +} + +/** + Initialize a HTTP message-body parser. + + This function will create and initialize a HTTP message parser according to caller provided HTTP message + header information. It is the caller's responsibility to free the buffer returned in *UrlParser by HttpFreeMsgParser(). + + @param[in] Method The HTTP method (e.g. GET, POST) for this HTTP message. + @param[in] StatusCode Response status code returned by the remote host. + @param[in] HeaderCount Number of HTTP header structures in Headers. + @param[in] Headers Array containing list of HTTP headers. + @param[in] Callback Callback function that is invoked when parsing the HTTP message-body, + set to NULL to ignore all events. + @param[in] Context Pointer to the context that will be passed to Callback. + @param[out] MsgParser Pointer to the returned buffer to store the message parser. + + @retval EFI_SUCCESS Successfully initialized the parser. + @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources. + @retval EFI_INVALID_PARAMETER MsgParser is NULL or HeaderCount is not NULL but Headers is NULL. + @retval Others Failed to initialize the parser. + +**/ +EFI_STATUS +EFIAPI +HttpInitMsgParser ( + IN EFI_HTTP_METHOD Method, + IN EFI_HTTP_STATUS_CODE StatusCode, + IN UINTN HeaderCount, + IN EFI_HTTP_HEADER *Headers, + IN HTTP_BODY_PARSER_CALLBACK Callback, + IN VOID *Context, + OUT VOID **MsgParser + ) +{ + EFI_STATUS Status; + HTTP_BODY_PARSER *Parser; + + if (HeaderCount != 0 && Headers == NULL) { + return EFI_INVALID_PARAMETER; + } + + if (MsgParser == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = AllocateZeroPool (sizeof (HTTP_BODY_PARSER)); + if (Parser == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Parser->State = BodyParserBodyStart; + + // + // Determine the message length according to RFC 2616. + // 1. Check whether the message "MUST NOT" have a message-body. + // + Parser->IgnoreBody = HttpIoNoMessageBody (Method, StatusCode); + // + // 2. Check whether the message using "chunked" transfer-coding. + // + Parser->IsChunked = HttpIoIsChunked (HeaderCount, Headers); + // + // 3. Check whether the message has a Content-Length header field. + // + Status = HttpIoParseContentLengthHeader (HeaderCount, Headers, &Parser->ContentLength); + if (!EFI_ERROR (Status)) { + Parser->ContentLengthIsValid = TRUE; + } + // + // 4. Range header is not supported now, so we won't meet media type "multipart/byteranges". + // 5. By server closing the connection + // + + // + // Set state to skip body parser if the message shouldn't have a message body. + // + if (Parser->IgnoreBody) { + Parser->State = BodyParserComplete; + } else { + Parser->Callback = Callback; + Parser->Context = Context; + } + + *MsgParser = Parser; + return EFI_SUCCESS; +} + +/** + Parse message body. + + Parse BodyLength of message-body. This function can be called repeatedly to parse the message-body partially. + + @param[in, out] MsgParser Pointer to the message parser. + @param[in] BodyLength Length in bytes of the Body. + @param[in] Body Pointer to the buffer of the message-body to be parsed. + + @retval EFI_SUCCESS Successfully parse the message-body. + @retval EFI_INVALID_PARAMETER MsgParser is NULL or Body is NULL or BodyLength is 0. + @retval EFI_ABORTED Operation aborted. + @retval Other Error happened while parsing message body. + +**/ +EFI_STATUS +EFIAPI +HttpParseMessageBody ( + IN OUT VOID *MsgParser, + IN UINTN BodyLength, + IN CHAR8 *Body + ) +{ + CHAR8 *Char; + UINTN RemainderLengthInThis; + UINTN LengthForCallback; + EFI_STATUS Status; + HTTP_BODY_PARSER *Parser; + + if (BodyLength == 0 || Body == NULL) { + return EFI_INVALID_PARAMETER; + } + + if (MsgParser == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_BODY_PARSER *) MsgParser; + + if (Parser->IgnoreBody) { + Parser->State = BodyParserComplete; + if (Parser->Callback != NULL) { + Status = Parser->Callback ( + BodyParseEventOnComplete, + Body, + 0, + Parser->Context + ); + if (EFI_ERROR (Status)) { + return Status; + } + } + return EFI_SUCCESS; + } + + if (Parser->State == BodyParserBodyStart) { + Parser->ParsedBodyLength = 0; + if (Parser->IsChunked) { + Parser->State = BodyParserChunkSizeStart; + } else { + Parser->State = BodyParserBodyIdentity; + } + } + + // + // The message body might be truncated in anywhere, so we need to parse is byte-by-byte. + // + for (Char = Body; Char < Body + BodyLength; ) { + + switch (Parser->State) { + case BodyParserStateMax: + return EFI_ABORTED; + + case BodyParserBodyIdentity: + // + // Identity transfer-coding, just notify user to save the body data. + // + if (Parser->Callback != NULL) { + Status = Parser->Callback ( + BodyParseEventOnData, + Char, + MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength), + Parser->Context + ); + if (EFI_ERROR (Status)) { + return Status; + } + } + Char += MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength); + Parser->ParsedBodyLength += MIN (BodyLength, Parser->ContentLength - Parser->ParsedBodyLength); + if (Parser->ParsedBodyLength == Parser->ContentLength) { + Parser->State = BodyParserComplete; + if (Parser->Callback != NULL) { + Status = Parser->Callback ( + BodyParseEventOnComplete, + Char, + 0, + Parser->Context + ); + if (EFI_ERROR (Status)) { + return Status; + } + } + } + break; + + case BodyParserChunkSizeStart: + // + // First byte of chunk-size, the chunk-size might be truncated. + // + Parser->CurrentChunkSize = 0; + Parser->State = BodyParserChunkSize; + case BodyParserChunkSize: + if (!NET_IS_HEX_CHAR (*Char)) { + if (*Char == ';') { + Parser->State = BodyParserChunkExtStart; + Char++; + } else if (*Char == '\r') { + Parser->State = BodyParserChunkSizeEndCR; + Char++; + } else { + Parser->State = BodyParserStateMax; + } + break; + } + + if (Parser->CurrentChunkSize > (((~((UINTN) 0)) - 16) / 16)) { + return EFI_INVALID_PARAMETER; + } + Parser->CurrentChunkSize = Parser->CurrentChunkSize * 16 + HttpIoHexCharToUintn (*Char); + Char++; + break; + + case BodyParserChunkExtStart: + // + // Ignore all the chunk extensions. + // + if (*Char == '\r') { + Parser->State = BodyParserChunkSizeEndCR; + } + Char++; + break; + + case BodyParserChunkSizeEndCR: + if (*Char != '\n') { + Parser->State = BodyParserStateMax; + break; + } + Char++; + if (Parser->CurrentChunkSize == 0) { + // + // The last chunk has been parsed and now assumed the state + // of HttpBodyParse is ParserLastCRLF. So it need to decide + // whether the rest message is trailer or last CRLF in the next round. + // + Parser->ContentLengthIsValid = TRUE; + Parser->State = BodyParserLastCRLF; + break; + } + Parser->State = BodyParserChunkDataStart; + Parser->CurrentChunkParsedSize = 0; + break; + + case BodyParserLastCRLF: + // + // Judge the byte is belong to the Last CRLF or trailer, and then + // configure the state of HttpBodyParse to corresponding state. + // + if (*Char == '\r') { + Char++; + Parser->State = BodyParserLastCRLFEnd; + break; + } else { + Parser->State = BodyParserTrailer; + break; + } + + case BodyParserLastCRLFEnd: + if (*Char == '\n') { + Parser->State = BodyParserComplete; + Char++; + if (Parser->Callback != NULL) { + Status = Parser->Callback ( + BodyParseEventOnComplete, + Char, + 0, + Parser->Context + ); + if (EFI_ERROR (Status)) { + return Status; + } + } + break; + } else { + Parser->State = BodyParserStateMax; + break; + } + + case BodyParserTrailer: + if (*Char == '\r') { + Parser->State = BodyParserChunkSizeEndCR; + } + Char++; + break; + + case BodyParserChunkDataStart: + // + // First byte of chunk-data, the chunk data also might be truncated. + // + RemainderLengthInThis = BodyLength - (Char - Body); + LengthForCallback = MIN (Parser->CurrentChunkSize - Parser->CurrentChunkParsedSize, RemainderLengthInThis); + if (Parser->Callback != NULL) { + Status = Parser->Callback ( + BodyParseEventOnData, + Char, + LengthForCallback, + Parser->Context + ); + if (EFI_ERROR (Status)) { + return Status; + } + } + Char += LengthForCallback; + Parser->ContentLength += LengthForCallback; + Parser->CurrentChunkParsedSize += LengthForCallback; + if (Parser->CurrentChunkParsedSize == Parser->CurrentChunkSize) { + Parser->State = BodyParserChunkDataEnd; + } + break; + + case BodyParserChunkDataEnd: + if (*Char == '\r') { + Parser->State = BodyParserChunkDataEndCR; + } else { + Parser->State = BodyParserStateMax; + } + Char++; + break; + + case BodyParserChunkDataEndCR: + if (*Char != '\n') { + Parser->State = BodyParserStateMax; + break; + } + Char++; + Parser->State = BodyParserChunkSizeStart; + break; + + default: + break; + } + + } + + if (Parser->State == BodyParserStateMax) { + return EFI_ABORTED; + } + + return EFI_SUCCESS; +} + +/** + Check whether the message-body is complete or not. + + @param[in] MsgParser Pointer to the message parser. + + @retval TRUE Message-body is complete. + @retval FALSE Message-body is not complete. + +**/ +BOOLEAN +EFIAPI +HttpIsMessageComplete ( + IN VOID *MsgParser + ) +{ + HTTP_BODY_PARSER *Parser; + + if (MsgParser == NULL) { + return FALSE; + } + + Parser = (HTTP_BODY_PARSER *) MsgParser; + + if (Parser->State == BodyParserComplete) { + return TRUE; + } + return FALSE; +} + +/** + Get the content length of the entity. + + Note that in trunk transfer, the entity length is not valid until the whole message body is received. + + @param[in] MsgParser Pointer to the message parser. + @param[out] ContentLength Pointer to store the length of the entity. + + @retval EFI_SUCCESS Successfully to get the entity length. + @retval EFI_NOT_READY Entity length is not valid yet. + @retval EFI_INVALID_PARAMETER MsgParser is NULL or ContentLength is NULL. + +**/ +EFI_STATUS +EFIAPI +HttpGetEntityLength ( + IN VOID *MsgParser, + OUT UINTN *ContentLength + ) +{ + HTTP_BODY_PARSER *Parser; + + if (MsgParser == NULL || ContentLength == NULL) { + return EFI_INVALID_PARAMETER; + } + + Parser = (HTTP_BODY_PARSER *) MsgParser; + + if (!Parser->ContentLengthIsValid) { + return EFI_NOT_READY; + } + + *ContentLength = Parser->ContentLength; + return EFI_SUCCESS; +} + +/** + Release the resource of the message parser. + + @param[in] MsgParser Pointer to the message parser. + +**/ +VOID +EFIAPI +HttpFreeMsgParser ( + IN VOID *MsgParser + ) +{ + FreePool (MsgParser); +} + + +/** + Get the next string, which is distinguished by specified separator. + + @param[in] String Pointer to the string. + @param[in] Separator Specified separator used to distinguish where is the beginning + of next string. + + @return Pointer to the next string. + @return NULL if not find or String is NULL. + +**/ +CHAR8 * +AsciiStrGetNextToken ( + IN CONST CHAR8 *String, + IN CHAR8 Separator + ) +{ + CONST CHAR8 *Token; + + Token = String; + while (TRUE) { + if (*Token == 0) { + return NULL; + } + if (*Token == Separator) { + return (CHAR8 *)(Token + 1); + } + Token++; + } +} + +/** + Set FieldName and FieldValue into specified HttpHeader. + + @param[in,out] HttpHeader Specified HttpHeader. + @param[in] FieldName FieldName of this HttpHeader, a NULL terminated ASCII string. + @param[in] FieldValue FieldValue of this HttpHeader, a NULL terminated ASCII string. + + + @retval EFI_SUCCESS The FieldName and FieldValue are set into HttpHeader successfully. + @retval EFI_INVALID_PARAMETER The parameter is invalid. + @retval EFI_OUT_OF_RESOURCES Failed to allocate resources. + +**/ +EFI_STATUS +EFIAPI +HttpSetFieldNameAndValue ( + IN OUT EFI_HTTP_HEADER *HttpHeader, + IN CONST CHAR8 *FieldName, + IN CONST CHAR8 *FieldValue + ) +{ + UINTN FieldNameSize; + UINTN FieldValueSize; + + if (HttpHeader == NULL || FieldName == NULL || FieldValue == NULL) { + return EFI_INVALID_PARAMETER; + } + + if (HttpHeader->FieldName != NULL) { + FreePool (HttpHeader->FieldName); + } + if (HttpHeader->FieldValue != NULL) { + FreePool (HttpHeader->FieldValue); + } + + FieldNameSize = AsciiStrSize (FieldName); + HttpHeader->FieldName = AllocateZeroPool (FieldNameSize); + if (HttpHeader->FieldName == NULL) { + return EFI_OUT_OF_RESOURCES; + } + CopyMem (HttpHeader->FieldName, FieldName, FieldNameSize); + HttpHeader->FieldName[FieldNameSize - 1] = 0; + + FieldValueSize = AsciiStrSize (FieldValue); + HttpHeader->FieldValue = AllocateZeroPool (FieldValueSize); + if (HttpHeader->FieldValue == NULL) { + FreePool (HttpHeader->FieldName); + return EFI_OUT_OF_RESOURCES; + } + CopyMem (HttpHeader->FieldValue, FieldValue, FieldValueSize); + HttpHeader->FieldValue[FieldValueSize - 1] = 0; + + return EFI_SUCCESS; +} + +/** + Get one key/value header pair from the raw string. + + @param[in] String Pointer to the raw string. + @param[out] FieldName Points directly to field name within 'HttpHeader'. + @param[out] FieldValue Points directly to field value within 'HttpHeader'. + + @return Pointer to the next raw string. + @return NULL if no key/value header pair from this raw string. + +**/ +CHAR8 * +EFIAPI +HttpGetFieldNameAndValue ( + IN CHAR8 *String, + OUT CHAR8 **FieldName, + OUT CHAR8 **FieldValue + ) +{ + CHAR8 *FieldNameStr; + CHAR8 *FieldValueStr; + CHAR8 *StrPtr; + CHAR8 *EndofHeader; + + if (String == NULL || FieldName == NULL || FieldValue == NULL) { + return NULL; + } + + *FieldName = NULL; + *FieldValue = NULL; + FieldNameStr = NULL; + FieldValueStr = NULL; + StrPtr = NULL; + EndofHeader = NULL; + + + // + // Check whether the raw HTTP header string is valid or not. + // + EndofHeader = AsciiStrStr (String, "\r\n\r\n"); + if (EndofHeader == NULL) { + return NULL; + } + + // + // Each header field consists of a name followed by a colon (":") and the field value. + // + FieldNameStr = String; + FieldValueStr = AsciiStrGetNextToken (FieldNameStr, ':'); + if (FieldValueStr == NULL) { + return NULL; + } + + // + // Replace ':' with 0 + // + *(FieldValueStr - 1) = 0; + + // + // The field value MAY be preceded by any amount of LWS, though a single SP is preferred. + // Note: LWS = [CRLF] 1*(SP|HT), it can be '\r\n ' or '\r\n\t' or ' ' or '\t'. + // CRLF = '\r\n'. + // SP = ' '. + // HT = '\t' (Tab). + // + while (TRUE) { + if (*FieldValueStr == ' ' || *FieldValueStr == '\t') { + // + // Boundary condition check. + // + if ((UINTN) EndofHeader - (UINTN) FieldValueStr < 1) { + return NULL; + } + + FieldValueStr ++; + } else if (*FieldValueStr == '\r') { + // + // Boundary condition check. + // + if ((UINTN) EndofHeader - (UINTN) FieldValueStr < 3) { + return NULL; + } + + if (*(FieldValueStr + 1) == '\n' && (*(FieldValueStr + 2) == ' ' || *(FieldValueStr + 2) == '\t')) { + FieldValueStr = FieldValueStr + 3; + } + } else { + break; + } + } + + // + // Header fields can be extended over multiple lines by preceding each extra + // line with at least one SP or HT. + // + StrPtr = FieldValueStr; + do { + StrPtr = AsciiStrGetNextToken (StrPtr, '\r'); + if (StrPtr == NULL || *StrPtr != '\n') { + return NULL; + } + + StrPtr++; + } while (*StrPtr == ' ' || *StrPtr == '\t'); + + // + // Replace '\r' with 0 + // + *(StrPtr - 2) = 0; + + // + // Get FieldName and FieldValue. + // + *FieldName = FieldNameStr; + *FieldValue = FieldValueStr; + + return StrPtr; +} + +/** + Free existing HeaderFields. + + @param[in] HeaderFields Pointer to array of key/value header pairs waitting for free. + @param[in] FieldCount The number of header pairs in HeaderFields. + +**/ +VOID +EFIAPI +HttpFreeHeaderFields ( + IN EFI_HTTP_HEADER *HeaderFields, + IN UINTN FieldCount + ) +{ + UINTN Index; + + if (HeaderFields != NULL) { + for (Index = 0; Index < FieldCount; Index++) { + if (HeaderFields[Index].FieldName != NULL) { + FreePool (HeaderFields[Index].FieldName); + } + if (HeaderFields[Index].FieldValue != NULL) { + FreePool (HeaderFields[Index].FieldValue); + } + } + + FreePool (HeaderFields); + } +} + +/** + Generate HTTP request message. + + This function will allocate memory for the whole HTTP message and generate a + well formatted HTTP Request message in it, include the Request-Line, header + fields and also the message body. It is the caller's responsibility to free + the buffer returned in *RequestMsg. + + @param[in] Message Pointer to the EFI_HTTP_MESSAGE structure which + contains the required information to generate + the HTTP request message. + @param[in] Url The URL of a remote host. + @param[out] RequestMsg Pointer to the created HTTP request message. + NULL if any error occured. + @param[out] RequestMsgSize Size of the RequestMsg (in bytes). + + @retval EFI_SUCCESS If HTTP request string was created successfully. + @retval EFI_OUT_OF_RESOURCES Failed to allocate resources. + @retval EFI_INVALID_PARAMETER The input arguments are invalid. + +**/ +EFI_STATUS +EFIAPI +HttpGenRequestMessage ( + IN CONST EFI_HTTP_MESSAGE *Message, + IN CONST CHAR8 *Url, + OUT CHAR8 **RequestMsg, + OUT UINTN *RequestMsgSize + ) +{ + EFI_STATUS Status; + UINTN StrLength; + CHAR8 *RequestPtr; + UINTN HttpHdrSize; + UINTN MsgSize; + BOOLEAN Success; + VOID *HttpHdr; + EFI_HTTP_HEADER **AppendList; + UINTN Index; + EFI_HTTP_UTILITIES_PROTOCOL *HttpUtilitiesProtocol; + + Status = EFI_SUCCESS; + HttpHdrSize = 0; + MsgSize = 0; + Success = FALSE; + HttpHdr = NULL; + AppendList = NULL; + HttpUtilitiesProtocol = NULL; + + // + // 1. If we have a Request, we cannot have a NULL Url + // 2. If we have a Request, HeaderCount can not be non-zero + // 3. If we do not have a Request, HeaderCount should be zero + // 4. If we do not have Request and Headers, we need at least a message-body + // + if ((Message == NULL || RequestMsg == NULL || RequestMsgSize == NULL) || + (Message->Data.Request != NULL && Url == NULL) || + (Message->Data.Request != NULL && Message->HeaderCount == 0) || + (Message->Data.Request == NULL && Message->HeaderCount != 0) || + (Message->Data.Request == NULL && Message->HeaderCount == 0 && Message->BodyLength == 0)) { + return EFI_INVALID_PARAMETER; + } + + if (Message->HeaderCount != 0) { + // + // Locate the HTTP_UTILITIES protocol. + // + Status = gBS->LocateProtocol ( + &gEfiHttpUtilitiesProtocolGuid, + NULL, + (VOID **) &HttpUtilitiesProtocol + ); + + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR,"Failed to locate Http Utilities protocol. Status = %r.\n", Status)); + return Status; + } + + // + // Build AppendList to send into HttpUtilitiesBuild + // + AppendList = AllocateZeroPool (sizeof (EFI_HTTP_HEADER *) * (Message->HeaderCount)); + if (AppendList == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + for(Index = 0; Index < Message->HeaderCount; Index++){ + AppendList[Index] = &Message->Headers[Index]; + } + + // + // Build raw HTTP Headers + // + Status = HttpUtilitiesProtocol->Build ( + HttpUtilitiesProtocol, + 0, + NULL, + 0, + NULL, + Message->HeaderCount, + AppendList, + &HttpHdrSize, + &HttpHdr + ); + + FreePool (AppendList); + + if (EFI_ERROR (Status) || HttpHdr == NULL){ + return Status; + } + } + + // + // If we have headers to be sent, account for it. + // + if (Message->HeaderCount != 0) { + MsgSize = HttpHdrSize; + } + + // + // If we have a request line, account for the fields. + // + if (Message->Data.Request != NULL) { + MsgSize += HTTP_METHOD_MAXIMUM_LEN + AsciiStrLen (HTTP_VERSION_CRLF_STR) + AsciiStrLen (Url); + } + + + // + // If we have a message body to be sent, account for it. + // + MsgSize += Message->BodyLength; + + // + // memory for the string that needs to be sent to TCP + // + *RequestMsg = NULL; + *RequestMsg = AllocateZeroPool (MsgSize); + if (*RequestMsg == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Exit; + } + + RequestPtr = *RequestMsg; + // + // Construct header request + // + if (Message->Data.Request != NULL) { + switch (Message->Data.Request->Method) { + case HttpMethodGet: + StrLength = sizeof (HTTP_METHOD_GET) - 1; + CopyMem (RequestPtr, HTTP_METHOD_GET, StrLength); + RequestPtr += StrLength; + break; + case HttpMethodPut: + StrLength = sizeof (HTTP_METHOD_PUT) - 1; + CopyMem (RequestPtr, HTTP_METHOD_PUT, StrLength); + RequestPtr += StrLength; + break; + case HttpMethodPatch: + StrLength = sizeof (HTTP_METHOD_PATCH) - 1; + CopyMem (RequestPtr, HTTP_METHOD_PATCH, StrLength); + RequestPtr += StrLength; + break; + case HttpMethodPost: + StrLength = sizeof (HTTP_METHOD_POST) - 1; + CopyMem (RequestPtr, HTTP_METHOD_POST, StrLength); + RequestPtr += StrLength; + break; + case HttpMethodHead: + StrLength = sizeof (HTTP_METHOD_HEAD) - 1; + CopyMem (RequestPtr, HTTP_METHOD_HEAD, StrLength); + RequestPtr += StrLength; + break; + case HttpMethodDelete: + StrLength = sizeof (HTTP_METHOD_DELETE) - 1; + CopyMem (RequestPtr, HTTP_METHOD_DELETE, StrLength); + RequestPtr += StrLength; + break; + default: + ASSERT (FALSE); + Status = EFI_INVALID_PARAMETER; + goto Exit; + } + + StrLength = AsciiStrLen(EMPTY_SPACE); + CopyMem (RequestPtr, EMPTY_SPACE, StrLength); + RequestPtr += StrLength; + + StrLength = AsciiStrLen (Url); + CopyMem (RequestPtr, Url, StrLength); + RequestPtr += StrLength; + + StrLength = sizeof (HTTP_VERSION_CRLF_STR) - 1; + CopyMem (RequestPtr, HTTP_VERSION_CRLF_STR, StrLength); + RequestPtr += StrLength; + + if (HttpHdr != NULL) { + // + // Construct header + // + CopyMem (RequestPtr, HttpHdr, HttpHdrSize); + RequestPtr += HttpHdrSize; + } + } + + // + // Construct body + // + if (Message->Body != NULL) { + CopyMem (RequestPtr, Message->Body, Message->BodyLength); + RequestPtr += Message->BodyLength; + } + + // + // Done + // + (*RequestMsgSize) = (UINTN)(RequestPtr) - (UINTN)(*RequestMsg); + Success = TRUE; + +Exit: + + if (!Success) { + if (*RequestMsg != NULL) { + FreePool (*RequestMsg); + } + *RequestMsg = NULL; + return Status; + } + + if (HttpHdr != NULL) { + FreePool (HttpHdr); + } + + return EFI_SUCCESS; +} + +/** + Translate the status code in HTTP message to EFI_HTTP_STATUS_CODE defined + in UEFI 2.5 specification. + + @param[in] StatusCode The status code value in HTTP message. + + @return Value defined in EFI_HTTP_STATUS_CODE . + +**/ +EFI_HTTP_STATUS_CODE +EFIAPI +HttpMappingToStatusCode ( + IN UINTN StatusCode + ) +{ + switch (StatusCode) { + case 100: + return HTTP_STATUS_100_CONTINUE; + case 101: + return HTTP_STATUS_101_SWITCHING_PROTOCOLS; + case 200: + return HTTP_STATUS_200_OK; + case 201: + return HTTP_STATUS_201_CREATED; + case 202: + return HTTP_STATUS_202_ACCEPTED; + case 203: + return HTTP_STATUS_203_NON_AUTHORITATIVE_INFORMATION; + case 204: + return HTTP_STATUS_204_NO_CONTENT; + case 205: + return HTTP_STATUS_205_RESET_CONTENT; + case 206: + return HTTP_STATUS_206_PARTIAL_CONTENT; + case 300: + return HTTP_STATUS_300_MULTIPLE_CHOICES; + case 301: + return HTTP_STATUS_301_MOVED_PERMANENTLY; + case 302: + return HTTP_STATUS_302_FOUND; + case 303: + return HTTP_STATUS_303_SEE_OTHER; + case 304: + return HTTP_STATUS_304_NOT_MODIFIED; + case 305: + return HTTP_STATUS_305_USE_PROXY; + case 307: + return HTTP_STATUS_307_TEMPORARY_REDIRECT; + case 308: + return HTTP_STATUS_308_PERMANENT_REDIRECT; + case 400: + return HTTP_STATUS_400_BAD_REQUEST; + case 401: + return HTTP_STATUS_401_UNAUTHORIZED; + case 402: + return HTTP_STATUS_402_PAYMENT_REQUIRED; + case 403: + return HTTP_STATUS_403_FORBIDDEN; + case 404: + return HTTP_STATUS_404_NOT_FOUND; + case 405: + return HTTP_STATUS_405_METHOD_NOT_ALLOWED; + case 406: + return HTTP_STATUS_406_NOT_ACCEPTABLE; + case 407: + return HTTP_STATUS_407_PROXY_AUTHENTICATION_REQUIRED; + case 408: + return HTTP_STATUS_408_REQUEST_TIME_OUT; + case 409: + return HTTP_STATUS_409_CONFLICT; + case 410: + return HTTP_STATUS_410_GONE; + case 411: + return HTTP_STATUS_411_LENGTH_REQUIRED; + case 412: + return HTTP_STATUS_412_PRECONDITION_FAILED; + case 413: + return HTTP_STATUS_413_REQUEST_ENTITY_TOO_LARGE; + case 414: + return HTTP_STATUS_414_REQUEST_URI_TOO_LARGE; + case 415: + return HTTP_STATUS_415_UNSUPPORTED_MEDIA_TYPE; + case 416: + return HTTP_STATUS_416_REQUESTED_RANGE_NOT_SATISFIED; + case 417: + return HTTP_STATUS_417_EXPECTATION_FAILED; + case 500: + return HTTP_STATUS_500_INTERNAL_SERVER_ERROR; + case 501: + return HTTP_STATUS_501_NOT_IMPLEMENTED; + case 502: + return HTTP_STATUS_502_BAD_GATEWAY; + case 503: + return HTTP_STATUS_503_SERVICE_UNAVAILABLE; + case 504: + return HTTP_STATUS_504_GATEWAY_TIME_OUT; + case 505: + return HTTP_STATUS_505_HTTP_VERSION_NOT_SUPPORTED; + + default: + return HTTP_STATUS_UNSUPPORTED_STATUS; + } +} + +/** + Check whether header field called FieldName is in DeleteList. + + @param[in] DeleteList Pointer to array of key/value header pairs. + @param[in] DeleteCount The number of header pairs. + @param[in] FieldName Pointer to header field's name. + + @return TRUE if FieldName is not in DeleteList, that means this header field is valid. + @return FALSE if FieldName is in DeleteList, that means this header field is invalid. + +**/ +BOOLEAN +EFIAPI +HttpIsValidHttpHeader ( + IN CHAR8 *DeleteList[], + IN UINTN DeleteCount, + IN CHAR8 *FieldName + ) +{ + UINTN Index; + + if (FieldName == NULL) { + return FALSE; + } + + for (Index = 0; Index < DeleteCount; Index++) { + if (DeleteList[Index] == NULL) { + continue; + } + + if (AsciiStrCmp (FieldName, DeleteList[Index]) == 0) { + return FALSE; + } + } + + return TRUE; +} + diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h new file mode 100644 index 000000000..af82c16fc --- /dev/null +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.h @@ -0,0 +1,91 @@ +/** @file +Header file for HttpLib. + + Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
+ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+ + 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. + +**/ + +#ifndef _DXE_HTTP_LIB_H_ +#define _DXE_HTTP_LIB_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BIT(x) (1 << x) + +#define HTTP_VERSION_CRLF_STR " HTTP/1.1\r\n" +#define EMPTY_SPACE " " + +#define NET_IS_HEX_CHAR(Ch) \ + ((('0' <= (Ch)) && ((Ch) <= '9')) || \ + (('A' <= (Ch)) && ((Ch) <= 'F')) || \ + (('a' <= (Ch)) && ((Ch) <= 'f'))) + +// +// Field index of the HTTP URL parse result. +// +#define HTTP_URI_FIELD_SCHEME 0 +#define HTTP_URI_FIELD_AUTHORITY 1 +#define HTTP_URI_FIELD_PATH 2 +#define HTTP_URI_FIELD_QUERY 3 +#define HTTP_URI_FIELD_FRAGMENT 4 +#define HTTP_URI_FIELD_USERINFO 5 +#define HTTP_URI_FIELD_HOST 6 +#define HTTP_URI_FIELD_PORT 7 +#define HTTP_URI_FIELD_MAX 8 + +#define HTTP_URI_PORT_MAX_NUM 65535 + +// +// Structure to store the parse result of a HTTP URL. +// +typedef struct { + UINT32 Offset; + UINT32 Length; +} HTTP_URL_FILED_DATA; + +typedef struct { + UINT16 FieldBitMap; + HTTP_URL_FILED_DATA FieldData[HTTP_URI_FIELD_MAX]; +} HTTP_URL_PARSER; + +typedef enum { + UrlParserUrlStart, + UrlParserScheme, + UrlParserSchemeColon, // ":" + UrlParserSchemeColonSlash, // ":/" + UrlParserSchemeColonSlashSlash, // "://" + UrlParserAuthority, + UrlParserAtInAuthority, + UrlParserPath, + UrlParserQueryStart, // "?" + UrlParserQuery, + UrlParserFragmentStart, // "#" + UrlParserFragment, + UrlParserUserInfo, + UrlParserHostStart, // "@" + UrlParserHost, + UrlParserHostIpv6, // "["(Ipv6 address) "]" + UrlParserPortStart, // ":" + UrlParserPort, + UrlParserStateMax +} HTTP_URL_PARSE_STATE; + +#endif + diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf new file mode 100644 index 000000000..92b9b9123 --- /dev/null +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf @@ -0,0 +1,48 @@ +## @file +# It provides the helper routines to parse the HTTP message byte stream. +# +# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+# (C) Copyright 2016 Hewlett Packard Enterprise Development LP
+# 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. +# +## + + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DxeHttpLib + MODULE_UNI_FILE = DxeHttpLib.uni + FILE_GUID = ABBAB4CD-EA88-45b9-8234-C8A7450531FC + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = HttpLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources] + DxeHttpLib.c + DxeHttpLib.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + UefiBootServicesTableLib + MemoryAllocationLib + NetLib + +[Protocols] + gEfiHttpUtilitiesProtocolGuid ## SOMETIMES_CONSUMES \ No newline at end of file diff --git a/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.uni b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.uni new file mode 100644 index 000000000..bde5004b5 --- /dev/null +++ b/MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.uni @@ -0,0 +1,22 @@ +// /** @file +// Provides the helper routines for HTTP. +// +// This library instance provides the helper routines to parse the HTTP message byte stream. +// +// Copyright (c) 2015, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the BSD License +// which accompanies this distribution. The full text of the license may be found at +// http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Provides the helper routines for HTTP" + +#string STR_MODULE_DESCRIPTION #language en-US "This library instance provides the helper routines to parse the HTTP message byte stream." + diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c new file mode 100644 index 000000000..90d2e3e64 --- /dev/null +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.c @@ -0,0 +1,3397 @@ +/** @file + Network library. + +Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved.
+(C) Copyright 2015 Hewlett Packard Enterprise Development LP
+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. +**/ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define NIC_ITEM_CONFIG_SIZE (sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * MAX_IP4_CONFIG_IN_VARIABLE) +#define DEFAULT_ZERO_START ((UINTN) ~0) + +// +// All the supported IP4 maskes in host byte order. +// +GLOBAL_REMOVE_IF_UNREFERENCED IP4_ADDR gIp4AllMasks[IP4_MASK_NUM] = { + 0x00000000, + 0x80000000, + 0xC0000000, + 0xE0000000, + 0xF0000000, + 0xF8000000, + 0xFC000000, + 0xFE000000, + + 0xFF000000, + 0xFF800000, + 0xFFC00000, + 0xFFE00000, + 0xFFF00000, + 0xFFF80000, + 0xFFFC0000, + 0xFFFE0000, + + 0xFFFF0000, + 0xFFFF8000, + 0xFFFFC000, + 0xFFFFE000, + 0xFFFFF000, + 0xFFFFF800, + 0xFFFFFC00, + 0xFFFFFE00, + + 0xFFFFFF00, + 0xFFFFFF80, + 0xFFFFFFC0, + 0xFFFFFFE0, + 0xFFFFFFF0, + 0xFFFFFFF8, + 0xFFFFFFFC, + 0xFFFFFFFE, + 0xFFFFFFFF, +}; + +GLOBAL_REMOVE_IF_UNREFERENCED EFI_IPv4_ADDRESS mZeroIp4Addr = {{0, 0, 0, 0}}; + +// +// Any error level digitally larger than mNetDebugLevelMax +// will be silently discarded. +// +GLOBAL_REMOVE_IF_UNREFERENCED UINTN mNetDebugLevelMax = NETDEBUG_LEVEL_ERROR; +GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mSyslogPacketSeq = 0xDEADBEEF; + +// +// You can change mSyslogDstMac mSyslogDstIp and mSyslogSrcIp +// here to direct the syslog packets to the syslog deamon. The +// default is broadcast to both the ethernet and IP. +// +GLOBAL_REMOVE_IF_UNREFERENCED UINT8 mSyslogDstMac[NET_ETHER_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; +GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mSyslogDstIp = 0xffffffff; +GLOBAL_REMOVE_IF_UNREFERENCED UINT32 mSyslogSrcIp = 0; + +GLOBAL_REMOVE_IF_UNREFERENCED CHAR8 *mMonthName[] = { + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec" +}; + +// +// VLAN device path node template +// +GLOBAL_REMOVE_IF_UNREFERENCED VLAN_DEVICE_PATH mNetVlanDevicePathTemplate = { + { + MESSAGING_DEVICE_PATH, + MSG_VLAN_DP, + { + (UINT8) (sizeof (VLAN_DEVICE_PATH)), + (UINT8) ((sizeof (VLAN_DEVICE_PATH)) >> 8) + } + }, + 0 +}; + +/** + Locate the handles that support SNP, then open one of them + to send the syslog packets. The caller isn't required to close + the SNP after use because the SNP is opened by HandleProtocol. + + @return The point to SNP if one is properly openned. Otherwise NULL + +**/ +EFI_SIMPLE_NETWORK_PROTOCOL * +SyslogLocateSnp ( + VOID + ) +{ + EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + EFI_STATUS Status; + EFI_HANDLE *Handles; + UINTN HandleCount; + UINTN Index; + + // + // Locate the handles which has SNP installed. + // + Handles = NULL; + Status = gBS->LocateHandleBuffer ( + ByProtocol, + &gEfiSimpleNetworkProtocolGuid, + NULL, + &HandleCount, + &Handles + ); + + if (EFI_ERROR (Status) || (HandleCount == 0)) { + return NULL; + } + + // + // Try to open one of the ethernet SNP protocol to send packet + // + Snp = NULL; + + for (Index = 0; Index < HandleCount; Index++) { + Status = gBS->HandleProtocol ( + Handles[Index], + &gEfiSimpleNetworkProtocolGuid, + (VOID **) &Snp + ); + + if ((Status == EFI_SUCCESS) && (Snp != NULL) && + (Snp->Mode->IfType == NET_IFTYPE_ETHERNET) && + (Snp->Mode->MaxPacketSize >= NET_SYSLOG_PACKET_LEN)) { + + break; + } + + Snp = NULL; + } + + FreePool (Handles); + return Snp; +} + +/** + Transmit a syslog packet synchronously through SNP. The Packet + already has the ethernet header prepended. This function should + fill in the source MAC because it will try to locate a SNP each + time it is called to avoid the problem if SNP is unloaded. + This code snip is copied from MNP. + If Packet is NULL, then ASSERT(). + + @param[in] Packet The Syslog packet + @param[in] Length The length of the packet + + @retval EFI_DEVICE_ERROR Failed to locate a usable SNP protocol + @retval EFI_TIMEOUT Timeout happened to send the packet. + @retval EFI_SUCCESS Packet is sent. + +**/ +EFI_STATUS +SyslogSendPacket ( + IN CHAR8 *Packet, + IN UINT32 Length + ) +{ + EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + ETHER_HEAD *Ether; + EFI_STATUS Status; + EFI_EVENT TimeoutEvent; + UINT8 *TxBuf; + + ASSERT (Packet != NULL); + + Snp = SyslogLocateSnp (); + + if (Snp == NULL) { + return EFI_DEVICE_ERROR; + } + + Ether = (ETHER_HEAD *) Packet; + CopyMem (Ether->SrcMac, Snp->Mode->CurrentAddress.Addr, NET_ETHER_ADDR_LEN); + + // + // Start the timeout event. + // + Status = gBS->CreateEvent ( + EVT_TIMER, + TPL_NOTIFY, + NULL, + NULL, + &TimeoutEvent + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + Status = gBS->SetTimer (TimeoutEvent, TimerRelative, NET_SYSLOG_TX_TIMEOUT); + + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + + for (;;) { + // + // Transmit the packet through SNP. + // + Status = Snp->Transmit (Snp, 0, Length, Packet, NULL, NULL, NULL); + + if ((Status != EFI_SUCCESS) && (Status != EFI_NOT_READY)) { + Status = EFI_DEVICE_ERROR; + break; + } + + // + // If Status is EFI_SUCCESS, the packet is put in the transmit queue. + // if Status is EFI_NOT_READY, the transmit engine of the network + // interface is busy. Both need to sync SNP. + // + TxBuf = NULL; + + do { + // + // Get the recycled transmit buffer status. + // + Snp->GetStatus (Snp, NULL, (VOID **) &TxBuf); + + if (!EFI_ERROR (gBS->CheckEvent (TimeoutEvent))) { + Status = EFI_TIMEOUT; + break; + } + + } while (TxBuf == NULL); + + if ((Status == EFI_SUCCESS) || (Status == EFI_TIMEOUT)) { + break; + } + + // + // Status is EFI_NOT_READY. Restart the timer event and + // call Snp->Transmit again. + // + gBS->SetTimer (TimeoutEvent, TimerRelative, NET_SYSLOG_TX_TIMEOUT); + } + + gBS->SetTimer (TimeoutEvent, TimerCancel, 0); + +ON_EXIT: + gBS->CloseEvent (TimeoutEvent); + return Status; +} + +/** + Build a syslog packet, including the Ethernet/Ip/Udp headers + and user's message. + + @param[in] Level Syslog severity level + @param[in] Module The module that generates the log + @param[in] File The file that contains the current log + @param[in] Line The line of code in the File that contains the current log + @param[in] Message The log message + @param[in] BufLen The lenght of the Buf + @param[out] Buf The buffer to put the packet data + + @return The length of the syslog packet built, 0 represents no packet is built. + +**/ +UINT32 +SyslogBuildPacket ( + IN UINT32 Level, + IN UINT8 *Module, + IN UINT8 *File, + IN UINT32 Line, + IN UINT8 *Message, + IN UINT32 BufLen, + OUT CHAR8 *Buf + ) +{ + EFI_STATUS Status; + ETHER_HEAD *Ether; + IP4_HEAD *Ip4; + EFI_UDP_HEADER *Udp4; + EFI_TIME Time; + UINT32 Pri; + UINT32 Len; + + // + // Fill in the Ethernet header. Leave alone the source MAC. + // SyslogSendPacket will fill in the address for us. + // + Ether = (ETHER_HEAD *) Buf; + CopyMem (Ether->DstMac, mSyslogDstMac, NET_ETHER_ADDR_LEN); + ZeroMem (Ether->SrcMac, NET_ETHER_ADDR_LEN); + + Ether->EtherType = HTONS (0x0800); // IPv4 protocol + + Buf += sizeof (ETHER_HEAD); + BufLen -= sizeof (ETHER_HEAD); + + // + // Fill in the IP header + // + Ip4 = (IP4_HEAD *) Buf; + Ip4->HeadLen = 5; + Ip4->Ver = 4; + Ip4->Tos = 0; + Ip4->TotalLen = 0; + Ip4->Id = (UINT16) mSyslogPacketSeq; + Ip4->Fragment = 0; + Ip4->Ttl = 16; + Ip4->Protocol = 0x11; + Ip4->Checksum = 0; + Ip4->Src = mSyslogSrcIp; + Ip4->Dst = mSyslogDstIp; + + Buf += sizeof (IP4_HEAD); + BufLen -= sizeof (IP4_HEAD); + + // + // Fill in the UDP header, Udp checksum is optional. Leave it zero. + // + Udp4 = (EFI_UDP_HEADER *) Buf; + Udp4->SrcPort = HTONS (514); + Udp4->DstPort = HTONS (514); + Udp4->Length = 0; + Udp4->Checksum = 0; + + Buf += sizeof (EFI_UDP_HEADER); + BufLen -= sizeof (EFI_UDP_HEADER); + + // + // Build the syslog message body with Timestamp machine module Message + // + Pri = ((NET_SYSLOG_FACILITY & 31) << 3) | (Level & 7); + Status = gRT->GetTime (&Time, NULL); + if (EFI_ERROR (Status)) { + return 0; + } + + // + // Use %a to format the ASCII strings, %s to format UNICODE strings + // + Len = 0; + Len += (UINT32) AsciiSPrint ( + Buf, + BufLen, + "<%d> %a %d %d:%d:%d ", + Pri, + mMonthName [Time.Month-1], + Time.Day, + Time.Hour, + Time.Minute, + Time.Second + ); + + Len += (UINT32) AsciiSPrint ( + Buf + Len, + BufLen - Len, + "Tiano %a: %a (Line: %d File: %a)", + Module, + Message, + Line, + File + ); + Len ++; + + // + // OK, patch the IP length/checksum and UDP length fields. + // + Len += sizeof (EFI_UDP_HEADER); + Udp4->Length = HTONS ((UINT16) Len); + + Len += sizeof (IP4_HEAD); + Ip4->TotalLen = HTONS ((UINT16) Len); + Ip4->Checksum = (UINT16) (~NetblockChecksum ((UINT8 *) Ip4, sizeof (IP4_HEAD))); + + return Len + sizeof (ETHER_HEAD); +} + +/** + Allocate a buffer, then format the message to it. This is a + help function for the NET_DEBUG_XXX macros. The PrintArg of + these macros treats the variable length print parameters as a + single parameter, and pass it to the NetDebugASPrint. For + example, NET_DEBUG_TRACE ("Tcp", ("State transit to %a\n", Name)) + if extracted to: + + NetDebugOutput ( + NETDEBUG_LEVEL_TRACE, + "Tcp", + __FILE__, + __LINE__, + NetDebugASPrint ("State transit to %a\n", Name) + ) + + If Format is NULL, then ASSERT(). + + @param Format The ASCII format string. + @param ... The variable length parameter whose format is determined + by the Format string. + + @return The buffer containing the formatted message, + or NULL if failed to allocate memory. + +**/ +CHAR8 * +EFIAPI +NetDebugASPrint ( + IN CHAR8 *Format, + ... + ) +{ + VA_LIST Marker; + CHAR8 *Buf; + + ASSERT (Format != NULL); + + Buf = (CHAR8 *) AllocatePool (NET_DEBUG_MSG_LEN); + + if (Buf == NULL) { + return NULL; + } + + VA_START (Marker, Format); + AsciiVSPrint (Buf, NET_DEBUG_MSG_LEN, Format, Marker); + VA_END (Marker); + + return Buf; +} + +/** + Builds an UDP4 syslog packet and send it using SNP. + + This function will locate a instance of SNP then send the message through it. + Because it isn't open the SNP BY_DRIVER, apply caution when using it. + + @param Level The severity level of the message. + @param Module The Moudle that generates the log. + @param File The file that contains the log. + @param Line The exact line that contains the log. + @param Message The user message to log. + + @retval EFI_INVALID_PARAMETER Any input parameter is invalid. + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory for the packet. + @retval EFI_DEVICE_ERROR Device error occurs. + @retval EFI_SUCCESS The log is discard because that it is more verbose + than the mNetDebugLevelMax. Or, it has been sent out. +**/ +EFI_STATUS +EFIAPI +NetDebugOutput ( + IN UINT32 Level, + IN UINT8 *Module, + IN UINT8 *File, + IN UINT32 Line, + IN UINT8 *Message + ) +{ + CHAR8 *Packet; + UINT32 Len; + EFI_STATUS Status; + + // + // Check whether the message should be sent out + // + if (Message == NULL || File == NULL || Module == NULL) { + return EFI_INVALID_PARAMETER; + } + + if (Level > mNetDebugLevelMax) { + Status = EFI_SUCCESS; + goto ON_EXIT; + } + + // + // Allocate a maxium of 1024 bytes, the caller should ensure + // that the message plus the ethernet/ip/udp header is shorter + // than this + // + Packet = (CHAR8 *) AllocatePool (NET_SYSLOG_PACKET_LEN); + + if (Packet == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto ON_EXIT; + } + + // + // Build the message: Ethernet header + IP header + Udp Header + user data + // + Len = SyslogBuildPacket ( + Level, + Module, + File, + Line, + Message, + NET_SYSLOG_PACKET_LEN, + Packet + ); + if (Len == 0) { + Status = EFI_DEVICE_ERROR; + } else { + mSyslogPacketSeq++; + Status = SyslogSendPacket (Packet, Len); + } + + FreePool (Packet); + +ON_EXIT: + FreePool (Message); + return Status; +} +/** + Return the length of the mask. + + Return the length of the mask, the correct value is from 0 to 32. + If the mask is invalid, return the invalid length 33, which is IP4_MASK_NUM. + NetMask is in the host byte order. + + @param[in] NetMask The netmask to get the length from. + + @return The length of the netmask, IP4_MASK_NUM if the mask is invalid. + +**/ +INTN +EFIAPI +NetGetMaskLength ( + IN IP4_ADDR NetMask + ) +{ + INTN Index; + + for (Index = 0; Index <= IP4_MASK_MAX; Index++) { + if (NetMask == gIp4AllMasks[Index]) { + break; + } + } + + return Index; +} + + + +/** + Return the class of the IP address, such as class A, B, C. + Addr is in host byte order. + + [ATTENTION] + Classful addressing (IP class A/B/C) has been deprecated according to RFC4632. + Caller of this function could only check the returned value against + IP4_ADDR_CLASSD (multicast) or IP4_ADDR_CLASSE (reserved) now. + + The address of class A starts with 0. + If the address belong to class A, return IP4_ADDR_CLASSA. + The address of class B starts with 10. + If the address belong to class B, return IP4_ADDR_CLASSB. + The address of class C starts with 110. + If the address belong to class C, return IP4_ADDR_CLASSC. + The address of class D starts with 1110. + If the address belong to class D, return IP4_ADDR_CLASSD. + The address of class E starts with 1111. + If the address belong to class E, return IP4_ADDR_CLASSE. + + + @param[in] Addr The address to get the class from. + + @return IP address class, such as IP4_ADDR_CLASSA. + +**/ +INTN +EFIAPI +NetGetIpClass ( + IN IP4_ADDR Addr + ) +{ + UINT8 ByteOne; + + ByteOne = (UINT8) (Addr >> 24); + + if ((ByteOne & 0x80) == 0) { + return IP4_ADDR_CLASSA; + + } else if ((ByteOne & 0xC0) == 0x80) { + return IP4_ADDR_CLASSB; + + } else if ((ByteOne & 0xE0) == 0xC0) { + return IP4_ADDR_CLASSC; + + } else if ((ByteOne & 0xF0) == 0xE0) { + return IP4_ADDR_CLASSD; + + } else { + return IP4_ADDR_CLASSE; + + } +} + + +/** + Check whether the IP is a valid unicast address according to + the netmask. + + ASSERT if NetMask is zero. + + If all bits of the host address of IP are 0 or 1, IP is also not a valid unicast address, + except when the originator is one of the endpoints of a point-to-point link with a 31-bit + mask (RFC3021). + + @param[in] Ip The IP to check against. + @param[in] NetMask The mask of the IP. + + @return TRUE if IP is a valid unicast address on the network, otherwise FALSE. + +**/ +BOOLEAN +EFIAPI +NetIp4IsUnicast ( + IN IP4_ADDR Ip, + IN IP4_ADDR NetMask + ) +{ + ASSERT (NetMask != 0); + + if (Ip == 0 || IP4_IS_LOCAL_BROADCAST (Ip)) { + return FALSE; + } + + if (NetGetMaskLength (NetMask) != 31) { + if (((Ip &~NetMask) == ~NetMask) || ((Ip &~NetMask) == 0)) { + return FALSE; + } + } else { + return TRUE; + } + + return TRUE; +} + +/** + Check whether the incoming IPv6 address is a valid unicast address. + + ASSERT if Ip6 is NULL. + + If the address is a multicast address has binary 0xFF at the start, it is not + a valid unicast address. If the address is unspecified ::, it is not a valid + unicast address to be assigned to any node. If the address is loopback address + ::1, it is also not a valid unicast address to be assigned to any physical + interface. + + @param[in] Ip6 The IPv6 address to check against. + + @return TRUE if Ip6 is a valid unicast address on the network, otherwise FALSE. + +**/ +BOOLEAN +EFIAPI +NetIp6IsValidUnicast ( + IN EFI_IPv6_ADDRESS *Ip6 + ) +{ + UINT8 Byte; + UINT8 Index; + + ASSERT (Ip6 != NULL); + + if (Ip6->Addr[0] == 0xFF) { + return FALSE; + } + + for (Index = 0; Index < 15; Index++) { + if (Ip6->Addr[Index] != 0) { + return TRUE; + } + } + + Byte = Ip6->Addr[Index]; + + if (Byte == 0x0 || Byte == 0x1) { + return FALSE; + } + + return TRUE; +} + +/** + Check whether the incoming Ipv6 address is the unspecified address or not. + + ASSERT if Ip6 is NULL. + + @param[in] Ip6 - Ip6 address, in network order. + + @retval TRUE - Yes, unspecified + @retval FALSE - No + +**/ +BOOLEAN +EFIAPI +NetIp6IsUnspecifiedAddr ( + IN EFI_IPv6_ADDRESS *Ip6 + ) +{ + UINT8 Index; + + ASSERT (Ip6 != NULL); + + for (Index = 0; Index < 16; Index++) { + if (Ip6->Addr[Index] != 0) { + return FALSE; + } + } + + return TRUE; +} + +/** + Check whether the incoming Ipv6 address is a link-local address. + + ASSERT if Ip6 is NULL. + + @param[in] Ip6 - Ip6 address, in network order. + + @retval TRUE - Yes, link-local address + @retval FALSE - No + +**/ +BOOLEAN +EFIAPI +NetIp6IsLinkLocalAddr ( + IN EFI_IPv6_ADDRESS *Ip6 + ) +{ + UINT8 Index; + + ASSERT (Ip6 != NULL); + + if (Ip6->Addr[0] != 0xFE) { + return FALSE; + } + + if (Ip6->Addr[1] != 0x80) { + return FALSE; + } + + for (Index = 2; Index < 8; Index++) { + if (Ip6->Addr[Index] != 0) { + return FALSE; + } + } + + return TRUE; +} + +/** + Check whether the Ipv6 address1 and address2 are on the connected network. + + ASSERT if Ip1 or Ip2 is NULL. + ASSERT if PrefixLength exceeds or equals to IP6_PREFIX_MAX. + + @param[in] Ip1 - Ip6 address1, in network order. + @param[in] Ip2 - Ip6 address2, in network order. + @param[in] PrefixLength - The prefix length of the checking net. + + @retval TRUE - Yes, connected. + @retval FALSE - No. + +**/ +BOOLEAN +EFIAPI +NetIp6IsNetEqual ( + EFI_IPv6_ADDRESS *Ip1, + EFI_IPv6_ADDRESS *Ip2, + UINT8 PrefixLength + ) +{ + UINT8 Byte; + UINT8 Bit; + UINT8 Mask; + + ASSERT ((Ip1 != NULL) && (Ip2 != NULL) && (PrefixLength < IP6_PREFIX_MAX)); + + if (PrefixLength == 0) { + return TRUE; + } + + Byte = (UINT8) (PrefixLength / 8); + Bit = (UINT8) (PrefixLength % 8); + + if (CompareMem (Ip1, Ip2, Byte) != 0) { + return FALSE; + } + + if (Bit > 0) { + Mask = (UINT8) (0xFF << (8 - Bit)); + + ASSERT (Byte < 16); + if (Byte >= 16) { + return FALSE; + } + if ((Ip1->Addr[Byte] & Mask) != (Ip2->Addr[Byte] & Mask)) { + return FALSE; + } + } + + return TRUE; +} + + +/** + Switches the endianess of an IPv6 address + + ASSERT if Ip6 is NULL. + + This function swaps the bytes in a 128-bit IPv6 address to switch the value + from little endian to big endian or vice versa. The byte swapped value is + returned. + + @param Ip6 Points to an IPv6 address + + @return The byte swapped IPv6 address. + +**/ +EFI_IPv6_ADDRESS * +EFIAPI +Ip6Swap128 ( + EFI_IPv6_ADDRESS *Ip6 + ) +{ + UINT64 High; + UINT64 Low; + + ASSERT (Ip6 != NULL); + + CopyMem (&High, Ip6, sizeof (UINT64)); + CopyMem (&Low, &Ip6->Addr[8], sizeof (UINT64)); + + High = SwapBytes64 (High); + Low = SwapBytes64 (Low); + + CopyMem (Ip6, &Low, sizeof (UINT64)); + CopyMem (&Ip6->Addr[8], &High, sizeof (UINT64)); + + return Ip6; +} + +/** + Initialize a random seed using current time and monotonic count. + + Get current time and monotonic count first. Then initialize a random seed + based on some basic mathematics operation on the hour, day, minute, second, + nanosecond and year of the current time and the monotonic count value. + + @return The random seed initialized with current time. + +**/ +UINT32 +EFIAPI +NetRandomInitSeed ( + VOID + ) +{ + EFI_TIME Time; + UINT32 Seed; + UINT64 MonotonicCount; + + gRT->GetTime (&Time, NULL); + Seed = (Time.Hour << 24 | Time.Day << 16 | Time.Minute << 8 | Time.Second); + Seed ^= Time.Nanosecond; + Seed ^= Time.Year << 7; + + gBS->GetNextMonotonicCount (&MonotonicCount); + Seed += (UINT32) MonotonicCount; + + return Seed; +} + + +/** + Extract a UINT32 from a byte stream. + + ASSERT if Buf is NULL. + + Copy a UINT32 from a byte stream, then converts it from Network + byte order to host byte order. Use this function to avoid alignment error. + + @param[in] Buf The buffer to extract the UINT32. + + @return The UINT32 extracted. + +**/ +UINT32 +EFIAPI +NetGetUint32 ( + IN UINT8 *Buf + ) +{ + UINT32 Value; + + ASSERT (Buf != NULL); + + CopyMem (&Value, Buf, sizeof (UINT32)); + return NTOHL (Value); +} + + +/** + Put a UINT32 to the byte stream in network byte order. + + ASSERT if Buf is NULL. + + Converts a UINT32 from host byte order to network byte order. Then copy it to the + byte stream. + + @param[in, out] Buf The buffer to put the UINT32. + @param[in] Data The data to be converted and put into the byte stream. + +**/ +VOID +EFIAPI +NetPutUint32 ( + IN OUT UINT8 *Buf, + IN UINT32 Data + ) +{ + ASSERT (Buf != NULL); + + Data = HTONL (Data); + CopyMem (Buf, &Data, sizeof (UINT32)); +} + + +/** + Remove the first node entry on the list, and return the removed node entry. + + Removes the first node Entry from a doubly linked list. It is up to the caller of + this function to release the memory used by the first node if that is required. On + exit, the removed node is returned. + + If Head is NULL, then ASSERT(). + If Head was not initialized, then ASSERT(). + If PcdMaximumLinkedListLength is not zero, and the number of nodes in the + linked list including the head node is greater than or equal to PcdMaximumLinkedListLength, + then ASSERT(). + + @param[in, out] Head The list header. + + @return The first node entry that is removed from the list, NULL if the list is empty. + +**/ +LIST_ENTRY * +EFIAPI +NetListRemoveHead ( + IN OUT LIST_ENTRY *Head + ) +{ + LIST_ENTRY *First; + + ASSERT (Head != NULL); + + if (IsListEmpty (Head)) { + return NULL; + } + + First = Head->ForwardLink; + Head->ForwardLink = First->ForwardLink; + First->ForwardLink->BackLink = Head; + + DEBUG_CODE ( + First->ForwardLink = (LIST_ENTRY *) NULL; + First->BackLink = (LIST_ENTRY *) NULL; + ); + + return First; +} + + +/** + Remove the last node entry on the list and and return the removed node entry. + + Removes the last node entry from a doubly linked list. It is up to the caller of + this function to release the memory used by the first node if that is required. On + exit, the removed node is returned. + + If Head is NULL, then ASSERT(). + If Head was not initialized, then ASSERT(). + If PcdMaximumLinkedListLength is not zero, and the number of nodes in the + linked list including the head node is greater than or equal to PcdMaximumLinkedListLength, + then ASSERT(). + + @param[in, out] Head The list head. + + @return The last node entry that is removed from the list, NULL if the list is empty. + +**/ +LIST_ENTRY * +EFIAPI +NetListRemoveTail ( + IN OUT LIST_ENTRY *Head + ) +{ + LIST_ENTRY *Last; + + ASSERT (Head != NULL); + + if (IsListEmpty (Head)) { + return NULL; + } + + Last = Head->BackLink; + Head->BackLink = Last->BackLink; + Last->BackLink->ForwardLink = Head; + + DEBUG_CODE ( + Last->ForwardLink = (LIST_ENTRY *) NULL; + Last->BackLink = (LIST_ENTRY *) NULL; + ); + + return Last; +} + + +/** + Insert a new node entry after a designated node entry of a doubly linked list. + + ASSERT if PrevEntry or NewEntry is NULL. + + Inserts a new node entry donated by NewEntry after the node entry donated by PrevEntry + of the doubly linked list. + + @param[in, out] PrevEntry The previous entry to insert after. + @param[in, out] NewEntry The new entry to insert. + +**/ +VOID +EFIAPI +NetListInsertAfter ( + IN OUT LIST_ENTRY *PrevEntry, + IN OUT LIST_ENTRY *NewEntry + ) +{ + ASSERT (PrevEntry != NULL && NewEntry != NULL); + + NewEntry->BackLink = PrevEntry; + NewEntry->ForwardLink = PrevEntry->ForwardLink; + PrevEntry->ForwardLink->BackLink = NewEntry; + PrevEntry->ForwardLink = NewEntry; +} + + +/** + Insert a new node entry before a designated node entry of a doubly linked list. + + ASSERT if PostEntry or NewEntry is NULL. + + Inserts a new node entry donated by NewEntry after the node entry donated by PostEntry + of the doubly linked list. + + @param[in, out] PostEntry The entry to insert before. + @param[in, out] NewEntry The new entry to insert. + +**/ +VOID +EFIAPI +NetListInsertBefore ( + IN OUT LIST_ENTRY *PostEntry, + IN OUT LIST_ENTRY *NewEntry + ) +{ + ASSERT (PostEntry != NULL && NewEntry != NULL); + + NewEntry->ForwardLink = PostEntry; + NewEntry->BackLink = PostEntry->BackLink; + PostEntry->BackLink->ForwardLink = NewEntry; + PostEntry->BackLink = NewEntry; +} + +/** + Safe destroy nodes in a linked list, and return the length of the list after all possible operations finished. + + Destroy network child instance list by list traversals is not safe due to graph dependencies between nodes. + This function performs a safe traversal to destroy these nodes by checking to see if the node being destroyed + has been removed from the list or not. + If it has been removed, then restart the traversal from the head. + If it hasn't been removed, then continue with the next node directly. + This function will end the iterate and return the CallBack's last return value if error happens, + or retrun EFI_SUCCESS if 2 complete passes are made with no changes in the number of children in the list. + + @param[in] List The head of the list. + @param[in] CallBack Pointer to the callback function to destroy one node in the list. + @param[in] Context Pointer to the callback function's context: corresponds to the + parameter Context in NET_DESTROY_LINK_LIST_CALLBACK. + @param[out] ListLength The length of the link list if the function returns successfully. + + @retval EFI_SUCCESS Two complete passes are made with no changes in the number of children. + @retval EFI_INVALID_PARAMETER The input parameter is invalid. + @retval Others Return the CallBack's last return value. + +**/ +EFI_STATUS +EFIAPI +NetDestroyLinkList ( + IN LIST_ENTRY *List, + IN NET_DESTROY_LINK_LIST_CALLBACK CallBack, + IN VOID *Context, OPTIONAL + OUT UINTN *ListLength OPTIONAL + ) +{ + UINTN PreviousLength; + LIST_ENTRY *Entry; + LIST_ENTRY *Ptr; + UINTN Length; + EFI_STATUS Status; + + if (List == NULL || CallBack == NULL) { + return EFI_INVALID_PARAMETER; + } + + Length = 0; + do { + PreviousLength = Length; + Entry = GetFirstNode (List); + while (!IsNull (List, Entry)) { + Status = CallBack (Entry, Context); + if (EFI_ERROR (Status)) { + return Status; + } + // + // Walk through the list to see whether the Entry has been removed or not. + // If the Entry still exists, just try to destroy the next one. + // If not, go back to the start point to iterate the list again. + // + for (Ptr = List->ForwardLink; Ptr != List; Ptr = Ptr->ForwardLink) { + if (Ptr == Entry) { + break; + } + } + if (Ptr == Entry) { + Entry = GetNextNode (List, Entry); + } else { + Entry = GetFirstNode (List); + } + } + for (Length = 0, Ptr = List->ForwardLink; Ptr != List; Length++, Ptr = Ptr->ForwardLink); + } while (Length != PreviousLength); + + if (ListLength != NULL) { + *ListLength = Length; + } + return EFI_SUCCESS; +} + +/** + This function checks the input Handle to see if it's one of these handles in ChildHandleBuffer. + + @param[in] Handle Handle to be checked. + @param[in] NumberOfChildren Number of Handles in ChildHandleBuffer. + @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL + if NumberOfChildren is 0. + + @retval TRUE Found the input Handle in ChildHandleBuffer. + @retval FALSE Can't find the input Handle in ChildHandleBuffer. + +**/ +BOOLEAN +EFIAPI +NetIsInHandleBuffer ( + IN EFI_HANDLE Handle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer OPTIONAL + ) +{ + UINTN Index; + + if (NumberOfChildren == 0 || ChildHandleBuffer == NULL) { + return FALSE; + } + + for (Index = 0; Index < NumberOfChildren; Index++) { + if (Handle == ChildHandleBuffer[Index]) { + return TRUE; + } + } + + return FALSE; +} + + +/** + Initialize the netmap. Netmap is a reposity to keep the pairs. + + Initialize the forward and backward links of two head nodes donated by Map->Used + and Map->Recycled of two doubly linked lists. + Initializes the count of the pairs in the netmap to zero. + + If Map is NULL, then ASSERT(). + If the address of Map->Used is NULL, then ASSERT(). + If the address of Map->Recycled is NULl, then ASSERT(). + + @param[in, out] Map The netmap to initialize. + +**/ +VOID +EFIAPI +NetMapInit ( + IN OUT NET_MAP *Map + ) +{ + ASSERT (Map != NULL); + + InitializeListHead (&Map->Used); + InitializeListHead (&Map->Recycled); + Map->Count = 0; +} + + +/** + To clean up the netmap, that is, release allocated memories. + + Removes all nodes of the Used doubly linked list and free memory of all related netmap items. + Removes all nodes of the Recycled doubly linked list and free memory of all related netmap items. + The number of the pairs in the netmap is set to be zero. + + If Map is NULL, then ASSERT(). + + @param[in, out] Map The netmap to clean up. + +**/ +VOID +EFIAPI +NetMapClean ( + IN OUT NET_MAP *Map + ) +{ + NET_MAP_ITEM *Item; + LIST_ENTRY *Entry; + LIST_ENTRY *Next; + + ASSERT (Map != NULL); + + NET_LIST_FOR_EACH_SAFE (Entry, Next, &Map->Used) { + Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); + + RemoveEntryList (&Item->Link); + Map->Count--; + + gBS->FreePool (Item); + } + + ASSERT ((Map->Count == 0) && IsListEmpty (&Map->Used)); + + NET_LIST_FOR_EACH_SAFE (Entry, Next, &Map->Recycled) { + Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); + + RemoveEntryList (&Item->Link); + gBS->FreePool (Item); + } + + ASSERT (IsListEmpty (&Map->Recycled)); +} + + +/** + Test whether the netmap is empty and return true if it is. + + If the number of the pairs in the netmap is zero, return TRUE. + + If Map is NULL, then ASSERT(). + + @param[in] Map The net map to test. + + @return TRUE if the netmap is empty, otherwise FALSE. + +**/ +BOOLEAN +EFIAPI +NetMapIsEmpty ( + IN NET_MAP *Map + ) +{ + ASSERT (Map != NULL); + return (BOOLEAN) (Map->Count == 0); +} + + +/** + Return the number of the pairs in the netmap. + + If Map is NULL, then ASSERT(). + + @param[in] Map The netmap to get the entry number. + + @return The entry number in the netmap. + +**/ +UINTN +EFIAPI +NetMapGetCount ( + IN NET_MAP *Map + ) +{ + ASSERT (Map != NULL); + return Map->Count; +} + + +/** + Return one allocated item. + + If the Recycled doubly linked list of the netmap is empty, it will try to allocate + a batch of items if there are enough resources and add corresponding nodes to the begining + of the Recycled doubly linked list of the netmap. Otherwise, it will directly remove + the fist node entry of the Recycled doubly linked list and return the corresponding item. + + If Map is NULL, then ASSERT(). + + @param[in, out] Map The netmap to allocate item for. + + @return The allocated item. If NULL, the + allocation failed due to resource limit. + +**/ +NET_MAP_ITEM * +NetMapAllocItem ( + IN OUT NET_MAP *Map + ) +{ + NET_MAP_ITEM *Item; + LIST_ENTRY *Head; + UINTN Index; + + ASSERT (Map != NULL); + + Head = &Map->Recycled; + + if (IsListEmpty (Head)) { + for (Index = 0; Index < NET_MAP_INCREAMENT; Index++) { + Item = AllocatePool (sizeof (NET_MAP_ITEM)); + + if (Item == NULL) { + if (Index == 0) { + return NULL; + } + + break; + } + + InsertHeadList (Head, &Item->Link); + } + } + + Item = NET_LIST_HEAD (Head, NET_MAP_ITEM, Link); + NetListRemoveHead (Head); + + return Item; +} + + +/** + Allocate an item to save the pair to the head of the netmap. + + Allocate an item to save the pair and add corresponding node entry + to the beginning of the Used doubly linked list. The number of the + pairs in the netmap increase by 1. + + If Map is NULL, then ASSERT(). + If Key is NULL, then ASSERT(). + + @param[in, out] Map The netmap to insert into. + @param[in] Key The user's key. + @param[in] Value The user's value for the key. + + @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory for the item. + @retval EFI_SUCCESS The item is inserted to the head. + +**/ +EFI_STATUS +EFIAPI +NetMapInsertHead ( + IN OUT NET_MAP *Map, + IN VOID *Key, + IN VOID *Value OPTIONAL + ) +{ + NET_MAP_ITEM *Item; + + ASSERT (Map != NULL && Key != NULL); + + Item = NetMapAllocItem (Map); + + if (Item == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Item->Key = Key; + Item->Value = Value; + InsertHeadList (&Map->Used, &Item->Link); + + Map->Count++; + return EFI_SUCCESS; +} + + +/** + Allocate an item to save the pair to the tail of the netmap. + + Allocate an item to save the pair and add corresponding node entry + to the tail of the Used doubly linked list. The number of the + pairs in the netmap increase by 1. + + If Map is NULL, then ASSERT(). + If Key is NULL, then ASSERT(). + + @param[in, out] Map The netmap to insert into. + @param[in] Key The user's key. + @param[in] Value The user's value for the key. + + @retval EFI_OUT_OF_RESOURCES Failed to allocate the memory for the item. + @retval EFI_SUCCESS The item is inserted to the tail. + +**/ +EFI_STATUS +EFIAPI +NetMapInsertTail ( + IN OUT NET_MAP *Map, + IN VOID *Key, + IN VOID *Value OPTIONAL + ) +{ + NET_MAP_ITEM *Item; + + ASSERT (Map != NULL && Key != NULL); + + Item = NetMapAllocItem (Map); + + if (Item == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + Item->Key = Key; + Item->Value = Value; + InsertTailList (&Map->Used, &Item->Link); + + Map->Count++; + + return EFI_SUCCESS; +} + + +/** + Check whether the item is in the Map and return TRUE if it is. + + If Map is NULL, then ASSERT(). + If Item is NULL, then ASSERT(). + + @param[in] Map The netmap to search within. + @param[in] Item The item to search. + + @return TRUE if the item is in the netmap, otherwise FALSE. + +**/ +BOOLEAN +NetItemInMap ( + IN NET_MAP *Map, + IN NET_MAP_ITEM *Item + ) +{ + LIST_ENTRY *ListEntry; + + ASSERT (Map != NULL && Item != NULL); + + NET_LIST_FOR_EACH (ListEntry, &Map->Used) { + if (ListEntry == &Item->Link) { + return TRUE; + } + } + + return FALSE; +} + + +/** + Find the key in the netmap and returns the point to the item contains the Key. + + Iterate the Used doubly linked list of the netmap to get every item. Compare the key of every + item with the key to search. It returns the point to the item contains the Key if found. + + If Map is NULL, then ASSERT(). + If Key is NULL, then ASSERT(). + + @param[in] Map The netmap to search within. + @param[in] Key The key to search. + + @return The point to the item contains the Key, or NULL if Key isn't in the map. + +**/ +NET_MAP_ITEM * +EFIAPI +NetMapFindKey ( + IN NET_MAP *Map, + IN VOID *Key + ) +{ + LIST_ENTRY *Entry; + NET_MAP_ITEM *Item; + + ASSERT (Map != NULL && Key != NULL); + + NET_LIST_FOR_EACH (Entry, &Map->Used) { + Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); + + if (Item->Key == Key) { + return Item; + } + } + + return NULL; +} + + +/** + Remove the node entry of the item from the netmap and return the key of the removed item. + + Remove the node entry of the item from the Used doubly linked list of the netmap. + The number of the pairs in the netmap decrease by 1. Then add the node + entry of the item to the Recycled doubly linked list of the netmap. If Value is not NULL, + Value will point to the value of the item. It returns the key of the removed item. + + If Map is NULL, then ASSERT(). + If Item is NULL, then ASSERT(). + if item in not in the netmap, then ASSERT(). + + @param[in, out] Map The netmap to remove the item from. + @param[in, out] Item The item to remove. + @param[out] Value The variable to receive the value if not NULL. + + @return The key of the removed item. + +**/ +VOID * +EFIAPI +NetMapRemoveItem ( + IN OUT NET_MAP *Map, + IN OUT NET_MAP_ITEM *Item, + OUT VOID **Value OPTIONAL + ) +{ + ASSERT ((Map != NULL) && (Item != NULL)); + ASSERT (NetItemInMap (Map, Item)); + + RemoveEntryList (&Item->Link); + Map->Count--; + InsertHeadList (&Map->Recycled, &Item->Link); + + if (Value != NULL) { + *Value = Item->Value; + } + + return Item->Key; +} + + +/** + Remove the first node entry on the netmap and return the key of the removed item. + + Remove the first node entry from the Used doubly linked list of the netmap. + The number of the pairs in the netmap decrease by 1. Then add the node + entry to the Recycled doubly linked list of the netmap. If parameter Value is not NULL, + parameter Value will point to the value of the item. It returns the key of the removed item. + + If Map is NULL, then ASSERT(). + If the Used doubly linked list is empty, then ASSERT(). + + @param[in, out] Map The netmap to remove the head from. + @param[out] Value The variable to receive the value if not NULL. + + @return The key of the item removed. + +**/ +VOID * +EFIAPI +NetMapRemoveHead ( + IN OUT NET_MAP *Map, + OUT VOID **Value OPTIONAL + ) +{ + NET_MAP_ITEM *Item; + + // + // Often, it indicates a programming error to remove + // the first entry in an empty list + // + ASSERT (Map && !IsListEmpty (&Map->Used)); + + Item = NET_LIST_HEAD (&Map->Used, NET_MAP_ITEM, Link); + RemoveEntryList (&Item->Link); + Map->Count--; + InsertHeadList (&Map->Recycled, &Item->Link); + + if (Value != NULL) { + *Value = Item->Value; + } + + return Item->Key; +} + + +/** + Remove the last node entry on the netmap and return the key of the removed item. + + Remove the last node entry from the Used doubly linked list of the netmap. + The number of the pairs in the netmap decrease by 1. Then add the node + entry to the Recycled doubly linked list of the netmap. If parameter Value is not NULL, + parameter Value will point to the value of the item. It returns the key of the removed item. + + If Map is NULL, then ASSERT(). + If the Used doubly linked list is empty, then ASSERT(). + + @param[in, out] Map The netmap to remove the tail from. + @param[out] Value The variable to receive the value if not NULL. + + @return The key of the item removed. + +**/ +VOID * +EFIAPI +NetMapRemoveTail ( + IN OUT NET_MAP *Map, + OUT VOID **Value OPTIONAL + ) +{ + NET_MAP_ITEM *Item; + + // + // Often, it indicates a programming error to remove + // the last entry in an empty list + // + ASSERT (Map && !IsListEmpty (&Map->Used)); + + Item = NET_LIST_TAIL (&Map->Used, NET_MAP_ITEM, Link); + RemoveEntryList (&Item->Link); + Map->Count--; + InsertHeadList (&Map->Recycled, &Item->Link); + + if (Value != NULL) { + *Value = Item->Value; + } + + return Item->Key; +} + + +/** + Iterate through the netmap and call CallBack for each item. + + It will continue the traverse if CallBack returns EFI_SUCCESS, otherwise, break + from the loop. It returns the CallBack's last return value. This function is + delete safe for the current item. + + If Map is NULL, then ASSERT(). + If CallBack is NULL, then ASSERT(). + + @param[in] Map The Map to iterate through. + @param[in] CallBack The callback function to call for each item. + @param[in] Arg The opaque parameter to the callback. + + @retval EFI_SUCCESS There is no item in the netmap or CallBack for each item + return EFI_SUCCESS. + @retval Others It returns the CallBack's last return value. + +**/ +EFI_STATUS +EFIAPI +NetMapIterate ( + IN NET_MAP *Map, + IN NET_MAP_CALLBACK CallBack, + IN VOID *Arg OPTIONAL + ) +{ + + LIST_ENTRY *Entry; + LIST_ENTRY *Next; + LIST_ENTRY *Head; + NET_MAP_ITEM *Item; + EFI_STATUS Result; + + ASSERT ((Map != NULL) && (CallBack != NULL)); + + Head = &Map->Used; + + if (IsListEmpty (Head)) { + return EFI_SUCCESS; + } + + NET_LIST_FOR_EACH_SAFE (Entry, Next, Head) { + Item = NET_LIST_USER_STRUCT (Entry, NET_MAP_ITEM, Link); + Result = CallBack (Map, Item, Arg); + + if (EFI_ERROR (Result)) { + return Result; + } + } + + return EFI_SUCCESS; +} + + +/** + This is the default unload handle for all the network drivers. + + Disconnect the driver specified by ImageHandle from all the devices in the handle database. + Uninstall all the protocols installed in the driver entry point. + + @param[in] ImageHandle The drivers' driver image. + + @retval EFI_SUCCESS The image is unloaded. + @retval Others Failed to unload the image. + +**/ +EFI_STATUS +EFIAPI +NetLibDefaultUnload ( + IN EFI_HANDLE ImageHandle + ) +{ + EFI_STATUS Status; + EFI_HANDLE *DeviceHandleBuffer; + UINTN DeviceHandleCount; + UINTN Index; + UINTN Index2; + EFI_DRIVER_BINDING_PROTOCOL *DriverBinding; + EFI_COMPONENT_NAME_PROTOCOL *ComponentName; + EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2; + + // + // Get the list of all the handles in the handle database. + // If there is an error getting the list, then the unload + // operation fails. + // + Status = gBS->LocateHandleBuffer ( + AllHandles, + NULL, + NULL, + &DeviceHandleCount, + &DeviceHandleBuffer + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + for (Index = 0; Index < DeviceHandleCount; Index++) { + Status = gBS->HandleProtocol ( + DeviceHandleBuffer[Index], + &gEfiDriverBindingProtocolGuid, + (VOID **) &DriverBinding + ); + if (EFI_ERROR (Status)) { + continue; + } + + if (DriverBinding->ImageHandle != ImageHandle) { + continue; + } + + // + // Disconnect the driver specified by ImageHandle from all + // the devices in the handle database. + // + for (Index2 = 0; Index2 < DeviceHandleCount; Index2++) { + Status = gBS->DisconnectController ( + DeviceHandleBuffer[Index2], + DriverBinding->DriverBindingHandle, + NULL + ); + } + + // + // Uninstall all the protocols installed in the driver entry point + // + gBS->UninstallProtocolInterface ( + DriverBinding->DriverBindingHandle, + &gEfiDriverBindingProtocolGuid, + DriverBinding + ); + + Status = gBS->HandleProtocol ( + DeviceHandleBuffer[Index], + &gEfiComponentNameProtocolGuid, + (VOID **) &ComponentName + ); + if (!EFI_ERROR (Status)) { + gBS->UninstallProtocolInterface ( + DriverBinding->DriverBindingHandle, + &gEfiComponentNameProtocolGuid, + ComponentName + ); + } + + Status = gBS->HandleProtocol ( + DeviceHandleBuffer[Index], + &gEfiComponentName2ProtocolGuid, + (VOID **) &ComponentName2 + ); + if (!EFI_ERROR (Status)) { + gBS->UninstallProtocolInterface ( + DriverBinding->DriverBindingHandle, + &gEfiComponentName2ProtocolGuid, + ComponentName2 + ); + } + } + + // + // Free the buffer containing the list of handles from the handle database + // + if (DeviceHandleBuffer != NULL) { + gBS->FreePool (DeviceHandleBuffer); + } + + return EFI_SUCCESS; +} + + + +/** + Create a child of the service that is identified by ServiceBindingGuid. + + Get the ServiceBinding Protocol first, then use it to create a child. + + If ServiceBindingGuid is NULL, then ASSERT(). + If ChildHandle is NULL, then ASSERT(). + + @param[in] Controller The controller which has the service installed. + @param[in] Image The image handle used to open service. + @param[in] ServiceBindingGuid The service's Guid. + @param[in, out] ChildHandle The handle to receive the create child. + + @retval EFI_SUCCESS The child is successfully created. + @retval Others Failed to create the child. + +**/ +EFI_STATUS +EFIAPI +NetLibCreateServiceChild ( + IN EFI_HANDLE Controller, + IN EFI_HANDLE Image, + IN EFI_GUID *ServiceBindingGuid, + IN OUT EFI_HANDLE *ChildHandle + ) +{ + EFI_STATUS Status; + EFI_SERVICE_BINDING_PROTOCOL *Service; + + + ASSERT ((ServiceBindingGuid != NULL) && (ChildHandle != NULL)); + + // + // Get the ServiceBinding Protocol + // + Status = gBS->OpenProtocol ( + Controller, + ServiceBindingGuid, + (VOID **) &Service, + Image, + Controller, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Create a child + // + Status = Service->CreateChild (Service, ChildHandle); + return Status; +} + + +/** + Destroy a child of the service that is identified by ServiceBindingGuid. + + Get the ServiceBinding Protocol first, then use it to destroy a child. + + If ServiceBindingGuid is NULL, then ASSERT(). + + @param[in] Controller The controller which has the service installed. + @param[in] Image The image handle used to open service. + @param[in] ServiceBindingGuid The service's Guid. + @param[in] ChildHandle The child to destroy. + + @retval EFI_SUCCESS The child is successfully destroyed. + @retval Others Failed to destroy the child. + +**/ +EFI_STATUS +EFIAPI +NetLibDestroyServiceChild ( + IN EFI_HANDLE Controller, + IN EFI_HANDLE Image, + IN EFI_GUID *ServiceBindingGuid, + IN EFI_HANDLE ChildHandle + ) +{ + EFI_STATUS Status; + EFI_SERVICE_BINDING_PROTOCOL *Service; + + ASSERT (ServiceBindingGuid != NULL); + + // + // Get the ServiceBinding Protocol + // + Status = gBS->OpenProtocol ( + Controller, + ServiceBindingGuid, + (VOID **) &Service, + Image, + Controller, + EFI_OPEN_PROTOCOL_GET_PROTOCOL + ); + + if (EFI_ERROR (Status)) { + return Status; + } + + // + // destroy the child + // + Status = Service->DestroyChild (Service, ChildHandle); + return Status; +} + +/** + Get handle with Simple Network Protocol installed on it. + + There should be MNP Service Binding Protocol installed on the input ServiceHandle. + If Simple Network Protocol is already installed on the ServiceHandle, the + ServiceHandle will be returned. If SNP is not installed on the ServiceHandle, + try to find its parent handle with SNP installed. + + @param[in] ServiceHandle The handle where network service binding protocols are + installed on. + @param[out] Snp The pointer to store the address of the SNP instance. + This is an optional parameter that may be NULL. + + @return The SNP handle, or NULL if not found. + +**/ +EFI_HANDLE +EFIAPI +NetLibGetSnpHandle ( + IN EFI_HANDLE ServiceHandle, + OUT EFI_SIMPLE_NETWORK_PROTOCOL **Snp OPTIONAL + ) +{ + EFI_STATUS Status; + EFI_SIMPLE_NETWORK_PROTOCOL *SnpInstance; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_HANDLE SnpHandle; + + // + // Try to open SNP from ServiceHandle + // + SnpInstance = NULL; + Status = gBS->HandleProtocol (ServiceHandle, &gEfiSimpleNetworkProtocolGuid, (VOID **) &SnpInstance); + if (!EFI_ERROR (Status)) { + if (Snp != NULL) { + *Snp = SnpInstance; + } + return ServiceHandle; + } + + // + // Failed to open SNP, try to get SNP handle by LocateDevicePath() + // + DevicePath = DevicePathFromHandle (ServiceHandle); + if (DevicePath == NULL) { + return NULL; + } + + SnpHandle = NULL; + Status = gBS->LocateDevicePath (&gEfiSimpleNetworkProtocolGuid, &DevicePath, &SnpHandle); + if (EFI_ERROR (Status)) { + // + // Failed to find SNP handle + // + return NULL; + } + + Status = gBS->HandleProtocol (SnpHandle, &gEfiSimpleNetworkProtocolGuid, (VOID **) &SnpInstance); + if (!EFI_ERROR (Status)) { + if (Snp != NULL) { + *Snp = SnpInstance; + } + return SnpHandle; + } + + return NULL; +} + +/** + Retrieve VLAN ID of a VLAN device handle. + + Search VLAN device path node in Device Path of specified ServiceHandle and + return its VLAN ID. If no VLAN device path node found, then this ServiceHandle + is not a VLAN device handle, and 0 will be returned. + + @param[in] ServiceHandle The handle where network service binding protocols are + installed on. + + @return VLAN ID of the device handle, or 0 if not a VLAN device. + +**/ +UINT16 +EFIAPI +NetLibGetVlanId ( + IN EFI_HANDLE ServiceHandle + ) +{ + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + EFI_DEVICE_PATH_PROTOCOL *Node; + + DevicePath = DevicePathFromHandle (ServiceHandle); + if (DevicePath == NULL) { + return 0; + } + + Node = DevicePath; + while (!IsDevicePathEnd (Node)) { + if (Node->Type == MESSAGING_DEVICE_PATH && Node->SubType == MSG_VLAN_DP) { + return ((VLAN_DEVICE_PATH *) Node)->VlanId; + } + Node = NextDevicePathNode (Node); + } + + return 0; +} + +/** + Find VLAN device handle with specified VLAN ID. + + The VLAN child device handle is created by VLAN Config Protocol on ControllerHandle. + This function will append VLAN device path node to the parent device path, + and then use LocateDevicePath() to find the correct VLAN device handle. + + @param[in] ControllerHandle The handle where network service binding protocols are + installed on. + @param[in] VlanId The configured VLAN ID for the VLAN device. + + @return The VLAN device handle, or NULL if not found. + +**/ +EFI_HANDLE +EFIAPI +NetLibGetVlanHandle ( + IN EFI_HANDLE ControllerHandle, + IN UINT16 VlanId + ) +{ + EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; + EFI_DEVICE_PATH_PROTOCOL *VlanDevicePath; + EFI_DEVICE_PATH_PROTOCOL *DevicePath; + VLAN_DEVICE_PATH VlanNode; + EFI_HANDLE Handle; + + ParentDevicePath = DevicePathFromHandle (ControllerHandle); + if (ParentDevicePath == NULL) { + return NULL; + } + + // + // Construct VLAN device path + // + CopyMem (&VlanNode, &mNetVlanDevicePathTemplate, sizeof (VLAN_DEVICE_PATH)); + VlanNode.VlanId = VlanId; + VlanDevicePath = AppendDevicePathNode ( + ParentDevicePath, + (EFI_DEVICE_PATH_PROTOCOL *) &VlanNode + ); + if (VlanDevicePath == NULL) { + return NULL; + } + + // + // Find VLAN device handle + // + Handle = NULL; + DevicePath = VlanDevicePath; + gBS->LocateDevicePath ( + &gEfiDevicePathProtocolGuid, + &DevicePath, + &Handle + ); + if (!IsDevicePathEnd (DevicePath)) { + // + // Device path is not exactly match + // + Handle = NULL; + } + + FreePool (VlanDevicePath); + return Handle; +} + +/** + Get MAC address associated with the network service handle. + + If MacAddress is NULL, then ASSERT(). + If AddressSize is NULL, then ASSERT(). + + There should be MNP Service Binding Protocol installed on the input ServiceHandle. + If SNP is installed on the ServiceHandle or its parent handle, MAC address will + be retrieved from SNP. If no SNP found, try to get SNP mode data use MNP. + + @param[in] ServiceHandle The handle where network service binding protocols are + installed on. + @param[out] MacAddress The pointer to store the returned MAC address. + @param[out] AddressSize The length of returned MAC address. + + @retval EFI_SUCCESS MAC address is returned successfully. + @retval Others Failed to get SNP mode data. + +**/ +EFI_STATUS +EFIAPI +NetLibGetMacAddress ( + IN EFI_HANDLE ServiceHandle, + OUT EFI_MAC_ADDRESS *MacAddress, + OUT UINTN *AddressSize + ) +{ + EFI_STATUS Status; + EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + EFI_SIMPLE_NETWORK_MODE *SnpMode; + EFI_SIMPLE_NETWORK_MODE SnpModeData; + EFI_MANAGED_NETWORK_PROTOCOL *Mnp; + EFI_SERVICE_BINDING_PROTOCOL *MnpSb; + EFI_HANDLE *SnpHandle; + EFI_HANDLE MnpChildHandle; + + ASSERT (MacAddress != NULL); + ASSERT (AddressSize != NULL); + + // + // Try to get SNP handle + // + Snp = NULL; + SnpHandle = NetLibGetSnpHandle (ServiceHandle, &Snp); + if (SnpHandle != NULL) { + // + // SNP found, use it directly + // + SnpMode = Snp->Mode; + } else { + // + // Failed to get SNP handle, try to get MAC address from MNP + // + MnpChildHandle = NULL; + Status = gBS->HandleProtocol ( + ServiceHandle, + &gEfiManagedNetworkServiceBindingProtocolGuid, + (VOID **) &MnpSb + ); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Create a MNP child + // + Status = MnpSb->CreateChild (MnpSb, &MnpChildHandle); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // Open MNP protocol + // + Status = gBS->HandleProtocol ( + MnpChildHandle, + &gEfiManagedNetworkProtocolGuid, + (VOID **) &Mnp + ); + if (EFI_ERROR (Status)) { + MnpSb->DestroyChild (MnpSb, MnpChildHandle); + return Status; + } + + // + // Try to get SNP mode from MNP + // + Status = Mnp->GetModeData (Mnp, NULL, &SnpModeData); + if (EFI_ERROR (Status) && (Status != EFI_NOT_STARTED)) { + MnpSb->DestroyChild (MnpSb, MnpChildHandle); + return Status; + } + SnpMode = &SnpModeData; + + // + // Destroy the MNP child + // + MnpSb->DestroyChild (MnpSb, MnpChildHandle); + } + + *AddressSize = SnpMode->HwAddressSize; + CopyMem (MacAddress->Addr, SnpMode->CurrentAddress.Addr, SnpMode->HwAddressSize); + + return EFI_SUCCESS; +} + +/** + Convert MAC address of the NIC associated with specified Service Binding Handle + to a unicode string. Callers are responsible for freeing the string storage. + + If MacString is NULL, then ASSERT(). + + Locate simple network protocol associated with the Service Binding Handle and + get the mac address from SNP. Then convert the mac address into a unicode + string. It takes 2 unicode characters to represent a 1 byte binary buffer. + Plus one unicode character for the null-terminator. + + @param[in] ServiceHandle The handle where network service binding protocol is + installed on. + @param[in] ImageHandle The image handle used to act as the agent handle to + get the simple network protocol. This parameter is + optional and may be NULL. + @param[out] MacString The pointer to store the address of the string + representation of the mac address. + + @retval EFI_SUCCESS Convert the mac address a unicode string successfully. + @retval EFI_OUT_OF_RESOURCES There are not enough memory resource. + @retval Others Failed to open the simple network protocol. + +**/ +EFI_STATUS +EFIAPI +NetLibGetMacString ( + IN EFI_HANDLE ServiceHandle, + IN EFI_HANDLE ImageHandle, OPTIONAL + OUT CHAR16 **MacString + ) +{ + EFI_STATUS Status; + EFI_MAC_ADDRESS MacAddress; + UINT8 *HwAddress; + UINTN HwAddressSize; + UINT16 VlanId; + CHAR16 *String; + UINTN Index; + UINTN BufferSize; + + ASSERT (MacString != NULL); + + // + // Get MAC address of the network device + // + Status = NetLibGetMacAddress (ServiceHandle, &MacAddress, &HwAddressSize); + if (EFI_ERROR (Status)) { + return Status; + } + + // + // It takes 2 unicode characters to represent a 1 byte binary buffer. + // If VLAN is configured, it will need extra 5 characters like "\0005". + // Plus one unicode character for the null-terminator. + // + BufferSize = (2 * HwAddressSize + 5 + 1) * sizeof (CHAR16); + String = AllocateZeroPool (BufferSize); + if (String == NULL) { + return EFI_OUT_OF_RESOURCES; + } + *MacString = String; + + // + // Convert the MAC address into a unicode string. + // + HwAddress = &MacAddress.Addr[0]; + for (Index = 0; Index < HwAddressSize; Index++) { + UnicodeValueToStringS ( + String, + BufferSize - ((UINTN)String - (UINTN)*MacString), + PREFIX_ZERO | RADIX_HEX, + *(HwAddress++), + 2 + ); + String += StrnLenS (String, (BufferSize - ((UINTN)String - (UINTN)*MacString)) / sizeof (CHAR16)); + } + + // + // Append VLAN ID if any + // + VlanId = NetLibGetVlanId (ServiceHandle); + if (VlanId != 0) { + *String++ = L'\\'; + UnicodeValueToStringS ( + String, + BufferSize - ((UINTN)String - (UINTN)*MacString), + PREFIX_ZERO | RADIX_HEX, + VlanId, + 4 + ); + String += StrnLenS (String, (BufferSize - ((UINTN)String - (UINTN)*MacString)) / sizeof (CHAR16)); + } + + // + // Null terminate the Unicode string + // + *String = L'\0'; + + return EFI_SUCCESS; +} + +/** + Detect media status for specified network device. + + If MediaPresent is NULL, then ASSERT(). + + The underlying UNDI driver may or may not support reporting media status from + GET_STATUS command (PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED). This routine + will try to invoke Snp->GetStatus() to get the media status: if media already + present, it return directly; if media not present, it will stop SNP and then + restart SNP to get the latest media status, this give chance to get the correct + media status for old UNDI driver which doesn't support reporting media status + from GET_STATUS command. + Note: there will be two limitations for current algorithm: + 1) for UNDI with this capability, in case of cable is not attached, there will + be an redundant Stop/Start() process; + 2) for UNDI without this capability, in case that network cable is attached when + Snp->Initialize() is invoked while network cable is unattached later, + NetLibDetectMedia() will report MediaPresent as TRUE, causing upper layer + apps to wait for timeout time. + + @param[in] ServiceHandle The handle where network service binding protocols are + installed on. + @param[out] MediaPresent The pointer to store the media status. + + @retval EFI_SUCCESS Media detection success. + @retval EFI_INVALID_PARAMETER ServiceHandle is not valid network device handle. + @retval EFI_UNSUPPORTED Network device does not support media detection. + @retval EFI_DEVICE_ERROR SNP is in unknown state. + +**/ +EFI_STATUS +EFIAPI +NetLibDetectMedia ( + IN EFI_HANDLE ServiceHandle, + OUT BOOLEAN *MediaPresent + ) +{ + EFI_STATUS Status; + EFI_HANDLE SnpHandle; + EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + UINT32 InterruptStatus; + UINT32 OldState; + EFI_MAC_ADDRESS *MCastFilter; + UINT32 MCastFilterCount; + UINT32 EnableFilterBits; + UINT32 DisableFilterBits; + BOOLEAN ResetMCastFilters; + + ASSERT (MediaPresent != NULL); + + // + // Get SNP handle + // + Snp = NULL; + SnpHandle = NetLibGetSnpHandle (ServiceHandle, &Snp); + if (SnpHandle == NULL) { + return EFI_INVALID_PARAMETER; + } + + // + // Check whether SNP support media detection + // + if (!Snp->Mode->MediaPresentSupported) { + return EFI_UNSUPPORTED; + } + + // + // Invoke Snp->GetStatus() to refresh MediaPresent field in SNP mode data + // + Status = Snp->GetStatus (Snp, &InterruptStatus, NULL); + if (EFI_ERROR (Status)) { + return Status; + } + + if (Snp->Mode->MediaPresent) { + // + // Media is present, return directly + // + *MediaPresent = TRUE; + return EFI_SUCCESS; + } + + // + // Till now, GetStatus() report no media; while, in case UNDI not support + // reporting media status from GetStatus(), this media status may be incorrect. + // So, we will stop SNP and then restart it to get the correct media status. + // + OldState = Snp->Mode->State; + if (OldState >= EfiSimpleNetworkMaxState) { + return EFI_DEVICE_ERROR; + } + + MCastFilter = NULL; + + if (OldState == EfiSimpleNetworkInitialized) { + // + // SNP is already in use, need Shutdown/Stop and then Start/Initialize + // + + // + // Backup current SNP receive filter settings + // + EnableFilterBits = Snp->Mode->ReceiveFilterSetting; + DisableFilterBits = Snp->Mode->ReceiveFilterMask ^ EnableFilterBits; + + ResetMCastFilters = TRUE; + MCastFilterCount = Snp->Mode->MCastFilterCount; + if (MCastFilterCount != 0) { + MCastFilter = AllocateCopyPool ( + MCastFilterCount * sizeof (EFI_MAC_ADDRESS), + Snp->Mode->MCastFilter + ); + ASSERT (MCastFilter != NULL); + if (MCastFilter == NULL) { + Status = EFI_OUT_OF_RESOURCES; + goto Exit; + } + + ResetMCastFilters = FALSE; + } + + // + // Shutdown/Stop the simple network + // + Status = Snp->Shutdown (Snp); + if (!EFI_ERROR (Status)) { + Status = Snp->Stop (Snp); + } + if (EFI_ERROR (Status)) { + goto Exit; + } + + // + // Start/Initialize the simple network + // + Status = Snp->Start (Snp); + if (!EFI_ERROR (Status)) { + Status = Snp->Initialize (Snp, 0, 0); + } + if (EFI_ERROR (Status)) { + goto Exit; + } + + // + // Here we get the correct media status + // + *MediaPresent = Snp->Mode->MediaPresent; + + // + // Restore SNP receive filter settings + // + Status = Snp->ReceiveFilters ( + Snp, + EnableFilterBits, + DisableFilterBits, + ResetMCastFilters, + MCastFilterCount, + MCastFilter + ); + + if (MCastFilter != NULL) { + FreePool (MCastFilter); + } + + return Status; + } + + // + // SNP is not in use, it's in state of EfiSimpleNetworkStopped or EfiSimpleNetworkStarted + // + if (OldState == EfiSimpleNetworkStopped) { + // + // SNP not start yet, start it + // + Status = Snp->Start (Snp); + if (EFI_ERROR (Status)) { + goto Exit; + } + } + + // + // Initialize the simple network + // + Status = Snp->Initialize (Snp, 0, 0); + if (EFI_ERROR (Status)) { + Status = EFI_DEVICE_ERROR; + goto Exit; + } + + // + // Here we get the correct media status + // + *MediaPresent = Snp->Mode->MediaPresent; + + // + // Shut down the simple network + // + Snp->Shutdown (Snp); + +Exit: + if (OldState == EfiSimpleNetworkStopped) { + // + // Original SNP sate is Stopped, restore to original state + // + Snp->Stop (Snp); + } + + if (MCastFilter != NULL) { + FreePool (MCastFilter); + } + + return Status; +} + +/** + + Detect media state for a network device. This routine will wait for a period of time at + a specified checking interval when a certain network is under connecting until connection + process finishs or timeout. If Aip protocol is supported by low layer drivers, three kinds + of media states can be detected: EFI_SUCCESS, EFI_NOT_READY and EFI_NO_MEDIA, represents + connected state, connecting state and no media state respectively. When function detects + the current state is EFI_NOT_READY, it will loop to wait for next time's check until state + turns to be EFI_SUCCESS or EFI_NO_MEDIA. If Aip protocol is not supported, function will + call NetLibDetectMedia() and return state directly. + + @param[in] ServiceHandle The handle where network service binding protocols are + installed on. + @param[in] Timeout The maximum number of 100ns units to wait when network + is connecting. Zero value means detect once and return + immediately. + @param[out] MediaState The pointer to the detected media state. + + @retval EFI_SUCCESS Media detection success. + @retval EFI_INVALID_PARAMETER ServiceHandle is not a valid network device handle or + MediaState pointer is NULL. + @retval EFI_DEVICE_ERROR A device error occurred. + @retval EFI_TIMEOUT Network is connecting but timeout. + +**/ +EFI_STATUS +EFIAPI +NetLibDetectMediaWaitTimeout ( + IN EFI_HANDLE ServiceHandle, + IN UINT64 Timeout, + OUT EFI_STATUS *MediaState + ) +{ + EFI_STATUS Status; + EFI_HANDLE SnpHandle; + EFI_SIMPLE_NETWORK_PROTOCOL *Snp; + EFI_ADAPTER_INFORMATION_PROTOCOL *Aip; + EFI_ADAPTER_INFO_MEDIA_STATE *MediaInfo; + BOOLEAN MediaPresent; + UINTN DataSize; + EFI_STATUS TimerStatus; + EFI_EVENT Timer; + UINT64 TimeRemained; + + if (MediaState == NULL) { + return EFI_INVALID_PARAMETER; + } + *MediaState = EFI_SUCCESS; + MediaInfo = NULL; + + // + // Get SNP handle + // + Snp = NULL; + SnpHandle = NetLibGetSnpHandle (ServiceHandle, &Snp); + if (SnpHandle == NULL) { + return EFI_INVALID_PARAMETER; + } + + Status = gBS->HandleProtocol ( + SnpHandle, + &gEfiAdapterInformationProtocolGuid, + (VOID *) &Aip + ); + if (EFI_ERROR (Status)) { + + MediaPresent = TRUE; + Status = NetLibDetectMedia (ServiceHandle, &MediaPresent); + if (!EFI_ERROR (Status)) { + if (MediaPresent) { + *MediaState = EFI_SUCCESS; + } else { + *MediaState = EFI_NO_MEDIA; + } + } + + // + // NetLibDetectMedia doesn't support EFI_NOT_READY status, return now! + // + return Status; + } + + Status = Aip->GetInformation ( + Aip, + &gEfiAdapterInfoMediaStateGuid, + (VOID **) &MediaInfo, + &DataSize + ); + if (!EFI_ERROR (Status)) { + + *MediaState = MediaInfo->MediaState; + FreePool (MediaInfo); + if (*MediaState != EFI_NOT_READY || Timeout < MEDIA_STATE_DETECT_TIME_INTERVAL) { + + return EFI_SUCCESS; + } + } else { + + if (MediaInfo != NULL) { + FreePool (MediaInfo); + } + + if (Status == EFI_UNSUPPORTED) { + + // + // If gEfiAdapterInfoMediaStateGuid is not supported, call NetLibDetectMedia to get media state! + // + MediaPresent = TRUE; + Status = NetLibDetectMedia (ServiceHandle, &MediaPresent); + if (!EFI_ERROR (Status)) { + if (MediaPresent) { + *MediaState = EFI_SUCCESS; + } else { + *MediaState = EFI_NO_MEDIA; + } + } + return Status; + } + + return Status; + } + + // + // Loop to check media state + // + + Timer = NULL; + TimeRemained = Timeout; + Status = gBS->CreateEvent (EVT_TIMER, TPL_CALLBACK, NULL, NULL, &Timer); + if (EFI_ERROR (Status)) { + return EFI_DEVICE_ERROR; + } + + do { + Status = gBS->SetTimer ( + Timer, + TimerRelative, + MEDIA_STATE_DETECT_TIME_INTERVAL + ); + if (EFI_ERROR (Status)) { + gBS->CloseEvent(Timer); + return EFI_DEVICE_ERROR; + } + + do { + TimerStatus = gBS->CheckEvent (Timer); + if (!EFI_ERROR (TimerStatus)) { + + TimeRemained -= MEDIA_STATE_DETECT_TIME_INTERVAL; + Status = Aip->GetInformation ( + Aip, + &gEfiAdapterInfoMediaStateGuid, + (VOID **) &MediaInfo, + &DataSize + ); + if (!EFI_ERROR (Status)) { + + *MediaState = MediaInfo->MediaState; + FreePool (MediaInfo); + } else { + + if (MediaInfo != NULL) { + FreePool (MediaInfo); + } + gBS->CloseEvent(Timer); + return Status; + } + } + } while (TimerStatus == EFI_NOT_READY); + } while (*MediaState == EFI_NOT_READY && TimeRemained >= MEDIA_STATE_DETECT_TIME_INTERVAL); + + gBS->CloseEvent(Timer); + if (*MediaState == EFI_NOT_READY && TimeRemained < MEDIA_STATE_DETECT_TIME_INTERVAL) { + return EFI_TIMEOUT; + } else { + return EFI_SUCCESS; + } +} + +/** + Check the default address used by the IPv4 driver is static or dynamic (acquired + from DHCP). + + If the controller handle does not have the EFI_IP4_CONFIG2_PROTOCOL installed, the + default address is static. If failed to get the policy from Ip4 Config2 Protocol, + the default address is static. Otherwise, get the result from Ip4 Config2 Protocol. + + @param[in] Controller The controller handle which has the EFI_IP4_CONFIG2_PROTOCOL + relative with the default address to judge. + + @retval TRUE If the default address is static. + @retval FALSE If the default address is acquired from DHCP. + +**/ +BOOLEAN +NetLibDefaultAddressIsStatic ( + IN EFI_HANDLE Controller + ) +{ + EFI_STATUS Status; + EFI_IP4_CONFIG2_PROTOCOL *Ip4Config2; + UINTN DataSize; + EFI_IP4_CONFIG2_POLICY Policy; + BOOLEAN IsStatic; + + Ip4Config2 = NULL; + + DataSize = sizeof (EFI_IP4_CONFIG2_POLICY); + + IsStatic = TRUE; + + // + // Get Ip4Config2 policy. + // + Status = gBS->HandleProtocol (Controller, &gEfiIp4Config2ProtocolGuid, (VOID **) &Ip4Config2); + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + + Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypePolicy, &DataSize, &Policy); + if (EFI_ERROR (Status)) { + goto ON_EXIT; + } + + IsStatic = (BOOLEAN) (Policy == Ip4Config2PolicyStatic); + +ON_EXIT: + + return IsStatic; +} + +/** + Create an IPv4 device path node. + + If Node is NULL, then ASSERT(). + + The header type of IPv4 device path node is MESSAGING_DEVICE_PATH. + The header subtype of IPv4 device path node is MSG_IPv4_DP. + Get other info from parameters to make up the whole IPv4 device path node. + + @param[in, out] Node Pointer to the IPv4 device path node. + @param[in] Controller The controller handle. + @param[in] LocalIp The local IPv4 address. + @param[in] LocalPort The local port. + @param[in] RemoteIp The remote IPv4 address. + @param[in] RemotePort The remote port. + @param[in] Protocol The protocol type in the IP header. + @param[in] UseDefaultAddress Whether this instance is using default address or not. + +**/ +VOID +EFIAPI +NetLibCreateIPv4DPathNode ( + IN OUT IPv4_DEVICE_PATH *Node, + IN EFI_HANDLE Controller, + IN IP4_ADDR LocalIp, + IN UINT16 LocalPort, + IN IP4_ADDR RemoteIp, + IN UINT16 RemotePort, + IN UINT16 Protocol, + IN BOOLEAN UseDefaultAddress + ) +{ + ASSERT (Node != NULL); + + Node->Header.Type = MESSAGING_DEVICE_PATH; + Node->Header.SubType = MSG_IPv4_DP; + SetDevicePathNodeLength (&Node->Header, sizeof (IPv4_DEVICE_PATH)); + + CopyMem (&Node->LocalIpAddress, &LocalIp, sizeof (EFI_IPv4_ADDRESS)); + CopyMem (&Node->RemoteIpAddress, &RemoteIp, sizeof (EFI_IPv4_ADDRESS)); + + Node->LocalPort = LocalPort; + Node->RemotePort = RemotePort; + + Node->Protocol = Protocol; + + if (!UseDefaultAddress) { + Node->StaticIpAddress = TRUE; + } else { + Node->StaticIpAddress = NetLibDefaultAddressIsStatic (Controller); + } + + // + // Set the Gateway IP address to default value 0:0:0:0. + // Set the Subnet mask to default value 255:255:255:0. + // + ZeroMem (&Node->GatewayIpAddress, sizeof (EFI_IPv4_ADDRESS)); + SetMem (&Node->SubnetMask, sizeof (EFI_IPv4_ADDRESS), 0xff); + Node->SubnetMask.Addr[3] = 0; +} + +/** + Create an IPv6 device path node. + + If Node is NULL, then ASSERT(). + If LocalIp is NULL, then ASSERT(). + If RemoteIp is NULL, then ASSERT(). + + The header type of IPv6 device path node is MESSAGING_DEVICE_PATH. + The header subtype of IPv6 device path node is MSG_IPv6_DP. + Get other info from parameters to make up the whole IPv6 device path node. + + @param[in, out] Node Pointer to the IPv6 device path node. + @param[in] Controller The controller handle. + @param[in] LocalIp The local IPv6 address. + @param[in] LocalPort The local port. + @param[in] RemoteIp The remote IPv6 address. + @param[in] RemotePort The remote port. + @param[in] Protocol The protocol type in the IP header. + +**/ +VOID +EFIAPI +NetLibCreateIPv6DPathNode ( + IN OUT IPv6_DEVICE_PATH *Node, + IN EFI_HANDLE Controller, + IN EFI_IPv6_ADDRESS *LocalIp, + IN UINT16 LocalPort, + IN EFI_IPv6_ADDRESS *RemoteIp, + IN UINT16 RemotePort, + IN UINT16 Protocol + ) +{ + ASSERT (Node != NULL && LocalIp != NULL && RemoteIp != NULL); + + Node->Header.Type = MESSAGING_DEVICE_PATH; + Node->Header.SubType = MSG_IPv6_DP; + SetDevicePathNodeLength (&Node->Header, sizeof (IPv6_DEVICE_PATH)); + + CopyMem (&Node->LocalIpAddress, LocalIp, sizeof (EFI_IPv6_ADDRESS)); + CopyMem (&Node->RemoteIpAddress, RemoteIp, sizeof (EFI_IPv6_ADDRESS)); + + Node->LocalPort = LocalPort; + Node->RemotePort = RemotePort; + + Node->Protocol = Protocol; + + // + // Set default value to IPAddressOrigin, PrefixLength. + // Set the Gateway IP address to unspecified address. + // + Node->IpAddressOrigin = 0; + Node->PrefixLength = IP6_PREFIX_LENGTH; + ZeroMem (&Node->GatewayIpAddress, sizeof (EFI_IPv6_ADDRESS)); +} + +/** + Find the UNDI/SNP handle from controller and protocol GUID. + + If ProtocolGuid is NULL, then ASSERT(). + + For example, IP will open a MNP child to transmit/receive + packets, when MNP is stopped, IP should also be stopped. IP + needs to find its own private data which is related the IP's + service binding instance that is install on UNDI/SNP handle. + Now, the controller is either a MNP or ARP child handle. But + IP opens these handle BY_DRIVER, use that info, we can get the + UNDI/SNP handle. + + @param[in] Controller Then protocol handle to check. + @param[in] ProtocolGuid The protocol that is related with the handle. + + @return The UNDI/SNP handle or NULL for errors. + +**/ +EFI_HANDLE +EFIAPI +NetLibGetNicHandle ( + IN EFI_HANDLE Controller, + IN EFI_GUID *ProtocolGuid + ) +{ + EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenBuffer; + EFI_HANDLE Handle; + EFI_STATUS Status; + UINTN OpenCount; + UINTN Index; + + ASSERT (ProtocolGuid != NULL); + + Status = gBS->OpenProtocolInformation ( + Controller, + ProtocolGuid, + &OpenBuffer, + &OpenCount + ); + + if (EFI_ERROR (Status)) { + return NULL; + } + + Handle = NULL; + + for (Index = 0; Index < OpenCount; Index++) { + if ((OpenBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_DRIVER) != 0) { + Handle = OpenBuffer[Index].ControllerHandle; + break; + } + } + + gBS->FreePool (OpenBuffer); + return Handle; +} + +/** + Convert one Null-terminated ASCII string (decimal dotted) to EFI_IPv4_ADDRESS. + + @param[in] String The pointer to the Ascii string. + @param[out] Ip4Address The pointer to the converted IPv4 address. + + @retval EFI_SUCCESS Convert to IPv4 address successfully. + @retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL. + +**/ +EFI_STATUS +EFIAPI +NetLibAsciiStrToIp4 ( + IN CONST CHAR8 *String, + OUT EFI_IPv4_ADDRESS *Ip4Address + ) +{ + RETURN_STATUS Status; + CHAR8 *EndPointer; + + Status = AsciiStrToIpv4Address (String, &EndPointer, Ip4Address, NULL); + if (RETURN_ERROR (Status) || (*EndPointer != '\0')) { + return EFI_INVALID_PARAMETER; + } else { + return EFI_SUCCESS; + } +} + + +/** + Convert one Null-terminated ASCII string to EFI_IPv6_ADDRESS. The format of the + string is defined in RFC 4291 - Text Representation of Addresses. + + @param[in] String The pointer to the Ascii string. + @param[out] Ip6Address The pointer to the converted IPv6 address. + + @retval EFI_SUCCESS Convert to IPv6 address successfully. + @retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL. + +**/ +EFI_STATUS +EFIAPI +NetLibAsciiStrToIp6 ( + IN CONST CHAR8 *String, + OUT EFI_IPv6_ADDRESS *Ip6Address + ) +{ + RETURN_STATUS Status; + CHAR8 *EndPointer; + + Status = AsciiStrToIpv6Address (String, &EndPointer, Ip6Address, NULL); + if (RETURN_ERROR (Status) || (*EndPointer != '\0')) { + return EFI_INVALID_PARAMETER; + } else { + return EFI_SUCCESS; + } +} + + +/** + Convert one Null-terminated Unicode string (decimal dotted) to EFI_IPv4_ADDRESS. + + @param[in] String The pointer to the Ascii string. + @param[out] Ip4Address The pointer to the converted IPv4 address. + + @retval EFI_SUCCESS Convert to IPv4 address successfully. + @retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL. + +**/ +EFI_STATUS +EFIAPI +NetLibStrToIp4 ( + IN CONST CHAR16 *String, + OUT EFI_IPv4_ADDRESS *Ip4Address + ) +{ + RETURN_STATUS Status; + CHAR16 *EndPointer; + + Status = StrToIpv4Address (String, &EndPointer, Ip4Address, NULL); + if (RETURN_ERROR (Status) || (*EndPointer != L'\0')) { + return EFI_INVALID_PARAMETER; + } else { + return EFI_SUCCESS; + } +} + + +/** + Convert one Null-terminated Unicode string to EFI_IPv6_ADDRESS. The format of + the string is defined in RFC 4291 - Text Representation of Addresses. + + @param[in] String The pointer to the Ascii string. + @param[out] Ip6Address The pointer to the converted IPv6 address. + + @retval EFI_SUCCESS Convert to IPv6 address successfully. + @retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL. + +**/ +EFI_STATUS +EFIAPI +NetLibStrToIp6 ( + IN CONST CHAR16 *String, + OUT EFI_IPv6_ADDRESS *Ip6Address + ) +{ + RETURN_STATUS Status; + CHAR16 *EndPointer; + + Status = StrToIpv6Address (String, &EndPointer, Ip6Address, NULL); + if (RETURN_ERROR (Status) || (*EndPointer != L'\0')) { + return EFI_INVALID_PARAMETER; + } else { + return EFI_SUCCESS; + } +} + +/** + Convert one Null-terminated Unicode string to EFI_IPv6_ADDRESS and prefix length. + The format of the string is defined in RFC 4291 - Text Representation of Addresses + Prefixes: ipv6-address/prefix-length. + + @param[in] String The pointer to the Ascii string. + @param[out] Ip6Address The pointer to the converted IPv6 address. + @param[out] PrefixLength The pointer to the converted prefix length. + + @retval EFI_SUCCESS Convert to IPv6 address successfully. + @retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL. + +**/ +EFI_STATUS +EFIAPI +NetLibStrToIp6andPrefix ( + IN CONST CHAR16 *String, + OUT EFI_IPv6_ADDRESS *Ip6Address, + OUT UINT8 *PrefixLength + ) +{ + RETURN_STATUS Status; + CHAR16 *EndPointer; + + Status = StrToIpv6Address (String, &EndPointer, Ip6Address, PrefixLength); + if (RETURN_ERROR (Status) || (*EndPointer != L'\0')) { + return EFI_INVALID_PARAMETER; + } else { + return EFI_SUCCESS; + } +} + +/** + + Convert one EFI_IPv6_ADDRESS to Null-terminated Unicode string. + The text representation of address is defined in RFC 4291. + + @param[in] Ip6Address The pointer to the IPv6 address. + @param[out] String The buffer to return the converted string. + @param[in] StringSize The length in bytes of the input String. + + @retval EFI_SUCCESS Convert to string successfully. + @retval EFI_INVALID_PARAMETER The input parameter is invalid. + @retval EFI_BUFFER_TOO_SMALL The BufferSize is too small for the result. BufferSize has been + updated with the size needed to complete the request. +**/ +EFI_STATUS +EFIAPI +NetLibIp6ToStr ( + IN EFI_IPv6_ADDRESS *Ip6Address, + OUT CHAR16 *String, + IN UINTN StringSize + ) +{ + UINT16 Ip6Addr[8]; + UINTN Index; + UINTN LongestZerosStart; + UINTN LongestZerosLength; + UINTN CurrentZerosStart; + UINTN CurrentZerosLength; + CHAR16 Buffer[sizeof"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"]; + CHAR16 *Ptr; + + if (Ip6Address == NULL || String == NULL || StringSize == 0) { + return EFI_INVALID_PARAMETER; + } + + // + // Convert the UINT8 array to an UINT16 array for easy handling. + // + ZeroMem (Ip6Addr, sizeof (Ip6Addr)); + for (Index = 0; Index < 16; Index++) { + Ip6Addr[Index / 2] |= (Ip6Address->Addr[Index] << ((1 - (Index % 2)) << 3)); + } + + // + // Find the longest zeros and mark it. + // + CurrentZerosStart = DEFAULT_ZERO_START; + CurrentZerosLength = 0; + LongestZerosStart = DEFAULT_ZERO_START; + LongestZerosLength = 0; + for (Index = 0; Index < 8; Index++) { + if (Ip6Addr[Index] == 0) { + if (CurrentZerosStart == DEFAULT_ZERO_START) { + CurrentZerosStart = Index; + CurrentZerosLength = 1; + } else { + CurrentZerosLength++; + } + } else { + if (CurrentZerosStart != DEFAULT_ZERO_START) { + if (CurrentZerosLength > 2 && (LongestZerosStart == (DEFAULT_ZERO_START) || CurrentZerosLength > LongestZerosLength)) { + LongestZerosStart = CurrentZerosStart; + LongestZerosLength = CurrentZerosLength; + } + CurrentZerosStart = DEFAULT_ZERO_START; + CurrentZerosLength = 0; + } + } + } + + if (CurrentZerosStart != DEFAULT_ZERO_START && CurrentZerosLength > 2) { + if (LongestZerosStart == DEFAULT_ZERO_START || LongestZerosLength < CurrentZerosLength) { + LongestZerosStart = CurrentZerosStart; + LongestZerosLength = CurrentZerosLength; + } + } + + Ptr = Buffer; + for (Index = 0; Index < 8; Index++) { + if (LongestZerosStart != DEFAULT_ZERO_START && Index >= LongestZerosStart && Index < LongestZerosStart + LongestZerosLength) { + if (Index == LongestZerosStart) { + *Ptr++ = L':'; + } + continue; + } + if (Index != 0) { + *Ptr++ = L':'; + } + Ptr += UnicodeSPrint(Ptr, 10, L"%x", Ip6Addr[Index]); + } + + if (LongestZerosStart != DEFAULT_ZERO_START && LongestZerosStart + LongestZerosLength == 8) { + *Ptr++ = L':'; + } + *Ptr = L'\0'; + + if ((UINTN)Ptr - (UINTN)Buffer > StringSize) { + return EFI_BUFFER_TOO_SMALL; + } + + StrCpyS (String, StringSize / sizeof (CHAR16), Buffer); + + return EFI_SUCCESS; +} + +/** + This function obtains the system guid from the smbios table. + + If SystemGuid is NULL, then ASSERT(). + + @param[out] SystemGuid The pointer of the returned system guid. + + @retval EFI_SUCCESS Successfully obtained the system guid. + @retval EFI_NOT_FOUND Did not find the SMBIOS table. + +**/ +EFI_STATUS +EFIAPI +NetLibGetSystemGuid ( + OUT EFI_GUID *SystemGuid + ) +{ + EFI_STATUS Status; + SMBIOS_TABLE_ENTRY_POINT *SmbiosTable; + SMBIOS_TABLE_3_0_ENTRY_POINT *Smbios30Table; + SMBIOS_STRUCTURE_POINTER Smbios; + SMBIOS_STRUCTURE_POINTER SmbiosEnd; + CHAR8 *String; + + ASSERT (SystemGuid != NULL); + + SmbiosTable = NULL; + Status = EfiGetSystemConfigurationTable (&gEfiSmbios3TableGuid, (VOID **) &Smbios30Table); + if (!(EFI_ERROR (Status) || Smbios30Table == NULL)) { + Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) Smbios30Table->TableAddress; + SmbiosEnd.Raw = (UINT8 *) (UINTN) (Smbios30Table->TableAddress + Smbios30Table->TableMaximumSize); + } else { + Status = EfiGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable); + if (EFI_ERROR (Status) || SmbiosTable == NULL) { + return EFI_NOT_FOUND; + } + Smbios.Hdr = (SMBIOS_STRUCTURE *) (UINTN) SmbiosTable->TableAddress; + SmbiosEnd.Raw = (UINT8 *) ((UINTN) SmbiosTable->TableAddress + SmbiosTable->TableLength); + } + + do { + if (Smbios.Hdr->Type == 1) { + if (Smbios.Hdr->Length < 0x19) { + // + // Older version did not support UUID. + // + return EFI_NOT_FOUND; + } + + // + // SMBIOS tables are byte packed so we need to do a byte copy to + // prevend alignment faults on Itanium-based platform. + // + CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof (EFI_GUID)); + return EFI_SUCCESS; + } + + // + // Go to the next SMBIOS structure. Each SMBIOS structure may include 2 parts: + // 1. Formatted section; 2. Unformatted string section. So, 2 steps are needed + // to skip one SMBIOS structure. + // + + // + // Step 1: Skip over formatted section. + // + String = (CHAR8 *) (Smbios.Raw + Smbios.Hdr->Length); + + // + // Step 2: Skip over unformated string section. + // + do { + // + // Each string is terminated with a NULL(00h) BYTE and the sets of strings + // is terminated with an additional NULL(00h) BYTE. + // + for ( ; *String != 0; String++) { + } + + if (*(UINT8*)++String == 0) { + // + // Pointer to the next SMBIOS structure. + // + Smbios.Raw = (UINT8 *)++String; + break; + } + } while (TRUE); + } while (Smbios.Raw < SmbiosEnd.Raw); + return EFI_NOT_FOUND; +} + +/** + Create Dns QName according the queried domain name. + + If DomainName is NULL, then ASSERT(). + + QName is a domain name represented as a sequence of labels, + where each label consists of a length octet followed by that + number of octets. The QName terminates with the zero + length octet for the null label of the root. Caller should + take responsibility to free the buffer in returned pointer. + + @param DomainName The pointer to the queried domain name string. + + @retval NULL Failed to fill QName. + @return QName filled successfully. + +**/ +CHAR8 * +EFIAPI +NetLibCreateDnsQName ( + IN CHAR16 *DomainName + ) +{ + CHAR8 *QueryName; + UINTN QueryNameSize; + CHAR8 *Header; + CHAR8 *Tail; + UINTN Len; + UINTN Index; + + ASSERT (DomainName != NULL); + + QueryName = NULL; + QueryNameSize = 0; + Header = NULL; + Tail = NULL; + + // + // One byte for first label length, one byte for terminated length zero. + // + QueryNameSize = StrLen (DomainName) + 2; + + if (QueryNameSize > DNS_MAX_NAME_SIZE) { + return NULL; + } + + QueryName = AllocateZeroPool (QueryNameSize); + if (QueryName == NULL) { + return NULL; + } + + Header = QueryName; + Tail = Header + 1; + Len = 0; + for (Index = 0; DomainName[Index] != 0; Index++) { + *Tail = (CHAR8) DomainName[Index]; + if (*Tail == '.') { + *Header = (CHAR8) Len; + Header = Tail; + Tail ++; + Len = 0; + } else { + Tail++; + Len++; + } + } + *Header = (CHAR8) Len; + *Tail = 0; + + return QueryName; +} diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf new file mode 100644 index 000000000..ad0727c42 --- /dev/null +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf @@ -0,0 +1,67 @@ +## @file +# This library instance provides the basic network services. +# +# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
+# 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. +# +## + + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = DxeNetLib + MODULE_UNI_FILE = DxeNetLib.uni + FILE_GUID = db6dcef3-9f4e-4340-9351-fc35aa8a5888 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = NetLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +[Sources] + DxeNetLib.c + NetBuffer.c + + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + + +[LibraryClasses] + BaseLib + DebugLib + BaseMemoryLib + UefiBootServicesTableLib + UefiRuntimeServicesTableLib + UefiLib + MemoryAllocationLib + DevicePathLib + PrintLib + + +[Guids] + gEfiSmbiosTableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiSmbios3TableGuid ## SOMETIMES_CONSUMES ## SystemTable + gEfiAdapterInfoMediaStateGuid ## SOMETIMES_CONSUMES + + +[Protocols] + gEfiSimpleNetworkProtocolGuid ## SOMETIMES_CONSUMES + gEfiManagedNetworkProtocolGuid ## SOMETIMES_CONSUMES + gEfiManagedNetworkServiceBindingProtocolGuid ## SOMETIMES_CONSUMES + gEfiIp4Config2ProtocolGuid ## SOMETIMES_CONSUMES + gEfiComponentNameProtocolGuid ## SOMETIMES_CONSUMES + gEfiComponentName2ProtocolGuid ## SOMETIMES_CONSUMES + gEfiAdapterInformationProtocolGuid ## SOMETIMES_CONSUMES \ No newline at end of file diff --git a/MdeModulePkg/Library/DxeNetLib/DxeNetLib.uni b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.uni new file mode 100644 index 000000000..c324a50a6 --- /dev/null +++ b/MdeModulePkg/Library/DxeNetLib/DxeNetLib.uni @@ -0,0 +1,22 @@ +// /** @file +// This library instance provides the basic network services. +// +// This library instance provides the basic network services. +// +// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+// +// This program and the accompanying materials +// are licensed and made available under the terms and conditions of the BSD License +// which accompanies this distribution. The full text of the license may be found at +// http://opensource.org/licenses/bsd-license.php +// +// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Provides the basic network services" + +#string STR_MODULE_DESCRIPTION #language en-US "This library instance provides the basic network services." + diff --git a/MdeModulePkg/Library/DxeNetLib/NetBuffer.c b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c new file mode 100644 index 000000000..d0e2b9f2a --- /dev/null +++ b/MdeModulePkg/Library/DxeNetLib/NetBuffer.c @@ -0,0 +1,1896 @@ +/** @file + Network library functions providing net buffer operation support. + +Copyright (c) 2005 - 2017, Intel Corporation. All rights reserved.
+This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include + +#include +#include +#include +#include +#include +#include + + +/** + Allocate and build up the sketch for a NET_BUF. + + The net buffer allocated has the BlockOpNum's NET_BLOCK_OP, and its associated + NET_VECTOR has the BlockNum's NET_BLOCK. But all the NET_BLOCK_OP and + NET_BLOCK remain un-initialized. + + @param[in] BlockNum The number of NET_BLOCK in the vector of net buffer + @param[in] BlockOpNum The number of NET_BLOCK_OP in the net buffer + + @return Pointer to the allocated NET_BUF, or NULL if the + allocation failed due to resource limit. + +**/ +NET_BUF * +NetbufAllocStruct ( + IN UINT32 BlockNum, + IN UINT32 BlockOpNum + ) +{ + NET_BUF *Nbuf; + NET_VECTOR *Vector; + + ASSERT (BlockOpNum >= 1); + + // + // Allocate three memory blocks. + // + Nbuf = AllocateZeroPool (NET_BUF_SIZE (BlockOpNum)); + + if (Nbuf == NULL) { + return NULL; + } + + Nbuf->Signature = NET_BUF_SIGNATURE; + Nbuf->RefCnt = 1; + Nbuf->BlockOpNum = BlockOpNum; + InitializeListHead (&Nbuf->List); + + if (BlockNum != 0) { + Vector = AllocateZeroPool (NET_VECTOR_SIZE (BlockNum)); + + if (Vector == NULL) { + goto FreeNbuf; + } + + Vector->Signature = NET_VECTOR_SIGNATURE; + Vector->RefCnt = 1; + Vector->BlockNum = BlockNum; + Nbuf->Vector = Vector; + } + + return Nbuf; + +FreeNbuf: + + FreePool (Nbuf); + return NULL; +} + + +/** + Allocate a single block NET_BUF. Upon allocation, all the + free space is in the tail room. + + @param[in] Len The length of the block. + + @return Pointer to the allocated NET_BUF, or NULL if the + allocation failed due to resource limit. + +**/ +NET_BUF * +EFIAPI +NetbufAlloc ( + IN UINT32 Len + ) +{ + NET_BUF *Nbuf; + NET_VECTOR *Vector; + UINT8 *Bulk; + + ASSERT (Len > 0); + + Nbuf = NetbufAllocStruct (1, 1); + + if (Nbuf == NULL) { + return NULL; + } + + Bulk = AllocatePool (Len); + + if (Bulk == NULL) { + goto FreeNBuf; + } + + Vector = Nbuf->Vector; + Vector->Len = Len; + + Vector->Block[0].Bulk = Bulk; + Vector->Block[0].Len = Len; + + Nbuf->BlockOp[0].BlockHead = Bulk; + Nbuf->BlockOp[0].BlockTail = Bulk + Len; + + Nbuf->BlockOp[0].Head = Bulk; + Nbuf->BlockOp[0].Tail = Bulk; + Nbuf->BlockOp[0].Size = 0; + + return Nbuf; + +FreeNBuf: + FreePool (Nbuf); + return NULL; +} + +/** + Free the net vector. + + Decrease the reference count of the net vector by one. The real resource free + operation isn't performed until the reference count of the net vector is + decreased to 0. + + @param[in] Vector Pointer to the NET_VECTOR to be freed. + +**/ +VOID +NetbufFreeVector ( + IN NET_VECTOR *Vector + ) +{ + UINT32 Index; + + ASSERT (Vector != NULL); + NET_CHECK_SIGNATURE (Vector, NET_VECTOR_SIGNATURE); + ASSERT (Vector->RefCnt > 0); + + Vector->RefCnt--; + + if (Vector->RefCnt > 0) { + return; + } + + if (Vector->Free != NULL) { + // + // Call external free function to free the vector if it + // isn't NULL. If NET_VECTOR_OWN_FIRST is set, release the + // first block since it is allocated by us + // + if ((Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) { + gBS->FreePool (Vector->Block[0].Bulk); + } + + Vector->Free (Vector->Arg); + + } else { + // + // Free each memory block associated with the Vector + // + for (Index = 0; Index < Vector->BlockNum; Index++) { + gBS->FreePool (Vector->Block[Index].Bulk); + } + } + + FreePool (Vector); +} + + +/** + Free the net buffer and its associated NET_VECTOR. + + Decrease the reference count of the net buffer by one. Free the associated net + vector and itself if the reference count of the net buffer is decreased to 0. + The net vector free operation just decrease the reference count of the net + vector by one and do the real resource free operation when the reference count + of the net vector is 0. + + @param[in] Nbuf Pointer to the NET_BUF to be freed. + +**/ +VOID +EFIAPI +NetbufFree ( + IN NET_BUF *Nbuf + ) +{ + ASSERT (Nbuf != NULL); + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + ASSERT (Nbuf->RefCnt > 0); + + Nbuf->RefCnt--; + + if (Nbuf->RefCnt == 0) { + // + // Update Vector only when NBuf is to be released. That is, + // all the sharing of Nbuf increse Vector's RefCnt by one + // + NetbufFreeVector (Nbuf->Vector); + FreePool (Nbuf); + } +} + + +/** + Create a copy of the net buffer that shares the associated net vector. + + The reference count of the newly created net buffer is set to 1. The reference + count of the associated net vector is increased by one. + + @param[in] Nbuf Pointer to the net buffer to be cloned. + + @return Pointer to the cloned net buffer, or NULL if the + allocation failed due to resource limit. + +**/ +NET_BUF * +EFIAPI +NetbufClone ( + IN NET_BUF *Nbuf + ) +{ + NET_BUF *Clone; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + Clone = AllocatePool (NET_BUF_SIZE (Nbuf->BlockOpNum)); + + if (Clone == NULL) { + return NULL; + } + + Clone->Signature = NET_BUF_SIGNATURE; + Clone->RefCnt = 1; + InitializeListHead (&Clone->List); + + Clone->Ip = Nbuf->Ip; + Clone->Tcp = Nbuf->Tcp; + + CopyMem (Clone->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); + + NET_GET_REF (Nbuf->Vector); + + Clone->Vector = Nbuf->Vector; + Clone->BlockOpNum = Nbuf->BlockOpNum; + Clone->TotalSize = Nbuf->TotalSize; + CopyMem (Clone->BlockOp, Nbuf->BlockOp, sizeof (NET_BLOCK_OP) * Nbuf->BlockOpNum); + + return Clone; +} + + +/** + Create a duplicated copy of the net buffer with data copied and HeadSpace + bytes of head space reserved. + + The duplicated net buffer will allocate its own memory to hold the data of the + source net buffer. + + @param[in] Nbuf Pointer to the net buffer to be duplicated from. + @param[in, out] Duplicate Pointer to the net buffer to duplicate to, if + NULL a new net buffer is allocated. + @param[in] HeadSpace Length of the head space to reserve. + + @return Pointer to the duplicated net buffer, or NULL if + the allocation failed due to resource limit. + +**/ +NET_BUF * +EFIAPI +NetbufDuplicate ( + IN NET_BUF *Nbuf, + IN OUT NET_BUF *Duplicate OPTIONAL, + IN UINT32 HeadSpace + ) +{ + UINT8 *Dst; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + if (Duplicate == NULL) { + Duplicate = NetbufAlloc (Nbuf->TotalSize + HeadSpace); + } + + if (Duplicate == NULL) { + return NULL; + } + + // + // Don't set the IP and TCP head point, since it is most + // like that they are pointing to the memory of Nbuf. + // + CopyMem (Duplicate->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); + NetbufReserve (Duplicate, HeadSpace); + + Dst = NetbufAllocSpace (Duplicate, Nbuf->TotalSize, NET_BUF_TAIL); + NetbufCopy (Nbuf, 0, Nbuf->TotalSize, Dst); + + return Duplicate; +} + + +/** + Free a list of net buffers. + + @param[in, out] Head Pointer to the head of linked net buffers. + +**/ +VOID +EFIAPI +NetbufFreeList ( + IN OUT LIST_ENTRY *Head + ) +{ + LIST_ENTRY *Entry; + LIST_ENTRY *Next; + NET_BUF *Nbuf; + + Entry = Head->ForwardLink; + + NET_LIST_FOR_EACH_SAFE (Entry, Next, Head) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + RemoveEntryList (Entry); + NetbufFree (Nbuf); + } + + ASSERT (IsListEmpty (Head)); +} + + +/** + Get the index of NET_BLOCK_OP that contains the byte at Offset in the net + buffer. + + This can be used to, for example, retrieve the IP header in the packet. It + also can be used to get the fragment that contains the byte which is used + mainly by the library implementation itself. + + @param[in] Nbuf Pointer to the net buffer. + @param[in] Offset The offset of the byte. + @param[out] Index Index of the NET_BLOCK_OP that contains the byte at + Offset. + + @return Pointer to the Offset'th byte of data in the net buffer, or NULL + if there is no such data in the net buffer. + +**/ +UINT8 * +EFIAPI +NetbufGetByte ( + IN NET_BUF *Nbuf, + IN UINT32 Offset, + OUT UINT32 *Index OPTIONAL + ) +{ + NET_BLOCK_OP *BlockOp; + UINT32 Loop; + UINT32 Len; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + if (Offset >= Nbuf->TotalSize) { + return NULL; + } + + BlockOp = Nbuf->BlockOp; + Len = 0; + + for (Loop = 0; Loop < Nbuf->BlockOpNum; Loop++) { + + if (Len + BlockOp[Loop].Size <= Offset) { + Len += BlockOp[Loop].Size; + continue; + } + + if (Index != NULL) { + *Index = Loop; + } + + return BlockOp[Loop].Head + (Offset - Len); + } + + return NULL; +} + + + +/** + Set the NET_BLOCK and corresponding NET_BLOCK_OP in the net buffer and + corresponding net vector according to the bulk pointer and bulk length. + + All the pointers in the Index'th NET_BLOCK and NET_BLOCK_OP are set to the + bulk's head and tail respectively. So, this function alone can't be used by + NetbufAlloc. + + @param[in, out] Nbuf Pointer to the net buffer. + @param[in] Bulk Pointer to the data. + @param[in] Len Length of the bulk data. + @param[in] Index The data block index in the net buffer the bulk + data should belong to. + +**/ +VOID +NetbufSetBlock ( + IN OUT NET_BUF *Nbuf, + IN UINT8 *Bulk, + IN UINT32 Len, + IN UINT32 Index + ) +{ + NET_BLOCK_OP *BlockOp; + NET_BLOCK *Block; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); + ASSERT (Index < Nbuf->BlockOpNum); + + Block = &(Nbuf->Vector->Block[Index]); + BlockOp = &(Nbuf->BlockOp[Index]); + Block->Len = Len; + Block->Bulk = Bulk; + BlockOp->BlockHead = Bulk; + BlockOp->BlockTail = Bulk + Len; + BlockOp->Head = Bulk; + BlockOp->Tail = Bulk + Len; + BlockOp->Size = Len; +} + + + +/** + Set the NET_BLOCK_OP in the net buffer. The corresponding NET_BLOCK + structure is left untouched. + + Some times, there is no 1:1 relationship between NET_BLOCK and NET_BLOCK_OP. + For example, that in NetbufGetFragment. + + @param[in, out] Nbuf Pointer to the net buffer. + @param[in] Bulk Pointer to the data. + @param[in] Len Length of the bulk data. + @param[in] Index The data block index in the net buffer the bulk + data should belong to. + +**/ +VOID +NetbufSetBlockOp ( + IN OUT NET_BUF *Nbuf, + IN UINT8 *Bulk, + IN UINT32 Len, + IN UINT32 Index + ) +{ + NET_BLOCK_OP *BlockOp; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + ASSERT (Index < Nbuf->BlockOpNum); + + BlockOp = &(Nbuf->BlockOp[Index]); + BlockOp->BlockHead = Bulk; + BlockOp->BlockTail = Bulk + Len; + BlockOp->Head = Bulk; + BlockOp->Tail = Bulk + Len; + BlockOp->Size = Len; +} + + +/** + Helper function for NetbufGetFragment. NetbufGetFragment may allocate the + first block to reserve HeadSpace bytes header space. So it needs to create a + new net vector for the first block and can avoid copy for the remaining data + by sharing the old net vector. + + @param[in] Arg Point to the old NET_VECTOR. + +**/ +VOID +EFIAPI +NetbufGetFragmentFree ( + IN VOID *Arg + ) +{ + NET_VECTOR *Vector; + + Vector = (NET_VECTOR *)Arg; + NetbufFreeVector (Vector); +} + + +/** + Create a NET_BUF structure which contains Len byte data of Nbuf starting from + Offset. + + A new NET_BUF structure will be created but the associated data in NET_VECTOR + is shared. This function exists to do IP packet fragmentation. + + @param[in] Nbuf Pointer to the net buffer to be extracted. + @param[in] Offset Starting point of the data to be included in the new + net buffer. + @param[in] Len Bytes of data to be included in the new net buffer. + @param[in] HeadSpace Bytes of head space to reserve for protocol header. + + @return Pointer to the cloned net buffer, or NULL if the + allocation failed due to resource limit. + +**/ +NET_BUF * +EFIAPI +NetbufGetFragment ( + IN NET_BUF *Nbuf, + IN UINT32 Offset, + IN UINT32 Len, + IN UINT32 HeadSpace + ) +{ + NET_BUF *Child; + NET_VECTOR *Vector; + NET_BLOCK_OP *BlockOp; + UINT32 CurBlockOp; + UINT32 BlockOpNum; + UINT8 *FirstBulk; + UINT32 Index; + UINT32 First; + UINT32 Last; + UINT32 FirstSkip; + UINT32 FirstLen; + UINT32 LastLen; + UINT32 Cur; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + if ((Len == 0) || (Offset + Len > Nbuf->TotalSize)) { + return NULL; + } + + // + // First find the first and last BlockOp that contains + // the valid data, and compute the offset of the first + // BlockOp and length of the last BlockOp + // + BlockOp = Nbuf->BlockOp; + Cur = 0; + + for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { + if (Offset < Cur + BlockOp[Index].Size) { + break; + } + + Cur += BlockOp[Index].Size; + } + + // + // First is the index of the first BlockOp, FirstSkip is + // the offset of the first byte in the first BlockOp. + // + First = Index; + FirstSkip = Offset - Cur; + FirstLen = BlockOp[Index].Size - FirstSkip; + + Last = 0; + LastLen = 0; + + if (Len > FirstLen) { + Cur += BlockOp[Index].Size; + Index++; + + for (; Index < Nbuf->BlockOpNum; Index++) { + if (Offset + Len <= Cur + BlockOp[Index].Size) { + Last = Index; + LastLen = Offset + Len - Cur; + break; + } + + Cur += BlockOp[Index].Size; + } + + } else { + Last = First; + LastLen = Len; + FirstLen = Len; + } + + ASSERT (Last >= First); + BlockOpNum = Last - First + 1; + CurBlockOp = 0; + + if (HeadSpace != 0) { + // + // Allocate an extra block to accomdate the head space. + // + BlockOpNum++; + + Child = NetbufAllocStruct (1, BlockOpNum); + + if (Child == NULL) { + return NULL; + } + + FirstBulk = AllocatePool (HeadSpace); + + if (FirstBulk == NULL) { + goto FreeChild; + } + + Vector = Child->Vector; + Vector->Free = NetbufGetFragmentFree; + Vector->Arg = Nbuf->Vector; + Vector->Flag = NET_VECTOR_OWN_FIRST; + Vector->Len = HeadSpace; + + // + // Reserve the head space in the first block + // + NetbufSetBlock (Child, FirstBulk, HeadSpace, 0); + Child->BlockOp[0].Head += HeadSpace; + Child->BlockOp[0].Size = 0; + CurBlockOp++; + + } else { + Child = NetbufAllocStruct (0, BlockOpNum); + + if (Child == NULL) { + return NULL; + } + + Child->Vector = Nbuf->Vector; + } + + NET_GET_REF (Nbuf->Vector); + Child->TotalSize = Len; + + // + // Set all the BlockOp up, the first and last one are special + // and need special process. + // + NetbufSetBlockOp ( + Child, + Nbuf->BlockOp[First].Head + FirstSkip, + FirstLen, + CurBlockOp++ + ); + + for (Index = First + 1; Index < Last; Index++) { + NetbufSetBlockOp ( + Child, + BlockOp[Index].Head, + BlockOp[Index].Size, + CurBlockOp++ + ); + } + + if (First != Last) { + NetbufSetBlockOp ( + Child, + BlockOp[Last].Head, + LastLen, + CurBlockOp + ); + } + + CopyMem (Child->ProtoData, Nbuf->ProtoData, NET_PROTO_DATA); + return Child; + +FreeChild: + + FreePool (Child); + return NULL; +} + + + +/** + Build a NET_BUF from external blocks. + + A new NET_BUF structure will be created from external blocks. Additional block + of memory will be allocated to hold reserved HeadSpace bytes of header room + and existing HeadLen bytes of header but the external blocks are shared by the + net buffer to avoid data copying. + + @param[in] ExtFragment Pointer to the data block. + @param[in] ExtNum The number of the data blocks. + @param[in] HeadSpace The head space to be reserved. + @param[in] HeadLen The length of the protocol header, This function + will pull that number of data into a linear block. + @param[in] ExtFree Pointer to the caller provided free function. + @param[in] Arg The argument passed to ExtFree when ExtFree is + called. + + @return Pointer to the net buffer built from the data blocks, + or NULL if the allocation failed due to resource + limit. + +**/ +NET_BUF * +EFIAPI +NetbufFromExt ( + IN NET_FRAGMENT *ExtFragment, + IN UINT32 ExtNum, + IN UINT32 HeadSpace, + IN UINT32 HeadLen, + IN NET_VECTOR_EXT_FREE ExtFree, + IN VOID *Arg OPTIONAL + ) +{ + NET_BUF *Nbuf; + NET_VECTOR *Vector; + NET_FRAGMENT SavedFragment; + UINT32 SavedIndex; + UINT32 TotalLen; + UINT32 BlockNum; + UINT8 *FirstBlock; + UINT32 FirstBlockLen; + UINT8 *Header; + UINT32 CurBlock; + UINT32 Index; + UINT32 Len; + UINT32 Copied; + + ASSERT ((ExtFragment != NULL) && (ExtNum > 0) && (ExtFree != NULL)); + + SavedFragment.Bulk = NULL; + SavedFragment.Len = 0; + + FirstBlockLen = 0; + FirstBlock = NULL; + BlockNum = ExtNum; + Index = 0; + TotalLen = 0; + SavedIndex = 0; + Len = 0; + Copied = 0; + + // + // No need to consolidate the header if the first block is + // longer than the header length or there is only one block. + // + if ((ExtFragment[0].Len >= HeadLen) || (ExtNum == 1)) { + HeadLen = 0; + } + + // + // Allocate an extra block if we need to: + // 1. Allocate some header space + // 2. aggreate the packet header + // + if ((HeadSpace != 0) || (HeadLen != 0)) { + FirstBlockLen = HeadLen + HeadSpace; + FirstBlock = AllocatePool (FirstBlockLen); + + if (FirstBlock == NULL) { + return NULL; + } + + BlockNum++; + } + + // + // Copy the header to the first block, reduce the NET_BLOCK + // to allocate by one for each block that is completely covered + // by the first bulk. + // + if (HeadLen != 0) { + Len = HeadLen; + Header = FirstBlock + HeadSpace; + + for (Index = 0; Index < ExtNum; Index++) { + if (Len >= ExtFragment[Index].Len) { + CopyMem (Header, ExtFragment[Index].Bulk, ExtFragment[Index].Len); + + Copied += ExtFragment[Index].Len; + Len -= ExtFragment[Index].Len; + Header += ExtFragment[Index].Len; + TotalLen += ExtFragment[Index].Len; + BlockNum--; + + if (Len == 0) { + // + // Increament the index number to point to the next + // non-empty fragment. + // + Index++; + break; + } + + } else { + CopyMem (Header, ExtFragment[Index].Bulk, Len); + + Copied += Len; + TotalLen += Len; + + // + // Adjust the block structure to exclude the data copied, + // So, the left-over block can be processed as other blocks. + // But it must be recovered later. (SavedIndex > 0) always + // holds since we don't aggreate the header if the first block + // is bigger enough that the header is continuous + // + SavedIndex = Index; + SavedFragment = ExtFragment[Index]; + ExtFragment[Index].Bulk += Len; + ExtFragment[Index].Len -= Len; + break; + } + } + } + + Nbuf = NetbufAllocStruct (BlockNum, BlockNum); + + if (Nbuf == NULL) { + goto FreeFirstBlock; + } + + Vector = Nbuf->Vector; + Vector->Free = ExtFree; + Vector->Arg = Arg; + Vector->Flag = ((FirstBlockLen != 0) ? NET_VECTOR_OWN_FIRST : 0); + + // + // Set the first block up which may contain + // some head space and aggregated header + // + CurBlock = 0; + + if (FirstBlockLen != 0) { + NetbufSetBlock (Nbuf, FirstBlock, HeadSpace + Copied, 0); + Nbuf->BlockOp[0].Head += HeadSpace; + Nbuf->BlockOp[0].Size = Copied; + + CurBlock++; + } + + for (; Index < ExtNum; Index++) { + NetbufSetBlock (Nbuf, ExtFragment[Index].Bulk, ExtFragment[Index].Len, CurBlock); + TotalLen += ExtFragment[Index].Len; + CurBlock++; + } + + Vector->Len = TotalLen + HeadSpace; + Nbuf->TotalSize = TotalLen; + + if (SavedIndex != 0) { + ExtFragment[SavedIndex] = SavedFragment; + } + + return Nbuf; + +FreeFirstBlock: + if (FirstBlock != NULL) { + FreePool (FirstBlock); + } + return NULL; +} + + +/** + Build a fragment table to contain the fragments in the net buffer. This is the + opposite operation of the NetbufFromExt. + + @param[in] Nbuf Point to the net buffer. + @param[in, out] ExtFragment Pointer to the data block. + @param[in, out] ExtNum The number of the data blocks. + + @retval EFI_BUFFER_TOO_SMALL The number of non-empty block is bigger than + ExtNum. + @retval EFI_SUCCESS Fragment table is built successfully. + +**/ +EFI_STATUS +EFIAPI +NetbufBuildExt ( + IN NET_BUF *Nbuf, + IN OUT NET_FRAGMENT *ExtFragment, + IN OUT UINT32 *ExtNum + ) +{ + UINT32 Index; + UINT32 Current; + + Current = 0; + + for (Index = 0; (Index < Nbuf->BlockOpNum); Index++) { + if (Nbuf->BlockOp[Index].Size == 0) { + continue; + } + + if (Current < *ExtNum) { + ExtFragment[Current].Bulk = Nbuf->BlockOp[Index].Head; + ExtFragment[Current].Len = Nbuf->BlockOp[Index].Size; + Current++; + } else { + return EFI_BUFFER_TOO_SMALL; + } + } + + *ExtNum = Current; + return EFI_SUCCESS; +} + + +/** + Build a net buffer from a list of net buffers. + + All the fragments will be collected from the list of NEW_BUF and then a new + net buffer will be created through NetbufFromExt. + + @param[in] BufList A List of the net buffer. + @param[in] HeadSpace The head space to be reserved. + @param[in] HeaderLen The length of the protocol header, This function + will pull that number of data into a linear block. + @param[in] ExtFree Pointer to the caller provided free function. + @param[in] Arg The argument passed to ExtFree when ExtFree is called. + + @return Pointer to the net buffer built from the list of net + buffers. + +**/ +NET_BUF * +EFIAPI +NetbufFromBufList ( + IN LIST_ENTRY *BufList, + IN UINT32 HeadSpace, + IN UINT32 HeaderLen, + IN NET_VECTOR_EXT_FREE ExtFree, + IN VOID *Arg OPTIONAL + ) +{ + NET_FRAGMENT *Fragment; + UINT32 FragmentNum; + LIST_ENTRY *Entry; + NET_BUF *Nbuf; + UINT32 Index; + UINT32 Current; + + // + //Compute how many blocks are there + // + FragmentNum = 0; + + NET_LIST_FOR_EACH (Entry, BufList) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + FragmentNum += Nbuf->BlockOpNum; + } + + // + //Allocate and copy block points + // + Fragment = AllocatePool (sizeof (NET_FRAGMENT) * FragmentNum); + + if (Fragment == NULL) { + return NULL; + } + + Current = 0; + + NET_LIST_FOR_EACH (Entry, BufList) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { + if (Nbuf->BlockOp[Index].Size != 0) { + Fragment[Current].Bulk = Nbuf->BlockOp[Index].Head; + Fragment[Current].Len = Nbuf->BlockOp[Index].Size; + Current++; + } + } + } + + Nbuf = NetbufFromExt (Fragment, Current, HeadSpace, HeaderLen, ExtFree, Arg); + FreePool (Fragment); + + return Nbuf; +} + + +/** + Reserve some space in the header room of the net buffer. + + Upon allocation, all the space are in the tail room of the buffer. Call this + function to move some space to the header room. This function is quite limited + in that it can only reserve space from the first block of an empty NET_BUF not + built from the external. But it should be enough for the network stack. + + @param[in, out] Nbuf Pointer to the net buffer. + @param[in] Len The length of buffer to be reserved from the header. + +**/ +VOID +EFIAPI +NetbufReserve ( + IN OUT NET_BUF *Nbuf, + IN UINT32 Len + ) +{ + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); + + ASSERT ((Nbuf->BlockOpNum == 1) && (Nbuf->TotalSize == 0)); + ASSERT ((Nbuf->Vector->Free == NULL) && (Nbuf->Vector->Len >= Len)); + + Nbuf->BlockOp[0].Head += Len; + Nbuf->BlockOp[0].Tail += Len; + + ASSERT (Nbuf->BlockOp[0].Tail <= Nbuf->BlockOp[0].BlockTail); +} + + +/** + Allocate Len bytes of space from the header or tail of the buffer. + + @param[in, out] Nbuf Pointer to the net buffer. + @param[in] Len The length of the buffer to be allocated. + @param[in] FromHead The flag to indicate whether reserve the data + from head (TRUE) or tail (FALSE). + + @return Pointer to the first byte of the allocated buffer, + or NULL if there is no sufficient space. + +**/ +UINT8* +EFIAPI +NetbufAllocSpace ( + IN OUT NET_BUF *Nbuf, + IN UINT32 Len, + IN BOOLEAN FromHead + ) +{ + NET_BLOCK_OP *BlockOp; + UINT32 Index; + UINT8 *SavedTail; + + Index = 0; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); + + ASSERT (Len > 0); + + if (FromHead) { + // + // Allocate some space from head. If the buffer is empty, + // allocate from the first block. If it isn't, allocate + // from the first non-empty block, or the block before that. + // + if (Nbuf->TotalSize == 0) { + Index = 0; + } else { + NetbufGetByte (Nbuf, 0, &Index); + + if ((NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len) && (Index > 0)) { + Index--; + } + } + + BlockOp = &(Nbuf->BlockOp[Index]); + + if (NET_HEADSPACE (BlockOp) < Len) { + return NULL; + } + + BlockOp->Head -= Len; + BlockOp->Size += Len; + Nbuf->TotalSize += Len; + + return BlockOp->Head; + + } else { + // + // Allocate some space from the tail. If the buffer is empty, + // allocate from the first block. If it isn't, allocate + // from the last non-empty block, or the block after that. + // + if (Nbuf->TotalSize == 0) { + Index = 0; + } else { + NetbufGetByte (Nbuf, Nbuf->TotalSize - 1, &Index); + + if ((NET_TAILSPACE(&(Nbuf->BlockOp[Index])) < Len) && + (Index < Nbuf->BlockOpNum - 1)) { + + Index++; + } + } + + BlockOp = &(Nbuf->BlockOp[Index]); + + if (NET_TAILSPACE (BlockOp) < Len) { + return NULL; + } + + SavedTail = BlockOp->Tail; + + BlockOp->Tail += Len; + BlockOp->Size += Len; + Nbuf->TotalSize += Len; + + return SavedTail; + } +} + + +/** + Trim a single NET_BLOCK by Len bytes from the header or tail. + + @param[in, out] BlockOp Pointer to the NET_BLOCK. + @param[in] Len The length of the data to be trimmed. + @param[in] FromHead The flag to indicate whether trim data from head + (TRUE) or tail (FALSE). + +**/ +VOID +NetblockTrim ( + IN OUT NET_BLOCK_OP *BlockOp, + IN UINT32 Len, + IN BOOLEAN FromHead + ) +{ + ASSERT ((BlockOp != NULL) && (BlockOp->Size >= Len)); + + BlockOp->Size -= Len; + + if (FromHead) { + BlockOp->Head += Len; + } else { + BlockOp->Tail -= Len; + } +} + + +/** + Trim Len bytes from the header or tail of the net buffer. + + @param[in, out] Nbuf Pointer to the net buffer. + @param[in] Len The length of the data to be trimmed. + @param[in] FromHead The flag to indicate whether trim data from head + (TRUE) or tail (FALSE). + + @return Length of the actually trimmed data, which is possible to be less + than Len because the TotalSize of Nbuf is less than Len. + +**/ +UINT32 +EFIAPI +NetbufTrim ( + IN OUT NET_BUF *Nbuf, + IN UINT32 Len, + IN BOOLEAN FromHead + ) +{ + NET_BLOCK_OP *BlockOp; + UINT32 Index; + UINT32 Trimmed; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + if (Len == 0 || Nbuf->TotalSize == 0) { + return 0; + } + + if (Len > Nbuf->TotalSize) { + Len = Nbuf->TotalSize; + } + + // + // If FromTail is true, iterate backward. That + // is, init Index to NBuf->BlockNum - 1, and + // decrease it by 1 during each loop. Otherwise, + // iterate forward. That is, init Index to 0, and + // increase it by 1 during each loop. + // + Trimmed = 0; + Nbuf->TotalSize -= Len; + + Index = (FromHead ? 0 : Nbuf->BlockOpNum - 1); + BlockOp = Nbuf->BlockOp; + + for (;;) { + if (BlockOp[Index].Size == 0) { + Index += (FromHead ? 1 : -1); + continue; + } + + if (Len > BlockOp[Index].Size) { + Len -= BlockOp[Index].Size; + Trimmed += BlockOp[Index].Size; + NetblockTrim (&BlockOp[Index], BlockOp[Index].Size, FromHead); + } else { + Trimmed += Len; + NetblockTrim (&BlockOp[Index], Len, FromHead); + break; + } + + Index += (FromHead ? 1 : -1); + } + + return Trimmed; +} + + +/** + Copy Len bytes of data from the specific offset of the net buffer to the + destination memory. + + The Len bytes of data may cross the several fragments of the net buffer. + + @param[in] Nbuf Pointer to the net buffer. + @param[in] Offset The sequence number of the first byte to copy. + @param[in] Len Length of the data to copy. + @param[in] Dest The destination of the data to copy to. + + @return The length of the actual copied data, or 0 if the offset + specified exceeds the total size of net buffer. + +**/ +UINT32 +EFIAPI +NetbufCopy ( + IN NET_BUF *Nbuf, + IN UINT32 Offset, + IN UINT32 Len, + IN UINT8 *Dest + ) +{ + NET_BLOCK_OP *BlockOp; + UINT32 Skip; + UINT32 Left; + UINT32 Copied; + UINT32 Index; + UINT32 Cur; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + ASSERT (Dest); + + if ((Len == 0) || (Nbuf->TotalSize <= Offset)) { + return 0; + } + + if (Nbuf->TotalSize - Offset < Len) { + Len = Nbuf->TotalSize - Offset; + } + + BlockOp = Nbuf->BlockOp; + + // + // Skip to the offset. Don't make "Offset-By-One" error here. + // Cur + BLOCK.SIZE is the first sequence number of next block. + // So, (Offset < Cur + BLOCK.SIZE) means that the first byte + // is in the current block. if (Offset == Cur + BLOCK.SIZE), the + // first byte is the next block's first byte. + // + Cur = 0; + + for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { + if (BlockOp[Index].Size == 0) { + continue; + } + + if (Offset < Cur + BlockOp[Index].Size) { + break; + } + + Cur += BlockOp[Index].Size; + } + + // + // Cur is the sequence number of the first byte in the block + // Offset - Cur is the number of bytes before first byte to + // to copy in the current block. + // + Skip = Offset - Cur; + Left = BlockOp[Index].Size - Skip; + + if (Len <= Left) { + CopyMem (Dest, BlockOp[Index].Head + Skip, Len); + return Len; + } + + CopyMem (Dest, BlockOp[Index].Head + Skip, Left); + + Dest += Left; + Len -= Left; + Copied = Left; + + Index++; + + for (; Index < Nbuf->BlockOpNum; Index++) { + if (Len > BlockOp[Index].Size) { + Len -= BlockOp[Index].Size; + Copied += BlockOp[Index].Size; + + CopyMem (Dest, BlockOp[Index].Head, BlockOp[Index].Size); + Dest += BlockOp[Index].Size; + } else { + Copied += Len; + CopyMem (Dest, BlockOp[Index].Head, Len); + break; + } + } + + return Copied; +} + + +/** + Initiate the net buffer queue. + + @param[in, out] NbufQue Pointer to the net buffer queue to be initialized. + +**/ +VOID +EFIAPI +NetbufQueInit ( + IN OUT NET_BUF_QUEUE *NbufQue + ) +{ + NbufQue->Signature = NET_QUE_SIGNATURE; + NbufQue->RefCnt = 1; + InitializeListHead (&NbufQue->List); + + InitializeListHead (&NbufQue->BufList); + NbufQue->BufSize = 0; + NbufQue->BufNum = 0; +} + + +/** + Allocate and initialize a net buffer queue. + + @return Pointer to the allocated net buffer queue, or NULL if the + allocation failed due to resource limit. + +**/ +NET_BUF_QUEUE * +EFIAPI +NetbufQueAlloc ( + VOID + ) +{ + NET_BUF_QUEUE *NbufQue; + + NbufQue = AllocatePool (sizeof (NET_BUF_QUEUE)); + if (NbufQue == NULL) { + return NULL; + } + + NetbufQueInit (NbufQue); + + return NbufQue; +} + + +/** + Free a net buffer queue. + + Decrease the reference count of the net buffer queue by one. The real resource + free operation isn't performed until the reference count of the net buffer + queue is decreased to 0. + + @param[in] NbufQue Pointer to the net buffer queue to be freed. + +**/ +VOID +EFIAPI +NetbufQueFree ( + IN NET_BUF_QUEUE *NbufQue + ) +{ + ASSERT (NbufQue != NULL); + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + + NbufQue->RefCnt--; + + if (NbufQue->RefCnt == 0) { + NetbufQueFlush (NbufQue); + FreePool (NbufQue); + } +} + + +/** + Append a net buffer to the net buffer queue. + + @param[in, out] NbufQue Pointer to the net buffer queue. + @param[in, out] Nbuf Pointer to the net buffer to be appended. + +**/ +VOID +EFIAPI +NetbufQueAppend ( + IN OUT NET_BUF_QUEUE *NbufQue, + IN OUT NET_BUF *Nbuf + ) +{ + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + InsertTailList (&NbufQue->BufList, &Nbuf->List); + + NbufQue->BufSize += Nbuf->TotalSize; + NbufQue->BufNum++; +} + + +/** + Remove a net buffer from the head in the specific queue and return it. + + @param[in, out] NbufQue Pointer to the net buffer queue. + + @return Pointer to the net buffer removed from the specific queue, + or NULL if there is no net buffer in the specific queue. + +**/ +NET_BUF * +EFIAPI +NetbufQueRemove ( + IN OUT NET_BUF_QUEUE *NbufQue + ) +{ + NET_BUF *First; + + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + + if (NbufQue->BufNum == 0) { + return NULL; + } + + First = NET_LIST_USER_STRUCT (NbufQue->BufList.ForwardLink, NET_BUF, List); + + NetListRemoveHead (&NbufQue->BufList); + + NbufQue->BufSize -= First->TotalSize; + NbufQue->BufNum--; + return First; +} + + +/** + Copy Len bytes of data from the net buffer queue at the specific offset to the + destination memory. + + The copying operation is the same as NetbufCopy but applies to the net buffer + queue instead of the net buffer. + + @param[in] NbufQue Pointer to the net buffer queue. + @param[in] Offset The sequence number of the first byte to copy. + @param[in] Len Length of the data to copy. + @param[out] Dest The destination of the data to copy to. + + @return The length of the actual copied data, or 0 if the offset + specified exceeds the total size of net buffer queue. + +**/ +UINT32 +EFIAPI +NetbufQueCopy ( + IN NET_BUF_QUEUE *NbufQue, + IN UINT32 Offset, + IN UINT32 Len, + OUT UINT8 *Dest + ) +{ + LIST_ENTRY *Entry; + NET_BUF *Nbuf; + UINT32 Skip; + UINT32 Left; + UINT32 Cur; + UINT32 Copied; + + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + ASSERT (Dest != NULL); + + if ((Len == 0) || (NbufQue->BufSize <= Offset)) { + return 0; + } + + if (NbufQue->BufSize - Offset < Len) { + Len = NbufQue->BufSize - Offset; + } + + // + // skip to the Offset + // + Cur = 0; + Nbuf = NULL; + + NET_LIST_FOR_EACH (Entry, &NbufQue->BufList) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + + if (Offset < Cur + Nbuf->TotalSize) { + break; + } + + Cur += Nbuf->TotalSize; + } + + ASSERT (Nbuf != NULL); + + // + // Copy the data in the first buffer. + // + Skip = Offset - Cur; + Left = Nbuf->TotalSize - Skip; + + if (Len < Left) { + return NetbufCopy (Nbuf, Skip, Len, Dest); + } + + NetbufCopy (Nbuf, Skip, Left, Dest); + Dest += Left; + Len -= Left; + Copied = Left; + + // + // Iterate over the others + // + Entry = Entry->ForwardLink; + + while ((Len > 0) && (Entry != &NbufQue->BufList)) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + + if (Len > Nbuf->TotalSize) { + Len -= Nbuf->TotalSize; + Copied += Nbuf->TotalSize; + + NetbufCopy (Nbuf, 0, Nbuf->TotalSize, Dest); + Dest += Nbuf->TotalSize; + + } else { + NetbufCopy (Nbuf, 0, Len, Dest); + Copied += Len; + break; + } + + Entry = Entry->ForwardLink; + } + + return Copied; +} + + +/** + Trim Len bytes of data from the buffer queue and free any net buffer + that is completely trimmed. + + The trimming operation is the same as NetbufTrim but applies to the net buffer + queue instead of the net buffer. + + @param[in, out] NbufQue Pointer to the net buffer queue. + @param[in] Len Length of the data to trim. + + @return The actual length of the data trimmed. + +**/ +UINT32 +EFIAPI +NetbufQueTrim ( + IN OUT NET_BUF_QUEUE *NbufQue, + IN UINT32 Len + ) +{ + LIST_ENTRY *Entry; + LIST_ENTRY *Next; + NET_BUF *Nbuf; + UINT32 Trimmed; + + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + + if (Len == 0) { + return 0; + } + + if (Len > NbufQue->BufSize) { + Len = NbufQue->BufSize; + } + + NbufQue->BufSize -= Len; + Trimmed = 0; + + NET_LIST_FOR_EACH_SAFE (Entry, Next, &NbufQue->BufList) { + Nbuf = NET_LIST_USER_STRUCT (Entry, NET_BUF, List); + + if (Len >= Nbuf->TotalSize) { + Trimmed += Nbuf->TotalSize; + Len -= Nbuf->TotalSize; + + RemoveEntryList (Entry); + NetbufFree (Nbuf); + + NbufQue->BufNum--; + + if (Len == 0) { + break; + } + + } else { + Trimmed += NetbufTrim (Nbuf, Len, NET_BUF_HEAD); + break; + } + } + + return Trimmed; +} + + +/** + Flush the net buffer queue. + + @param[in, out] NbufQue Pointer to the queue to be flushed. + +**/ +VOID +EFIAPI +NetbufQueFlush ( + IN OUT NET_BUF_QUEUE *NbufQue + ) +{ + NET_CHECK_SIGNATURE (NbufQue, NET_QUE_SIGNATURE); + + NetbufFreeList (&NbufQue->BufList); + + NbufQue->BufNum = 0; + NbufQue->BufSize = 0; +} + + +/** + Compute the checksum for a bulk of data. + + @param[in] Bulk Pointer to the data. + @param[in] Len Length of the data, in bytes. + + @return The computed checksum. + +**/ +UINT16 +EFIAPI +NetblockChecksum ( + IN UINT8 *Bulk, + IN UINT32 Len + ) +{ + register UINT32 Sum; + + Sum = 0; + + // + // Add left-over byte, if any + // + if (Len % 2 != 0) { + Sum += *(Bulk + Len - 1); + } + + while (Len > 1) { + Sum += *(UINT16 *) Bulk; + Bulk += 2; + Len -= 2; + } + + // + // Fold 32-bit sum to 16 bits + // + while ((Sum >> 16) != 0) { + Sum = (Sum & 0xffff) + (Sum >> 16); + + } + + return (UINT16) Sum; +} + + +/** + Add two checksums. + + @param[in] Checksum1 The first checksum to be added. + @param[in] Checksum2 The second checksum to be added. + + @return The new checksum. + +**/ +UINT16 +EFIAPI +NetAddChecksum ( + IN UINT16 Checksum1, + IN UINT16 Checksum2 + ) +{ + UINT32 Sum; + + Sum = Checksum1 + Checksum2; + + // + // two UINT16 can only add up to a carry of 1. + // + if ((Sum >> 16) != 0) { + Sum = (Sum & 0xffff) + 1; + + } + + return (UINT16) Sum; +} + + +/** + Compute the checksum for a NET_BUF. + + @param[in] Nbuf Pointer to the net buffer. + + @return The computed checksum. + +**/ +UINT16 +EFIAPI +NetbufChecksum ( + IN NET_BUF *Nbuf + ) +{ + NET_BLOCK_OP *BlockOp; + UINT32 Offset; + UINT16 TotalSum; + UINT16 BlockSum; + UINT32 Index; + + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + + TotalSum = 0; + Offset = 0; + BlockOp = Nbuf->BlockOp; + + for (Index = 0; Index < Nbuf->BlockOpNum; Index++) { + if (BlockOp[Index].Size == 0) { + continue; + } + + BlockSum = NetblockChecksum (BlockOp[Index].Head, BlockOp[Index].Size); + + if ((Offset & 0x01) != 0) { + // + // The checksum starts with an odd byte, swap + // the checksum before added to total checksum + // + BlockSum = SwapBytes16 (BlockSum); + } + + TotalSum = NetAddChecksum (BlockSum, TotalSum); + Offset += BlockOp[Index].Size; + } + + return TotalSum; +} + + +/** + Compute the checksum for TCP/UDP pseudo header. + + Src and Dst are in network byte order, and Len is in host byte order. + + @param[in] Src The source address of the packet. + @param[in] Dst The destination address of the packet. + @param[in] Proto The protocol type of the packet. + @param[in] Len The length of the packet. + + @return The computed checksum. + +**/ +UINT16 +EFIAPI +NetPseudoHeadChecksum ( + IN IP4_ADDR Src, + IN IP4_ADDR Dst, + IN UINT8 Proto, + IN UINT16 Len + ) +{ + NET_PSEUDO_HDR Hdr; + + // + // Zero the memory to relieve align problems + // + ZeroMem (&Hdr, sizeof (Hdr)); + + Hdr.SrcIp = Src; + Hdr.DstIp = Dst; + Hdr.Protocol = Proto; + Hdr.Len = HTONS (Len); + + return NetblockChecksum ((UINT8 *) &Hdr, sizeof (Hdr)); +} + +/** + Compute the checksum for TCP6/UDP6 pseudo header. + + Src and Dst are in network byte order, and Len is in host byte order. + + @param[in] Src The source address of the packet. + @param[in] Dst The destination address of the packet. + @param[in] NextHeader The protocol type of the packet. + @param[in] Len The length of the packet. + + @return The computed checksum. + +**/ +UINT16 +EFIAPI +NetIp6PseudoHeadChecksum ( + IN EFI_IPv6_ADDRESS *Src, + IN EFI_IPv6_ADDRESS *Dst, + IN UINT8 NextHeader, + IN UINT32 Len + ) +{ + NET_IP6_PSEUDO_HDR Hdr; + + // + // Zero the memory to relieve align problems + // + ZeroMem (&Hdr, sizeof (Hdr)); + + IP6_COPY_ADDRESS (&Hdr.SrcIp, Src); + IP6_COPY_ADDRESS (&Hdr.DstIp, Dst); + + Hdr.NextHeader = NextHeader; + Hdr.Len = HTONL (Len); + + return NetblockChecksum ((UINT8 *) &Hdr, sizeof (Hdr)); +} + +/** + The function frees the net buffer which allocated by the IP protocol. It releases + only the net buffer and doesn't call the external free function. + + This function should be called after finishing the process of mIpSec->ProcessExt() + for outbound traffic. The (EFI_IPSEC2_PROTOCOL)->ProcessExt() allocates a new + buffer for the ESP, so there needs a function to free the old net buffer. + + @param[in] Nbuf The network buffer to be freed. + +**/ +VOID +NetIpSecNetbufFree ( + NET_BUF *Nbuf + ) +{ + NET_CHECK_SIGNATURE (Nbuf, NET_BUF_SIGNATURE); + ASSERT (Nbuf->RefCnt > 0); + + Nbuf->RefCnt--; + + if (Nbuf->RefCnt == 0) { + + // + // Update Vector only when NBuf is to be released. That is, + // all the sharing of Nbuf increse Vector's RefCnt by one + // + NET_CHECK_SIGNATURE (Nbuf->Vector, NET_VECTOR_SIGNATURE); + ASSERT (Nbuf->Vector->RefCnt > 0); + + Nbuf->Vector->RefCnt--; + + if (Nbuf->Vector->RefCnt > 0) { + return; + } + + // + // If NET_VECTOR_OWN_FIRST is set, release the first block since it is + // allocated by us + // + if ((Nbuf->Vector->Flag & NET_VECTOR_OWN_FIRST) != 0) { + FreePool (Nbuf->Vector->Block[0].Bulk); + } + FreePool (Nbuf->Vector); + FreePool (Nbuf); + } +} + diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 19935c88f..f89ae0752 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -713,6 +713,15 @@ # @Prompt Disable default keyboard layout in USB KeyBoard Driver. gEfiMdeModulePkgTokenSpaceGuid.PcdDisableDefaultKeyboardLayoutInUsbKbDriver|FALSE|BOOLEAN|0x00010200 + ## Indicates if backward compatibility to Framework HII and Framework FvHob is supported.

+ # TRUE - Setup Browser supports GUID opcodes generated from Framework HII VFR file by VFR compiler. + # the PeiCore will handle the framework FvHob and install FvInfo PPI for it.
+ # FALSE - Setup Browser doesn't support GUID opcodes generated from Framework HII VFR file by VFR compiler. + # the PeiCore will not handle the framework FvHob and install FvInfo PPI for it.
+ # @Prompt Enable framework backward compatibility support. + gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport|FALSE|BOOLEAN|0x00012009 + + ## Indicates if HelloWorld Application will print the verbose information. # This PCD is a sample to explain FeatureFlag PCD usage.

# TRUE - HelloWorld Application will print the verbose information.
diff --git a/MdePkg/Library/BaseLib/X64/CpuId.S b/MdePkg/Library/BaseLib/X64/CpuId.S new file mode 100644 index 000000000..c3d259720 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/CpuId.S @@ -0,0 +1,60 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuId.S +# +# Abstract: +# +# AsmCpuid function +# +# Notes: +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmCpuid ( +# IN UINT32 RegisterInEax, +# OUT UINT32 *RegisterOutEax OPTIONAL, +# OUT UINT32 *RegisterOutEbx OPTIONAL, +# OUT UINT32 *RegisterOutEcx OPTIONAL, +# OUT UINT32 *RegisterOutEdx OPTIONAL +# ) +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(AsmCpuid) +ASM_PFX(AsmCpuid): + push %rbx + mov %ecx, %eax + push %rax # save Index on stack + push %rdx + cpuid + test %r9, %r9 + jz L1 + mov %ecx, (%r9) +L1: + pop %rcx + jrcxz L2 + mov %eax, (%rcx) +L2: + mov %r8, %rcx + jrcxz L3 + mov %ebx, (%rcx) +L3: + mov 0x38(%rsp), %rcx + jrcxz L4 + mov %edx, (%rcx) +L4: + pop %rax # restore Index to rax as return value + pop %rbx + ret diff --git a/MdePkg/Library/BaseLib/X64/CpuIdEx.S b/MdePkg/Library/BaseLib/X64/CpuIdEx.S new file mode 100644 index 000000000..d47f53c84 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/CpuIdEx.S @@ -0,0 +1,62 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# CpuIdEx.S +# +# Abstract: +# +# AsmCpuidEx function +# +# Notes: +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# UINT32 +# EFIAPI +# AsmCpuidEx ( +# IN UINT32 RegisterInEax, +# IN UINT32 RegisterInEcx, +# OUT UINT32 *RegisterOutEax OPTIONAL, +# OUT UINT32 *RegisterOutEbx OPTIONAL, +# OUT UINT32 *RegisterOutEcx OPTIONAL, +# OUT UINT32 *RegisterOutEdx OPTIONAL +# ) +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(AsmCpuidEx) +ASM_PFX(AsmCpuidEx): + push %rbx + movl %ecx,%eax + movl %edx,%ecx + push %rax # save Index on stack + cpuid + mov 0x38(%rsp), %r10 + test %r10, %r10 + jz L1 + mov %ecx,(%r10) +L1: + mov %r8, %rcx + jrcxz L2 + movl %eax,(%rcx) +L2: + mov %r9, %rcx + jrcxz L3 + mov %ebx, (%rcx) +L3: + mov 0x40(%rsp), %rcx + jrcxz L4 + mov %edx, (%rcx) +L4: + pop %rax # restore Index to rax as return value + pop %rbx + ret diff --git a/MdePkg/Library/BaseLib/X64/DisableCache.S b/MdePkg/Library/BaseLib/X64/DisableCache.S new file mode 100644 index 000000000..970f2f361 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/DisableCache.S @@ -0,0 +1,39 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DisableCache.S +# +# Abstract: +# +# Set the CD bit of CR0 to 1, clear the NW bit of CR0 to 0, and flush all caches with a +# WBINVD instruction. +# +# Notes: +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmDisableCache ( +# VOID +# ); +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(AsmDisableCache) +ASM_PFX(AsmDisableCache): + movq %cr0, %rax + btsq $30, %rax + btrq $29, %rax + movq %rax, %cr0 + wbinvd + ret diff --git a/MdePkg/Library/BaseLib/X64/DisablePaging64.S b/MdePkg/Library/BaseLib/X64/DisablePaging64.S new file mode 100644 index 000000000..676e9e175 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/DisablePaging64.S @@ -0,0 +1,82 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# DisablePaging64.S +# +# Abstract: +# +# AsmDisablePaging64 function +# +# Notes: +# +#------------------------------------------------------------------------------ + + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# InternalX86DisablePaging64 ( +# IN UINT16 Cs, +# IN UINT32 EntryPoint, +# IN UINT32 Context1, OPTIONAL +# IN UINT32 Context2, OPTIONAL +# IN UINT32 NewStack +# ); +#------------------------------------------------------------------------------ + +ASM_GLOBAL ASM_PFX(InternalX86DisablePaging64) +ASM_PFX(InternalX86DisablePaging64): + cli + lea L1(%rip), %rsi # rsi <- The start address of transition code + mov 0x28(%rsp), %edi # rdi <- New stack + lea _mTransitionEnd(%rip), %rax # rax <- end of transition code + sub %rsi, %rax # rax <- The size of transition piece code + add $4, %rax # round rax up to the next 4 byte boundary + and $0xfc, %al + sub %rax, %rdi # rdi <- use stack to hold transition code + mov %edi, %r10d # r10 <- The start address of transicition code below 4G + push %rcx # save rcx to stack + mov %rax, %rcx # rcx <- The size of transition piece code + rep + movsb # copy transition code to (new stack - 64byte) below 4G + pop %rcx # restore rcx + + mov %r8d, %esi + mov %r9d, %edi + mov %r10d, %eax + sub $4, %eax + push %rcx # push Cs to stack + push %r10 # push address of transition code on stack + .byte 0x48, 0xcb # retq: Use far return to load CS register from stack + # (Use raw byte code since some GNU assemblers generates incorrect code for "retq") +L1: + mov %eax,%esp # set up new stack + mov %cr0,%rax + btr $0x1f,%eax # clear CR0.PG + mov %rax,%cr0 # disable paging + + mov %edx,%ebx # save EntryPoint to ebx, for rdmsr will overwrite edx + mov $0xc0000080,%ecx + rdmsr + and $0xfe,%ah # clear LME + wrmsr + mov %cr4,%rax + and $0xdf,%al # clear PAE + mov %rax,%cr4 + push %rdi # push Context2 + push %rsi # push Context1 + callq *%rbx # transfer control to EntryPoint + jmp . # no one should get here + +_mTransitionEnd : diff --git a/MdePkg/Library/BaseLib/X64/EnableCache.S b/MdePkg/Library/BaseLib/X64/EnableCache.S new file mode 100644 index 000000000..9d739603c --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/EnableCache.S @@ -0,0 +1,39 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnableCache.S +# +# Abstract: +# +# Flush all caches with a WBINVD instruction, clear the CD bit of CR0 to 0, and clear +# the NW bit of CR0 to 0 +# +# Notes: +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# AsmEnableCache ( +# VOID +# ); +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(AsmEnableCache) +ASM_PFX(AsmEnableCache): + wbinvd + movq %cr0, %rax + btrq $30, %rax + btrq $29, %rax + movq %rax, %cr0 + ret diff --git a/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S b/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S new file mode 100644 index 000000000..f2ff61ecf --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/EnableDisableInterrupts.S @@ -0,0 +1,36 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# EnableDisableInterrupts.S +# +# Abstract: +# +# EnableDisableInterrupts function +# +# Notes: +# +#------------------------------------------------------------------------------ + + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# EnableDisableInterrupts ( +# VOID +# ); +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(EnableDisableInterrupts) +ASM_PFX(EnableDisableInterrupts): + sti + cli + ret diff --git a/MdePkg/Library/BaseLib/X64/LongJump.S b/MdePkg/Library/BaseLib/X64/LongJump.S new file mode 100644 index 000000000..f20446fcf --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/LongJump.S @@ -0,0 +1,54 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# LongJump.S +# +# Abstract: +# +# Implementation of _LongJump() on x64. +# +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# VOID +# EFIAPI +# InternalLongJump ( +# IN BASE_LIBRARY_JUMP_BUFFER *JumpBuffer, +# IN UINTN Value +# ); +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(InternalLongJump) +ASM_PFX(InternalLongJump): + mov (%rcx), %rbx + mov 0x8(%rcx), %rsp + mov 0x10(%rcx), %rbp + mov 0x18(%rcx), %rdi + mov 0x20(%rcx), %rsi + mov 0x28(%rcx), %r12 + mov 0x30(%rcx), %r13 + mov 0x38(%rcx), %r14 + mov 0x40(%rcx), %r15 + # load non-volatile fp registers + ldmxcsr 0x50(%rcx) + movdqu 0x58(%rcx), %xmm6 + movdqu 0x68(%rcx), %xmm7 + movdqu 0x78(%rcx), %xmm8 + movdqu 0x88(%rcx), %xmm9 + movdqu 0x98(%rcx), %xmm10 + movdqu 0xA8(%rcx), %xmm11 + movdqu 0xB8(%rcx), %xmm12 + movdqu 0xC8(%rcx), %xmm13 + movdqu 0xD8(%rcx), %xmm14 + movdqu 0xE8(%rcx), %xmm15 + mov %rdx, %rax # set return value + jmp *0x48(%rcx) diff --git a/MdePkg/Library/BaseLib/X64/RdRand.S b/MdePkg/Library/BaseLib/X64/RdRand.S new file mode 100644 index 000000000..55724c086 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/RdRand.S @@ -0,0 +1,72 @@ +#------------------------------------------------------------------------------ ; +# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# RdRand.S +# +# Abstract: +# +# Generates random number through CPU RdRand instruction under 64-bit platform. +# +# Notes: +# +#------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ +// Generates a 16 bit random number through RDRAND instruction. +// Return TRUE if Rand generated successfully, or FALSE if not. +// +// BOOLEAN EFIAPI InternalX86RdRand16 (UINT16 *Rand); +//------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(InternalX86RdRand16) +ASM_PFX(InternalX86RdRand16): + .byte 0x0f, 0xc7, 0xf0 // rdrand r16: "0f c7 /6 ModRM:r/m(w)" + jc rn16_ok // jmp if CF=1 + xor %rax, %rax // reg=0 if CF=0 + ret // return with failure status +rn16_ok: + mov %ax, (%rcx) + mov $0x1, %rax + ret + +//------------------------------------------------------------------------------ +// Generates a 32 bit random number through RDRAND instruction. +// Return TRUE if Rand generated successfully, or FALSE if not. +// +// BOOLEAN EFIAPI InternalX86RdRand32 (UINT32 *Rand); +//------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(InternalX86RdRand32) +ASM_PFX(InternalX86RdRand32): + .byte 0x0f, 0xc7, 0xf0 // rdrand r32: "0f c7 /6 ModRM:r/m(w)" + jc rn32_ok // jmp if CF=1 + xor %rax, %rax // reg=0 if CF=0 + ret // return with failure status +rn32_ok: + mov %eax, (%rcx) + mov $0x1, %rax + ret + +//------------------------------------------------------------------------------ +// Generates a 64 bit random number through RDRAND instruction. +// Return TRUE if Rand generated successfully, or FALSE if not. +// +// BOOLEAN EFIAPI InternalX86RdRand64 (UINT64 *Rand); +//------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(InternalX86RdRand64) +ASM_PFX(InternalX86RdRand64): + .byte 0x48, 0x0f, 0xc7, 0xf0 // rdrand r64: "REX.W + 0f c7 /6 ModRM:r/m(w)" + jc rn64_ok // jmp if CF=1 + xor %rax, %rax // reg=0 if CF=0 + ret // return with failure status +rn64_ok: + mov %rax, (%rcx) + mov $0x1, %rax + ret diff --git a/MdePkg/Library/BaseLib/X64/SetJump.S b/MdePkg/Library/BaseLib/X64/SetJump.S new file mode 100644 index 000000000..ea9e225a9 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/SetJump.S @@ -0,0 +1,53 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SetJump.S +# +# Abstract: +# +# Implementation of SetJump() on x86_64 +# +#------------------------------------------------------------------------------ + +ASM_GLOBAL ASM_PFX(SetJump) +ASM_PFX(SetJump): + push %rcx + add $0xffffffffffffffe0,%rsp + call ASM_PFX(InternalAssertJumpBuffer) + add $0x20,%rsp + pop %rcx + pop %rdx + mov %rbx,(%rcx) + mov %rsp,0x8(%rcx) + mov %rbp,0x10(%rcx) + mov %rdi,0x18(%rcx) + mov %rsi,0x20(%rcx) + mov %r12,0x28(%rcx) + mov %r13,0x30(%rcx) + mov %r14,0x38(%rcx) + mov %r15,0x40(%rcx) + mov %rdx,0x48(%rcx) + # save non-volatile fp registers + stmxcsr 0x50(%rcx) + movdqu %xmm6, 0x58(%rcx) + movdqu %xmm7, 0x68(%rcx) + movdqu %xmm8, 0x78(%rcx) + movdqu %xmm9, 0x88(%rcx) + movdqu %xmm10, 0x98(%rcx) + movdqu %xmm11, 0xA8(%rcx) + movdqu %xmm12, 0xB8(%rcx) + movdqu %xmm13, 0xC8(%rcx) + movdqu %xmm14, 0xD8(%rcx) + movdqu %xmm15, 0xE8(%rcx) + xor %rax,%rax + jmpq *%rdx diff --git a/MdePkg/Library/BaseLib/X64/SwitchStack.S b/MdePkg/Library/BaseLib/X64/SwitchStack.S new file mode 100644 index 000000000..dc8d80e40 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/SwitchStack.S @@ -0,0 +1,52 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# SwitchStack.S +# +# Abstract: +# +#------------------------------------------------------------------------------ + + +#------------------------------------------------------------------------------ +# Routine Description: +# +# Routine for switching stacks with 2 parameters +# +# Arguments: +# +# (rcx) EntryPoint - Entry point with new stack. +# (rdx) Context1 - Parameter1 for entry point. +# (r8) Context2 - Parameter2 for entry point. +# (r9) NewStack - The pointer to new stack. +# +# Returns: +# +# None +# +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(InternalSwitchStack) +ASM_PFX(InternalSwitchStack): + pushq %rbp + movq %rsp, %rbp + + mov %rcx, %rax // Shift registers for new call + mov %rdx, %rcx + mov %r8, %rdx + # + # Reserve space for register parameters (rcx, rdx, r8 & r9) on the stack, + # in case the callee wishes to spill them. + # + lea -0x20(%r9), %rsp + pushq $0 // stop gdb stack unwind + jmp *%rax // call EntryPoint () diff --git a/MdePkg/Library/BaseLib/X64/Thunk16.S b/MdePkg/Library/BaseLib/X64/Thunk16.S new file mode 100644 index 000000000..f592a2868 --- /dev/null +++ b/MdePkg/Library/BaseLib/X64/Thunk16.S @@ -0,0 +1,334 @@ +#------------------------------------------------------------------------------ +# +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.
+# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php. +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Thunk16.S +# +# Abstract: +# +# Real mode thunk +# +#------------------------------------------------------------------------------ + +#include + +ASM_GLOBAL ASM_PFX(m16Start) +ASM_GLOBAL ASM_PFX(m16Size) +ASM_GLOBAL ASM_PFX(mThunk16Attr) +ASM_GLOBAL ASM_PFX(m16Gdt) +ASM_GLOBAL ASM_PFX(m16GdtrBase) +ASM_GLOBAL ASM_PFX(mTransition) +ASM_GLOBAL ASM_PFX(InternalAsmThunk16) + +# define the structure of IA32_REGS +.set _EDI, 0 #size 4 +.set _ESI, 4 #size 4 +.set _EBP, 8 #size 4 +.set _ESP, 12 #size 4 +.set _EBX, 16 #size 4 +.set _EDX, 20 #size 4 +.set _ECX, 24 #size 4 +.set _EAX, 28 #size 4 +.set _DS, 32 #size 2 +.set _ES, 34 #size 2 +.set _FS, 36 #size 2 +.set _GS, 38 #size 2 +.set _EFLAGS, 40 #size 8 +.set _EIP, 48 #size 4 +.set _CS, 52 #size 2 +.set _SS, 54 #size 2 +.set IA32_REGS_SIZE, 56 + + .data + +.set Lm16Size, ASM_PFX(InternalAsmThunk16) - ASM_PFX(m16Start) +ASM_PFX(m16Size): .word Lm16Size +.set LmThunk16Attr, L_ThunkAttr - ASM_PFX(m16Start) +ASM_PFX(mThunk16Attr): .word LmThunk16Attr +.set Lm16Gdt, ASM_PFX(NullSeg) - ASM_PFX(m16Start) +ASM_PFX(m16Gdt): .word Lm16Gdt +.set Lm16GdtrBase, _16GdtrBase - ASM_PFX(m16Start) +ASM_PFX(m16GdtrBase): .word Lm16GdtrBase +.set LmTransition, _EntryPoint - ASM_PFX(m16Start) +ASM_PFX(mTransition): .word LmTransition + + .text + +ASM_PFX(m16Start): + +SavedGdt: .space 10 + +#------------------------------------------------------------------------------ +# _BackFromUserCode() takes control in real mode after 'retf' has been executed +# by user code. It will be shadowed to somewhere in memory below 1MB. +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(BackFromUserCode) +ASM_PFX(BackFromUserCode): + # + # The order of saved registers on the stack matches the order they appears + # in IA32_REGS structure. This facilitates wrapper function to extract them + # into that structure. + # + # Some instructions for manipulation of segment registers have to be written + # in opcode since 64-bit MASM prevents accesses to those registers. + # + .byte 0x16 # push ss + .byte 0xe # push cs + .byte 0x66 + call L_Base # push eip +L_Base: + .byte 0x66 + pushq $0 # reserved high order 32 bits of EFlags + .byte 0x66, 0x9c # pushfd actually + cli # disable interrupts + push %gs + push %fs + .byte 6 # push es + .byte 0x1e # push ds + .byte 0x66,0x60 # pushad + .byte 0x66,0xba # mov edx, imm32 +L_ThunkAttr: .space 4 + testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl + jz L_1 + movl $0x15cd2401,%eax # mov ax, 2401h & int 15h + cli # disable interrupts + jnc L_2 +L_1: + testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_KBD_CTRL, %dl + jz L_2 + inb $0x92,%al + orb $2,%al + outb %al, $0x92 # deactivate A20M# +L_2: + xorw %ax, %ax # xor eax, eax + movl %ss, %eax # mov ax, ss + lea IA32_REGS_SIZE(%esp), %bp + # + # rsi in the following 2 instructions is indeed bp in 16-bit code + # + movw %bp, (_ESP - IA32_REGS_SIZE)(%rsi) + .byte 0x66 + movl (_EIP - IA32_REGS_SIZE)(%rsi), %ebx + shlw $4,%ax # shl eax, 4 + addw %ax,%bp # add ebp, eax + movw %cs,%ax + shlw $4,%ax + lea (L_64BitCode - L_Base)(%ebx, %eax), %ax + .byte 0x66,0x2e,0x89,0x87 # mov cs:[bx + (L_64Eip - L_Base)], eax + .word L_64Eip - L_Base + .byte 0x66,0xb8 # mov eax, imm32 +L_SavedCr4: .space 4 + movq %rax, %cr4 + # + # rdi in the instruction below is indeed bx in 16-bit code + # + .byte 0x66,0x2e # 2eh is "cs:" segment override + lgdt (SavedGdt - L_Base)(%rdi) + .byte 0x66 + movl $0xc0000080,%ecx + rdmsr + orb $1,%ah + wrmsr + .byte 0x66,0xb8 # mov eax, imm32 +L_SavedCr0: .space 4 + movq %rax, %cr0 + .byte 0x66,0xea # jmp far cs:L_64Bit +L_64Eip: .space 4 +L_SavedCs: .space 2 +L_64BitCode: + .byte 0x90 + .byte 0x48,0xbc # mov rsp, imm64 +L_SavedSp: .space 8 # restore stack + nop + ret + +_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start) + .word CODE16 +_16Gdtr: .word GDT_SIZE - 1 +_16GdtrBase: .quad 0 +_16Idtr: .word 0x3ff + .long 0 + +#------------------------------------------------------------------------------ +# _ToUserCode() takes control in real mode before passing control to user code. +# It will be shadowed to somewhere in memory below 1MB. +#------------------------------------------------------------------------------ +ASM_GLOBAL ASM_PFX(ToUserCode) +ASM_PFX(ToUserCode): + movl %edx,%ss # set new segment selectors + movl %edx,%ds + movl %edx,%es + movl %edx,%fs + movl %edx,%gs + .byte 0x66 + movl $0xc0000080,%ecx + movq %rax, %cr0 + rdmsr + andb $0xfe, %ah # $0b11111110 + wrmsr + movq %rbp, %cr4 + movl %esi,%ss # set up 16-bit stack segment + movw %bx,%sp # set up 16-bit stack pointer + .byte 0x66 # make the following call 32-bit + call L_Base1 # push eip +L_Base1: + popw %bp # ebp <- address of L_Base1 + pushq (IA32_REGS_SIZE + 2)(%esp) + lea 0x0c(%rsi), %eax + pushq %rax + lret # execution begins at next instruction +L_RealMode: + .byte 0x66,0x2e # CS and operand size override + lidt (_16Idtr - L_Base1)(%rsi) + .byte 0x66,0x61 # popad + .byte 0x1f # pop ds + .byte 0x7 # pop es + .byte 0x0f, 0xa1 # pop fs + .byte 0x0f, 0xa9 # pop gs + .byte 0x66, 0x9d # popfd + leaw 4(%esp),%sp # skip high order 32 bits of EFlags + .byte 0x66 # make the following retf 32-bit + lret # transfer control to user code + +.set CODE16, ASM_PFX(_16Code) - . +.set DATA16, ASM_PFX(_16Data) - . +.set DATA32, ASM_PFX(_32Data) - . + +ASM_PFX(NullSeg): .quad 0 +ASM_PFX(_16Code): + .word -1 + .word 0 + .byte 0 + .byte 0x9b + .byte 0x8f # 16-bit segment, 4GB limit + .byte 0 +ASM_PFX(_16Data): + .word -1 + .word 0 + .byte 0 + .byte 0x93 + .byte 0x8f # 16-bit segment, 4GB limit + .byte 0 +ASM_PFX(_32Data): + .word -1 + .word 0 + .byte 0 + .byte 0x93 + .byte 0xcf # 16-bit segment, 4GB limit + .byte 0 + +.set GDT_SIZE, . - ASM_PFX(NullSeg) + +#------------------------------------------------------------------------------ +# IA32_REGISTER_SET * +# EFIAPI +# InternalAsmThunk16 ( +# IN IA32_REGISTER_SET *RegisterSet, +# IN OUT VOID *Transition +# ); +#------------------------------------------------------------------------------ + +ASM_GLOBAL ASM_PFX(InternalAsmThunk16) +ASM_PFX(InternalAsmThunk16): + pushq %rbp + pushq %rbx + pushq %rsi + pushq %rdi + + movl %ds, %ebx + pushq %rbx # Save ds segment register on the stack + movl %es, %ebx + pushq %rbx # Save es segment register on the stack + movl %ss, %ebx + pushq %rbx # Save ss segment register on the stack + + .byte 0x0f, 0xa0 #push fs + .byte 0x0f, 0xa8 #push gs + movq %rcx, %rsi + movzwl _SS(%rsi), %r8d + movl _ESP(%rsi), %edi + lea -(IA32_REGS_SIZE + 4)(%edi), %rdi + imul $16, %r8d, %eax + movl %edi,%ebx # ebx <- stack for 16-bit code + pushq $(IA32_REGS_SIZE / 4) + addl %eax,%edi # edi <- linear address of 16-bit stack + popq %rcx + rep + movsl # copy RegSet + lea (L_SavedCr4 - ASM_PFX(m16Start))(%rdx), %ecx + movl %edx,%eax # eax <- transition code address + andl $0xf,%edx + shll $12,%eax # segment address in high order 16 bits + .set LBackFromUserCodeDelta, ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start) + lea (LBackFromUserCodeDelta)(%rdx), %ax + stosl # [edi] <- return address of user code + sgdt 0x60(%rsp) # save GDT stack in argument space + movzwq 0x60(%rsp), %r10 # r10 <- GDT limit + lea ((ASM_PFX(InternalAsmThunk16) - L_SavedCr4) + 0xf)(%rcx), %r11 + andq $0xfffffffffffffff0, %r11 # r11 <- 16-byte aligned shadowed GDT table in real mode buffer + + movw %r10w, (SavedGdt - L_SavedCr4)(%rcx) # save the limit of shadowed GDT table + movq %r11, (SavedGdt - L_SavedCr4 + 0x2)(%rcx) # save the base address of shadowed GDT table + + movq 0x62(%rsp) ,%rsi # rsi <- the original GDT base address + xchg %r10, %rcx # save rcx to r10 and initialize rcx to be the limit of GDT table + incq %rcx # rcx <- the size of memory to copy + xchg %r11, %rdi # save rdi to r11 and initialize rdi to the base address of shadowed GDT table + rep + movsb # perform memory copy to shadow GDT table + movq %r10, %rcx # restore the orignal rcx before memory copy + movq %r11, %rdi # restore the original rdi before memory copy + + sidt 0x50(%rsp) + movq %cr0, %rax + .set LSavedCrDelta, L_SavedCr0 - L_SavedCr4 + movl %eax, (LSavedCrDelta)(%rcx) + andl $0x7ffffffe,%eax # clear PE, PG bits + movq %cr4, %rbp + movl %ebp, (%rcx) # save CR4 in SavedCr4 + andl $0xffffffcf,%ebp # clear PAE, PSE bits + movl %r8d, %esi # esi <- 16-bit stack segment + .byte 0x6a, DATA32 + popq %rdx + lgdt (_16Gdtr - L_SavedCr4)(%rcx) + movl %edx,%ss + pushfq + lea -8(%rdx), %edx + lea L_RetFromRealMode(%rip), %r8 + pushq %r8 + movl %cs, %r8d + movw %r8w, (L_SavedCs - L_SavedCr4)(%rcx) + movq %rsp, (L_SavedSp - L_SavedCr4)(%rcx) + .byte 0xff, 0x69 # jmp (_EntryPoint - L_SavedCr4)(%rcx) + .set Ltemp1, _EntryPoint - L_SavedCr4 + .byte Ltemp1 +L_RetFromRealMode: + popfq + lgdt 0x60(%rsp) # restore protected mode GDTR + lidt 0x50(%rsp) # restore protected mode IDTR + lea -IA32_REGS_SIZE(%rbp), %eax + .byte 0x0f, 0xa9 # pop gs + .byte 0x0f, 0xa1 # pop fs + + popq %rbx + movl %ebx, %ss + popq %rbx + movl %ebx, %es + popq %rbx + movl %ebx, %ds + + popq %rdi + popq %rsi + popq %rbx + popq %rbp + + ret diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 3fd7d1634..ead69adc7 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -324,6 +324,9 @@ ## Include/Guid/Mps.h gEfiMpsTableGuid = { 0xEB9D2D2F, 0x2D88, 0x11D3, { 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }} + ## Include/Guid/SalSystemTable.h + gEfiSalSystemTableGuid = { 0xEB9D2D32, 0x2D88, 0x11D3, { 0x9A, 0x16, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }} + ## Include/Protocol/AuthenticationInfo.h gEfiAuthenticationChapLocalGuid = { 0xC280C73E, 0x15CA, 0x11DA, { 0xB0, 0xCA, 0x00, 0x10, 0x83, 0xFF, 0xCA, 0x4D }} @@ -1133,6 +1136,29 @@ ## Include/Protocol/LegacyRegion2.h gEfiLegacyRegion2ProtocolGuid = {0x70101eaf, 0x85, 0x440c, {0xb3, 0x56, 0x8e, 0xe3, 0x6f, 0xef, 0x24, 0xf0 } } + ## Include/Protocol/McaInitPmi.h + gEfiSalMcaInitPmiProtocolGuid = { 0xb60dc6e8, 0x3b6f, 0x11d5, {0xaf, 0x9, 0x0, 0xa0, 0xc9, 0x44, 0xa0, 0x5b } } + + ## Include/Protocol/ExtendedSalBootService.h + gEfiExtendedSalBootServiceProtocolGuid = { 0xde0ee9a4, 0x3c7a, 0x44f2, {0xb7, 0x8b, 0xe3, 0xcc, 0xd6, 0x9c, 0x3a, 0xf7 } } + + ## Include/Protocol/ExtendedSalServiceClasses.h + gEfiExtendedSalBaseIoServicesProtocolGuid = { 0x5aea42b5, 0x31e1, 0x4515, {0xbc, 0x31, 0xb8, 0xd5, 0x25, 0x75, 0x65, 0xa6 } } + gEfiExtendedSalStallServicesProtocolGuid = { 0x53a58d06, 0xac27, 0x4d8c, {0xb5, 0xe9, 0xf0, 0x8a, 0x80, 0x65, 0x41, 0x70 } } + gEfiExtendedSalRtcServicesProtocolGuid = { 0x7e97a470, 0xefdb, 0x4d02, {0x8f, 0xce, 0x61, 0x90, 0xd2, 0x7b, 0xa2, 0x96 } } + gEfiExtendedSalVariableServicesProtocolGuid = { 0x4ecb6c53, 0xc641, 0x4370, {0x8c, 0xb2, 0x3b, 0x0e, 0x49, 0x6e, 0x83, 0x78 } } + gEfiExtendedSalMtcServicesProtocolGuid = { 0x899afd18, 0x75e8, 0x408b, {0xa4, 0x1a, 0x6e, 0x2e, 0x7e, 0xcd, 0xf4, 0x54 } } + gEfiExtendedSalResetServicesProtocolGuid = { 0x7d019990, 0x8ce1, 0x46f5, {0xa7, 0x76, 0x3c, 0x51, 0x98, 0x67, 0x6a, 0xa0 } } + gEfiExtendedSalStatusCodeServicesProtocolGuid = { 0xdbd91d, 0x55e9, 0x420f, {0x96, 0x39, 0x5e, 0x9f, 0x84, 0x37, 0xb4, 0x4f } } + gEfiExtendedSalFvBlockServicesProtocolGuid = { 0xa2271df1, 0xbcbb, 0x4f1d, {0x98, 0xa9, 0x06, 0xbc, 0x17, 0x2f, 0x07, 0x1a } } + gEfiExtendedSalMpServicesProtocolGuid = { 0x697d81a2, 0xcf18, 0x4dc0, {0x9e, 0x0d, 0x06, 0x11, 0x3b, 0x61, 0x8a, 0x3f } } + gEfiExtendedSalPalServicesProtocolGuid = { 0xe1cd9d21, 0x0fc2, 0x438d, {0x97, 0x03, 0x04, 0xe6, 0x6d, 0x96, 0x1e, 0x57 } } + gEfiExtendedSalBaseServicesProtocolGuid = { 0xd9e9fa06, 0x0fe0, 0x41c3, {0x96, 0xfb, 0x83, 0x42, 0x5a, 0x33, 0x94, 0xf8 } } + gEfiExtendedSalMcaServicesProtocolGuid = { 0x2a591128, 0x6cc7, 0x42b1, {0x8a, 0xf0, 0x58, 0x93, 0x3b, 0x68, 0x2d, 0xbb } } + gEfiExtendedSalPciServicesProtocolGuid = { 0xa46b1a31, 0xad66, 0x4905, {0x92, 0xf6, 0x2b, 0x46, 0x59, 0xdc, 0x30, 0x63 } } + gEfiExtendedSalCacheServicesProtocolGuid = { 0xedc9494, 0x2743, 0x4ba5, { 0x88, 0x18, 0x0a, 0xef, 0x52, 0x13, 0xf1, 0x88 } } + gEfiExtendedSalMcaLogServicesProtocolGuid = { 0xcb3fd86e, 0x38a3, 0x4c03, {0x9a, 0x5c, 0x90, 0xcf, 0xa3, 0xa2, 0xab, 0x7a } } + # # Protocols defined in PI 1.2.1 # diff --git a/OsxLowMemFixDrv/OsxLowMemFixDrv.inf b/OsxLowMemFixDrv/OsxLowMemFixDrv.inf index 7f2bae318..a911b42c4 100644 --- a/OsxLowMemFixDrv/OsxLowMemFixDrv.inf +++ b/OsxLowMemFixDrv/OsxLowMemFixDrv.inf @@ -20,7 +20,7 @@ ENTRY_POINT = OsxLowMemFixDrvEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec # DuetPkg/DuetPkg.dec diff --git a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf index 09bcbbb05..4187c5152 100644 --- a/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf +++ b/PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf @@ -26,6 +26,7 @@ 8259.h [Packages] + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec PcAtChipsetPkg/PcAtChipsetPkg.dec diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec b/PcAtChipsetPkg/PcAtChipsetPkg.dec index d99d91496..5778c85ca 100644 --- a/PcAtChipsetPkg/PcAtChipsetPkg.dec +++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec @@ -42,6 +42,64 @@ gPcAtChipsetPkgTokenSpaceGuid.PcdHpetMsiEnable|TRUE|BOOLEAN|0x00001000 [PcdsFixedAtBuild, PcdsDynamic, PcdsDynamicEx, PcdsPatchableInModule] + ## Pcd8259LegacyModeMask defines the default mask value for platform. This value is determined

+ # 1) If platform only support pure UEFI, value should be set to 0xFFFF or 0xFFFE; + # Because only clock interrupt is allowed in legacy mode in pure UEFI platform.
+ # 2) If platform install CSM and use thunk module:
+ # a) If thunk call provided by CSM binary requires some legacy interrupt support, the corresponding bit + # should be opened as 0.
+ # For example, if keyboard interfaces provided CSM binary use legacy keyboard interrupt in 8259 bit 1, then + # the value should be set to 0xFFFC.
+ # b) If all thunk call provied by CSM binary do not require legacy interrupt support, value should be set + # to 0xFFFF or 0xFFFE.
+ # + # The default value of legacy mode mask could be changed by EFI_LEGACY_8259_PROTOCOL->SetMask(). But it is rarely + # need change it except some special cases such as when initializing the CSM binary, it should be set to 0xFFFF to + # mask all legacy interrupt. Please restore the original legacy mask value if changing is made for these special case.
+ # @Prompt 8259 Legacy Mode mask. + gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeMask|0xFFFF|UINT16|0x00000001 + + ## Pcd8259LegacyModeEdgeLevel defines the default edge level for legacy mode's interrrupt controller. + # For the corresponding bits, 0 = Edge triggered and 1 = Level triggered. + # @Prompt 8259 Legacy Mode edge level. + gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0000|UINT16|0x00000002 + + ## Indicates if we need enable IsaAcpiCom1 device.

+ # TRUE - Enables IsaAcpiCom1 device.
+ # FALSE - Doesn't enable IsaAcpiCom1 device.
+ # @Prompt Enable IsaAcpiCom1 device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom1Enable|TRUE|BOOLEAN|0x00000003 + + ## Indicates if we need enable IsaAcpiCom2 device.

+ # TRUE - Enables IsaAcpiCom2 device.
+ # FALSE - Doesn't enable IsaAcpiCom2 device.
+ # @Prompt Enable IsaAcpiCom12 device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiCom2Enable|TRUE|BOOLEAN|0x00000004 + + ## Indicates if we need enable IsaAcpiPs2Keyboard device.

+ # TRUE - Enables IsaAcpiPs2Keyboard device.
+ # FALSE - Doesn't enable IsaAcpiPs2Keyboard device.
+ # @Prompt Enable IsaAcpiPs2Keyboard device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2KeyboardEnable|TRUE|BOOLEAN|0x00000005 + + ## Indicates if we need enable IsaAcpiPs2Mouse device.

+ # TRUE - Enables IsaAcpiPs2Mouse device.
+ # FALSE - Doesn't enable IsaAcpiPs2Mouse device.
+ # @Prompt Enable IsaAcpiPs2Mouse device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiPs2MouseEnable|TRUE|BOOLEAN|0x00000006 + + ## Indicates if we need enable IsaAcpiFloppyA device.

+ # TRUE - Enables IsaAcpiFloppyA device.
+ # FALSE - Doesn't enable IsaAcpiFloppyA device.
+ # @Prompt Enable IsaAcpiFloppyA device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyAEnable|TRUE|BOOLEAN|0x00000007 + + ## Indicates if we need enable IsaAcpiFloppyB device.

+ # TRUE - Enables IsaAcpiFloppyB device.
+ # FALSE - Doesn't enable IsaAcpiFloppyB device.
+ # @Prompt Enable IsaAcpiFloppyB device. + gPcAtChipsetPkgTokenSpaceGuid.PcdIsaAcpiFloppyBEnable|TRUE|BOOLEAN|0x00000008 + ## This PCD specifies the base address of the HPET timer. # @Prompt HPET base address. gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress|0xFED00000|UINT32|0x00000009 diff --git a/Protocols/AppleImageCodec/AppleImageCodec.inf b/Protocols/AppleImageCodec/AppleImageCodec.inf index 06966b146..09e1ee72c 100644 --- a/Protocols/AppleImageCodec/AppleImageCodec.inf +++ b/Protocols/AppleImageCodec/AppleImageCodec.inf @@ -19,7 +19,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] BaseLib diff --git a/Protocols/AppleKeyAggregator/AppleKeyAggregator.inf b/Protocols/AppleKeyAggregator/AppleKeyAggregator.inf index 00ef0516c..0be946a94 100644 --- a/Protocols/AppleKeyAggregator/AppleKeyAggregator.inf +++ b/Protocols/AppleKeyAggregator/AppleKeyAggregator.inf @@ -22,7 +22,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Protocols/AppleKeyFeeder/AppleKeyFeeder.inf b/Protocols/AppleKeyFeeder/AppleKeyFeeder.inf index 30deefea7..c82e5ab4c 100644 --- a/Protocols/AppleKeyFeeder/AppleKeyFeeder.inf +++ b/Protocols/AppleKeyFeeder/AppleKeyFeeder.inf @@ -24,7 +24,7 @@ ENTRY_POINT = AppleKeyFeederEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Protocols/AppleUITheme/AppleUITheme.inf b/Protocols/AppleUITheme/AppleUITheme.inf index 26514061c..ac4f662ec 100644 --- a/Protocols/AppleUITheme/AppleUITheme.inf +++ b/Protocols/AppleUITheme/AppleUITheme.inf @@ -22,7 +22,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Protocols/DriverOverride/DriverOverride.inf b/Protocols/DriverOverride/DriverOverride.inf index cbe8fe00b..447dafc97 100644 --- a/Protocols/DriverOverride/DriverOverride.inf +++ b/Protocols/DriverOverride/DriverOverride.inf @@ -24,7 +24,7 @@ ENTRY_POINT = DriverOverrideEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Protocols/DumpUefiCalls/DumpUefiCalls.inf b/Protocols/DumpUefiCalls/DumpUefiCalls.inf index 721b73f95..afcefce89 100644 --- a/Protocols/DumpUefiCalls/DumpUefiCalls.inf +++ b/Protocols/DumpUefiCalls/DumpUefiCalls.inf @@ -52,7 +52,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] UefiLib diff --git a/Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf b/Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf index 424c06cb8..cc97baa89 100644 --- a/Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf +++ b/Protocols/EmuVariableUefi/EmuVariableRuntimeDxe.inf @@ -40,7 +40,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] diff --git a/Protocols/FirmwareVolume/FirmwareVolume.inf b/Protocols/FirmwareVolume/FirmwareVolume.inf index a470b3ff9..88805e649 100644 --- a/Protocols/FirmwareVolume/FirmwareVolume.inf +++ b/Protocols/FirmwareVolume/FirmwareVolume.inf @@ -22,7 +22,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Protocols/HashServiceFix/HashServiceFix.inf b/Protocols/HashServiceFix/HashServiceFix.inf index c5ea3e55f..9131d0cc8 100644 --- a/Protocols/HashServiceFix/HashServiceFix.inf +++ b/Protocols/HashServiceFix/HashServiceFix.inf @@ -20,7 +20,7 @@ VERSION_STRING = 1.0 [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Protocols/MsgLog/MsgLog.c b/Protocols/MsgLog/MsgLog.c index fbc067ff0..598aaf2c3 100644 --- a/Protocols/MsgLog/MsgLog.c +++ b/Protocols/MsgLog/MsgLog.c @@ -42,7 +42,7 @@ extern MESSAGE_LOG_PROTOCOL *Msg; } @inf [Packages] - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] PrintLib diff --git a/Protocols/MsgLog/MsgLog.inf b/Protocols/MsgLog/MsgLog.inf index c1fe4749e..c284a08af 100644 --- a/Protocols/MsgLog/MsgLog.inf +++ b/Protocols/MsgLog/MsgLog.inf @@ -24,7 +24,7 @@ ENTRY_POINT = MsgLogEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/Protocols/SMCHelper/SMCHelper.inf b/Protocols/SMCHelper/SMCHelper.inf index 93cc5d1f4..7e5bf9ccd 100644 --- a/Protocols/SMCHelper/SMCHelper.inf +++ b/Protocols/SMCHelper/SMCHelper.inf @@ -24,7 +24,7 @@ ENTRY_POINT = SMCHelperEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf index 54953fa76..71e8427af 100644 --- a/ShellPkg/Application/Shell/Shell.inf +++ b/ShellPkg/Application/Shell/Shell.inf @@ -51,7 +51,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf index 2b978d986..27f4855fa 100644 --- a/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf +++ b/ShellPkg/Application/ShellCTestApp/ShellCTestApp.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec [LibraryClasses] ShellCEntryLib diff --git a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf index 24a7e7a4c..70130c1c0 100644 --- a/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf +++ b/ShellPkg/Application/ShellSortTestApp/ShellSortTestApp.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf index 80f97ae8b..54fe00175 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpApp.inf @@ -38,7 +38,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf index 71f093f44..e906870bd 100644 --- a/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf +++ b/ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf @@ -39,7 +39,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf index 038903032..185bd4557 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpApp.inf @@ -34,7 +34,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf index e19e11668..85d04b77d 100644 --- a/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf +++ b/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf @@ -35,7 +35,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf index d34fa6d40..04359f807 100644 --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf @@ -36,7 +36,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf index 7adbf0b2a..88b96eacf 100644 --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf +++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf @@ -26,7 +26,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf index 30d421ad9..500b1663c 100644 --- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf +++ b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf @@ -30,7 +30,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec [LibraryClasses] UefiApplicationEntryPoint diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf index 15151e2a0..d3c0a4c61 100644 --- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf +++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -34,7 +34,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf index 050612619..6b837b5fa 100644 --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf @@ -99,7 +99,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf index 55d266fb8..068235089 100644 --- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf @@ -40,7 +40,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf index a0b5b1e3b..dc1b6223e 100644 --- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf @@ -27,7 +27,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf index 97696d1d3..4d3713b46 100644 --- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf @@ -35,7 +35,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf index e52e69136..16faad2d2 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf @@ -48,7 +48,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf index 9f4461fa4..a13cd9bab 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf @@ -43,7 +43,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf index 1b81732ad..0be682865 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf @@ -35,7 +35,7 @@ [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec [LibraryClasses] UefiBootServicesTableLib diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf index fccc9a8f6..4af9201cd 100644 --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf index 5abeaa7d2..3502d2ae4 100644 --- a/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf +++ b/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf @@ -32,7 +32,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec MdeModulePkg/MdeModulePkg.dec [LibraryClasses] diff --git a/ShellPkg/ShellPkg.dsc b/ShellPkg/ShellPkg.dsc index 565ef50f9..1c923f585 100644 --- a/ShellPkg/ShellPkg.dsc +++ b/ShellPkg/ShellPkg.dsc @@ -47,13 +47,13 @@ HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - ShellLib|Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf - ShellCommandLib|Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - ShellCEntryLib|Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - HandleParsingLib|Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - BcfgCommandLib|Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -107,15 +107,15 @@ gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - NULL|Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf !ifndef $(NO_SHELL_PROFILES) - NULL|Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf !endif #$(NO_SHELL_PROFILES) } diff --git a/ShellPkg/ShellPkgDX64.dsc b/ShellPkg/ShellPkgDX64.dsc index 5751bc783..0be3fc5c8 100644 --- a/ShellPkg/ShellPkgDX64.dsc +++ b/ShellPkg/ShellPkgDX64.dsc @@ -48,13 +48,13 @@ HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - ShellLib|Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf - ShellCommandLib|Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - ShellCEntryLib|Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - HandleParsingLib|Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - BcfgCommandLib|Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -91,37 +91,37 @@ # Build all the libraries when building this package. # This helps developers test changes and how they affect the package. # - Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf - Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf - Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf - Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf - Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf - #Clover/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf + ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + #ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf - Clover/ShellPkg/Application/Shell/Shell.inf { + ShellPkg/Application/Shell/Shell.inf { - NULL|Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf !ifndef $(NO_SHELL_PROFILES) - NULL|Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf !ifdef $(INCLUDE_DP) - NULL|Clover/ShellPkg/Library/UefiDpLib/UefiDpLib.inf + NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf !endif #$(INCLUDE_DP) !ifdef $(INCLUDE_TFTP_COMMAND) - NULL|Clover/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf + NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf !endif #$(INCLUDE_TFTP_COMMAND) !endif #$(NO_SHELL_PROFILES) } diff --git a/ShellPkg/ShellPkgX64.dsc b/ShellPkg/ShellPkgX64.dsc index 231968064..6c2c0ac97 100644 --- a/ShellPkg/ShellPkgX64.dsc +++ b/ShellPkg/ShellPkgX64.dsc @@ -48,13 +48,13 @@ HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - ShellLib|Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf - ShellCommandLib|Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - ShellCEntryLib|Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - HandleParsingLib|Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf - BcfgCommandLib|Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf @@ -91,37 +91,37 @@ # Build all the libraries when building this package. # This helps developers test changes and how they affect the package. # - Clover/ShellPkg/Library/UefiShellLib/UefiShellLib.inf - Clover/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf - Clover/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf - Clover/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf - Clover/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf - Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf - Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf - #Clover/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf + ShellPkg/Library/UefiShellLib/UefiShellLib.inf + ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf + ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf + ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf + ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf + ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + #ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf - Clover/ShellPkg/Application/Shell/Shell.inf { + ShellPkg/Application/Shell/Shell.inf { - NULL|Clover/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf !ifndef $(NO_SHELL_PROFILES) - NULL|Clover/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf - NULL|Clover/ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf + NULL|ShellPkg/Library/UefiShellNetwork2CommandsLib/UefiShellNetwork2CommandsLib.inf !ifdef $(INCLUDE_DP) - NULL|Clover/ShellPkg/Library/UefiDpLib/UefiDpLib.inf + NULL|ShellPkg/Library/UefiDpLib/UefiDpLib.inf !endif #$(INCLUDE_DP) !ifdef $(INCLUDE_TFTP_COMMAND) - NULL|Clover/ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf + NULL|ShellPkg/Library/UefiShellTftpCommandLib/UefiShellTftpCommandLib.inf !endif #$(INCLUDE_TFTP_COMMAND) !endif #$(NO_SHELL_PROFILES) } diff --git a/ShellPkg/build64.sh b/ShellPkg/build64.sh index 073d408b4..f8edc6862 100644 --- a/ShellPkg/build64.sh +++ b/ShellPkg/build64.sh @@ -95,7 +95,7 @@ do fi if [[ $arg == clean ]]; then - build -p $WORKSPACE/Clover/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -t $TARGET_TOOLS -n 3 clean + build -p $WORKSPACE/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -t $TARGET_TOOLS -n 3 clean exit $? fi done @@ -105,6 +105,6 @@ done # Build the edk2 ShellPkg # echo Running edk2 build for ShellPkg$PROCESSOR -build -p $WORKSPACE/Clover/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -b $BUILDTARGET -t $TARGET_TOOLS -n 3 $* +build -p $WORKSPACE/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -b $BUILDTARGET -t $TARGET_TOOLS -n 3 $* exit $? diff --git a/ShellPkg/build64D.sh b/ShellPkg/build64D.sh index 1667aa28e..ba7b0c80b 100644 --- a/ShellPkg/build64D.sh +++ b/ShellPkg/build64D.sh @@ -95,7 +95,7 @@ do fi if [[ $arg == clean ]]; then - build -p $WORKSPACE/Clover/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -t $TARGET_TOOLS -n 3 clean + build -p $WORKSPACE/ShellPkg/ShellPkg$PROCESSOR.dsc -a $PROCESSOR -t $TARGET_TOOLS -n 3 clean exit $? fi done @@ -105,6 +105,6 @@ done # Build the edk2 ShellPkg # echo Running edk2 build for ShellPkg$PROCESSOR -build -p $WORKSPACE/Clover/ShellPkg/ShellPkgD$PROCESSOR.dsc -a $PROCESSOR -b $BUILDTARGET -t $TARGET_TOOLS -n 3 $* +build -p $WORKSPACE/ShellPkg/ShellPkgD$PROCESSOR.dsc -a $PROCESSOR -b $BUILDTARGET -t $TARGET_TOOLS -n 3 $* exit $? diff --git a/Trash/BiosVideoAuto/BiosVideo.inf b/Trash/BiosVideoAuto/BiosVideo.inf index f0d9b6dae..5803552c9 100644 --- a/Trash/BiosVideoAuto/BiosVideo.inf +++ b/Trash/BiosVideoAuto/BiosVideo.inf @@ -25,7 +25,7 @@ MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec -# Clover/CloverPkg.dec +# CloverPkg.dec # DuetPkg/DuetPkg.dec [LibraryClasses] @@ -44,11 +44,11 @@ BiosVideoNew.c ComponentName.c VesaBiosExtensions.h - LegacyBiosThunk.c + LegacyBiosThunk.c #Resolution.c 915resolution.c - edid.c + edid.c #MsgLog.c diff --git a/Trash/BiosVideoAuto/MsgLog.c b/Trash/BiosVideoAuto/MsgLog.c index fa0d97d74..115e00f6a 100644 --- a/Trash/BiosVideoAuto/MsgLog.c +++ b/Trash/BiosVideoAuto/MsgLog.c @@ -42,7 +42,7 @@ extern MESSAGE_LOG_PROTOCOL *Msg; } @inf [Packages] - Clover/CloverPkg.dec + CloverPkg.dec [LibraryClasses] PrintLib diff --git a/Trash/IntelGmaDxe/Gop.inf b/Trash/IntelGmaDxe/Gop.inf index 4bae56b0d..6a59317c7 100644 --- a/Trash/IntelGmaDxe/Gop.inf +++ b/Trash/IntelGmaDxe/Gop.inf @@ -31,7 +31,7 @@ FILE_GUID = 048B4BA8-3666-4fa7-A7ED-D75D9BA6358D [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Trash/OemSmbiosGenDxe/SmbiosGen.inf b/Trash/OemSmbiosGenDxe/SmbiosGen.inf index 56100f2e8..192242a8b 100644 --- a/Trash/OemSmbiosGenDxe/SmbiosGen.inf +++ b/Trash/OemSmbiosGenDxe/SmbiosGen.inf @@ -28,7 +28,7 @@ ENTRY_POINT = SmbiosGenEntrypoint [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf b/Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf index 7227ffa65..d11127657 100644 --- a/Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf +++ b/Trash/VBoxIdeBusDxe/VBoxIdeBusDxe.inf @@ -69,7 +69,7 @@ [Packages] MdePkg/MdePkg.dec - Clover/CloverPkg.dec + CloverPkg.dec # VBoxPkg/VBoxPkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec # IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/bdmesg_efi/bdmesg.inf b/bdmesg_efi/bdmesg.inf index 545b996cf..e99b81090 100644 --- a/bdmesg_efi/bdmesg.inf +++ b/bdmesg_efi/bdmesg.inf @@ -15,13 +15,13 @@ # [Sources] - + bdmesg.c [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec - Clover/ShellPkg/ShellPkg.dec + ShellPkg/ShellPkg.dec [LibraryClasses] UefiApplicationEntryPoint diff --git a/cbuild.bat b/cbuild.bat index 8305b6331..1ab106151 100644 --- a/cbuild.bat +++ b/cbuild.bat @@ -31,7 +31,8 @@ set DEVSTAGE= set DEFAULT_CYGWIN_HOME=c:\cygwin set DEFAULT_PYTHONHOME=c:\Python27 set DEFAULT_PYTHON_FREEZER_PATH=%PYTHON_HOME%\Scripts -set DEFAULT_NASM_PREFIX=%DEFAULT_CYGWIN_HOME%\bin +set DEFAULT_NASM_PREFIX= +rem # %DEFAULT_CYGWIN_HOME%\bin set DEFAULT_TOOLCHAIN=VS2013x86 set DEFAULT_BUILDTARGET=RELEASE set DEFAULT_TARGETARCH=X64 @@ -125,11 +126,11 @@ rem # search edk path @echo off goto prebuild ) - if ["%CD%"] == ["%~d0%\"] ( - popd - echo ==^> EDK2 not found ^<== - goto failscript - ) +rem # if ["%CD%"] == ["%~d0%\"] ( +rem # popd +rem # echo ==^> EDK2 not found ^<== +rem # goto failscript +rem # ) rem # cd .. goto searchforedk diff --git a/edksetup.bat b/edksetup.bat index 97e2330e8..0a5c6466f 100644 --- a/edksetup.bat +++ b/edksetup.bat @@ -29,7 +29,7 @@ @REM Set the WORKSPACE to the current working directory @REM pushd . -cd %~dp0 +@REM cd %~dp0 if not defined WORKSPACE ( goto SetWorkSpace diff --git a/gptsync/gptsync.inf b/gptsync/gptsync.inf index 7e26c47c6..bed5a3ee5 100644 --- a/gptsync/gptsync.inf +++ b/gptsync/gptsync.inf @@ -41,7 +41,7 @@ lib.c [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec diff --git a/rEFIt_UEFI/refit.inf b/rEFIt_UEFI/refit.inf index 30c5b80ba..04f1bb4b5 100644 --- a/rEFIt_UEFI/refit.inf +++ b/rEFIt_UEFI/refit.inf @@ -163,7 +163,7 @@ libeg/ftol.asm | MSFT [Packages] - Clover/CloverPkg.dec + CloverPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec