summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Lindholm <leif.lindholm@linaro.org>2014-01-24 17:18:26 +0000
committerLeif Lindholm <leif.lindholm@linaro.org>2014-01-24 17:18:26 +0000
commite1e57aa891deef00276b26a4569802a5cd13ce92 (patch)
tree9061825c6c9f5c8bed33d5b2087101ce38f23fdf
parent18110e987bb049e24ade0fb63b5577def8f99114 (diff)
parent04d965c0713468e055ef328f9f49903bc5944e54 (diff)
Merging uefi-next/linaro-release into masterHEADlinaro-uefi-2014.01master
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
-rw-r--r--ArmPkg/ArmPkg.dec4
-rw-r--r--ArmPkg/ArmPkg.dsc4
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf71
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Apic.aslc216
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Bert.aslc84
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Dsdt.asl255
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ecdt.aslc70
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Einj.aslc202
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Erst.aslc319
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facp.aslc175
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facs.aslc86
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Gtdt.aslc51
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Hest.aslc84
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mcfg.aslc62
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mpst.aslc141
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Msct.aslc106
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Oem0.aslc48
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Platform.h75
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Pmtt.aslc216
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Slit.aslc87
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Spmi.aslc86
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Srat.aslc106
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ssdt0.asl17
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Uefi.aslc57
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/apic.asl153
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/bert.asl48
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/cpep.asl53
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/dsdt.asl758
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ecdt.asl64
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/einj.asl178
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/erst.asl305
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facp.asl194
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facs.asl48
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/fpdt.asl62
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/gtdt.asl80
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/hest.asl76
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mcfg.asl53
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mchi.asl65
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mpst.asl114
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/msct.asl78
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/oem0.asl45
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/pmtt.asl132
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/rsdp.asl44
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/slit.asl87
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/spmi.asl67
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/srat.asl84
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ssdt0.asl44
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/tpm2.asl22
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/uefi.asl48
-rw-r--r--ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/xsdt.asl66
-rw-r--r--ArmPkg/Drivers/ArmGic/ArmGicDxe.c3
-rw-r--r--ArmPkg/Drivers/ArmGic/ArmGicDxe.inf1
-rw-r--r--ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.h42
-rw-r--r--ArmPkg/Include/Chipset/AArch64Mmu.h12
-rw-r--r--ArmPkg/Include/Library/ArmLib.h2
-rw-r--r--ArmPkg/Include/Ppi/ArmMpCoreInfo.h2
-rw-r--r--ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c12
-rw-r--r--ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c2
-rw-r--r--ArmPkg/Library/BdsLib/BdsLinuxFdt.c2
-rw-r--r--ArmPkg/Library/BdsLib/BdsLinuxLoader.h8
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S20
-rw-r--r--ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm23
-rw-r--r--ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc2
-rw-r--r--ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc2
-rw-r--r--ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c6
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.c148
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf70
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc11
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf10
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.dsc13
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.fdf21
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc13
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.fdf21
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc6
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc10
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf8
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc26
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf12
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc20
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf12
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc17
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf8
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc18
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf21
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc13
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf20
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15x2/ArmPlatform.h4
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA5s/ArmPlatform.h4
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4/ArmPlatform.h4
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h4
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S21
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm23
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c16
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S3
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm2
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S10
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.S2
-rw-r--r--ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm2
-rw-r--r--ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c10
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c10
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S2
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm2
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S35
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm37
-rw-r--r--ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf8
-rw-r--r--ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c20
-rwxr-xr-xArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c10
-rwxr-xr-xArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c6
-rw-r--r--ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.c (renamed from ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.c)211
-rw-r--r--ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf (renamed from ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf)19
-rw-r--r--ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S4
-rw-r--r--ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S38
-rw-r--r--ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm38
-rwxr-xr-xArmPlatformPkg/PrePi/PrePi.c8
-rw-r--r--BaseTools/Bin/Win32/BPDG.exebin1042294 -> 1042286 bytes
-rwxr-xr-xBaseTools/Bin/Win32/BootSectImage.exebin434176 -> 434176 bytes
-rwxr-xr-xBaseTools/Bin/Win32/EfiLdrImage.exebin421888 -> 421888 bytes
-rwxr-xr-xBaseTools/Bin/Win32/EfiRom.exebin446464 -> 446464 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenBootSector.exebin425984 -> 425984 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenCrc32.exebin425984 -> 425984 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenDepex.exebin1081253 -> 1081412 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFds.exebin1401050 -> 1402636 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFfs.exebin430080 -> 430080 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFv.exebin479232 -> 479232 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenFw.exebin499712 -> 499712 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenPage.exebin425984 -> 425984 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenPatchPcdTable.exebin1078875 -> 1079036 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenSec.exebin446464 -> 446464 bytes
-rwxr-xr-xBaseTools/Bin/Win32/GenVtf.exebin446464 -> 446464 bytes
-rwxr-xr-xBaseTools/Bin/Win32/LzmaCompress.exebin397312 -> 397312 bytes
-rwxr-xr-xBaseTools/Bin/Win32/PatchPcdValue.exebin1036120 -> 1036118 bytes
-rwxr-xr-xBaseTools/Bin/Win32/Split.exebin425984 -> 425984 bytes
-rwxr-xr-xBaseTools/Bin/Win32/TargetTool.exebin1044383 -> 1044398 bytes
-rwxr-xr-xBaseTools/Bin/Win32/TianoCompress.exebin434176 -> 434176 bytes
-rwxr-xr-xBaseTools/Bin/Win32/Trim.exebin1118098 -> 1118260 bytes
-rw-r--r--BaseTools/Bin/Win32/UPT.exebin1680092 -> 1681037 bytes
-rwxr-xr-xBaseTools/Bin/Win32/VfrCompile.exebin1286144 -> 1286144 bytes
-rwxr-xr-xBaseTools/Bin/Win32/VolInfo.exebin471040 -> 471040 bytes
-rwxr-xr-xBaseTools/Bin/Win32/build.exebin1803489 -> 1806156 bytes
-rw-r--r--BaseTools/Conf/XMLSchema/DistributionPackage.xsd56
-rw-r--r--BaseTools/Conf/build_rule.template2
-rw-r--r--BaseTools/Conf/tools_def.template175
-rw-r--r--BaseTools/Source/C/EfiRom/EfiRom.c57
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.c7
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.h2
-rw-r--r--BaseTools/Source/C/Include/Common/BuildVersion.h2
-rw-r--r--BaseTools/Source/C/Include/Common/PiFirmwareVolume.h2
-rw-r--r--BaseTools/Source/C/Include/Common/UefiBaseTypes.h10
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/PeImage.h4
-rw-r--r--BaseTools/Source/C/Include/IndustryStandard/pci22.h4
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.cpp6
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrCompiler.h3
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp11
-rw-r--r--BaseTools/Source/Python/AutoGen/AutoGen.py67
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py7
-rw-r--r--BaseTools/Source/Python/AutoGen/GenPcdDb.py150
-rw-r--r--BaseTools/Source/Python/Common/BuildVersion.py2
-rw-r--r--BaseTools/Source/Python/Common/DataType.py2
-rw-r--r--BaseTools/Source/Python/Common/Misc.py18
-rw-r--r--BaseTools/Source/Python/Common/String.py30
-rw-r--r--BaseTools/Source/Python/CommonDataClass/DataClass.py1
-rw-r--r--BaseTools/Source/Python/GenFds/CapsuleData.py22
-rw-r--r--BaseTools/Source/Python/GenFds/FdfParser.py128
-rw-r--r--BaseTools/Source/Python/GenFds/FfsInfStatement.py18
-rw-r--r--BaseTools/Source/Python/GenFds/Fv.py13
-rw-r--r--BaseTools/Source/Python/GenFds/GenFds.py4
-rw-r--r--BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py27
-rw-r--r--BaseTools/Source/Python/UPT/BuildVersion.py2
-rw-r--r--BaseTools/Source/Python/UPT/Library/DataType.py19
-rw-r--r--BaseTools/Source/Python/UPT/Logger/StringTable.py10
-rw-r--r--BaseTools/Source/Python/UPT/Parser/DecParser.py56
-rw-r--r--BaseTools/Source/Python/UPT/Parser/InfParser.py112
-rw-r--r--BaseTools/Source/Python/UPT/Xml/CommonXml.py10
-rw-r--r--BaseTools/Source/Python/Workspace/MetaFileParser.py21
-rw-r--r--BaseTools/Source/Python/Workspace/WorkspaceDatabase.py117
-rw-r--r--BaseTools/Source/Python/build/BuildReport.py2
-rw-r--r--BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S12
-rw-r--r--BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.asm13
-rwxr-xr-xBeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c6
-rw-r--r--CryptoPkg/CryptoPkg.dec4
-rw-r--r--CryptoPkg/CryptoPkg.dsc4
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Dblk.efibin33760 -> 33760 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Devices.efibin23968 -> 23968 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Devtree.efibin23840 -> 23840 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Guid.efibin20736 -> 20736 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/IfConfig.efibin29184 -> 29184 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/IpConfig.efibin23584 -> 23584 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/LoadPciRom.efibin21952 -> 21952 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Mount.efibin21024 -> 21024 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Openinfo.efibin22912 -> 22912 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/Ping.efibin23680 -> 23680 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/SmbiosView.efibin113184 -> 113184 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/TelnetMgmt.efibin19584 -> 19584 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/comp.efibin23712 -> 23712 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/dmem.efibin32416 -> 32416 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/dmpstore.efibin26112 -> 26112 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/edit.efibin38496 -> 38496 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/eficompress.efibin35648 -> 35648 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/efidecompress.efibin20800 -> 20800 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/err.efibin28928 -> 28928 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efibin46048 -> 46048 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/mem.efibin32416 -> 32416 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/memmap.efibin22336 -> 22336 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/mm.efibin34240 -> 34240 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/mode.efibin20640 -> 20640 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/pci.efibin79456 -> 79456 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/sermode.efibin24288 -> 24288 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/stall.efibin19872 -> 19872 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ia32/Apps/timezone.efibin27360 -> 27360 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Dblk.efibin83552 -> 83552 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Devices.efibin74720 -> 74720 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Devtree.efibin76768 -> 76768 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Guid.efibin64032 -> 64032 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/IfConfig.efibin86176 -> 86176 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/IpConfig.efibin71456 -> 71456 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/LoadPciRom.efibin71456 -> 71456 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Mount.efibin65888 -> 65888 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Openinfo.efibin70464 -> 70464 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/Ping.efibin76448 -> 76448 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/SmbiosView.efibin215264 -> 215264 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/TelnetMgmt.efibin63232 -> 63232 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/comp.efibin68320 -> 68320 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/dmem.efibin80704 -> 80704 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/dmpstore.efibin77344 -> 77344 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/edit.efibin124384 -> 124384 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/eficompress.efibin93344 -> 93344 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/efidecompress.efibin66976 -> 66976 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/err.efibin81536 -> 81536 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efibin139552 -> 139552 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/mem.efibin80768 -> 80768 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/memmap.efibin66272 -> 66272 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/mm.efibin87040 -> 87040 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/mode.efibin64704 -> 64704 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/pci.efibin141568 -> 141568 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/sermode.efibin70496 -> 70496 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/stall.efibin65696 -> 65696 bytes
-rw-r--r--EdkShellBinPkg/Bin/Ipf/Apps/timezone.efibin73216 -> 73216 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Dblk.efibin39808 -> 39808 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Devices.efibin30368 -> 30368 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Devtree.efibin30240 -> 30240 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Guid.efibin26016 -> 25984 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/IfConfig.efibin36896 -> 36864 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/IpConfig.efibin29120 -> 29120 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/LoadPciRom.efibin28000 -> 28000 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Mount.efibin26240 -> 26240 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Openinfo.efibin28544 -> 28544 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/Ping.efibin30112 -> 30112 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/SmbiosView.efibin126720 -> 126688 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/TelnetMgmt.efibin24608 -> 24576 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/comp.efibin29056 -> 29056 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/dmem.efibin38656 -> 38656 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/dmpstore.efibin32704 -> 32704 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/edit.efibin48416 -> 48416 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/eficompress.efibin41984 -> 41984 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/efidecompress.efibin26112 -> 26112 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/err.efibin35424 -> 35424 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/hexedit.efibin57600 -> 57600 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/mem.efibin38624 -> 38624 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/memmap.efibin27392 -> 27392 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/mm.efibin40768 -> 40768 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/mode.efibin25760 -> 25760 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/pci.efibin90848 -> 90848 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/sermode.efibin29824 -> 29824 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/stall.efibin25216 -> 25216 bytes
-rw-r--r--EdkShellBinPkg/Bin/X64/Apps/timezone.efibin32928 -> 32896 bytes
-rw-r--r--EdkShellBinPkg/EdkShellBinPkg.dec4
-rw-r--r--EdkShellBinPkg/FullShell/Ia32/Shell_Full.efibin683968 -> 683936 bytes
-rw-r--r--EdkShellBinPkg/FullShell/Ipf/Shell_Full.efibin1331776 -> 1331776 bytes
-rw-r--r--EdkShellBinPkg/FullShell/X64/Shell_Full.efibin771136 -> 771136 bytes
-rw-r--r--EdkShellBinPkg/MinimumShell/Ia32/Shell.efibin312832 -> 313120 bytes
-rw-r--r--EdkShellBinPkg/MinimumShell/Ipf/Shell.efibin680992 -> 681472 bytes
-rw-r--r--EdkShellBinPkg/MinimumShell/X64/Shell.efibin362592 -> 362720 bytes
-rw-r--r--EdkShellBinPkg/ReadMe.txt6
-rw-r--r--EdkShellPkg/ShellR64.patch13106
-rw-r--r--EmbeddedPkg/Include/Protocol/MmcHost.h6
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Diagnostics.c51
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/Mmc.h14
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c2
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf5
-rw-r--r--EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c456
-rw-r--r--FatBinPkg/EnhancedFatDxe/Ebc/Fat.efibin62784 -> 63296 bytes
-rw-r--r--FatBinPkg/EnhancedFatDxe/Ia32/Fat.efibin18048 -> 18304 bytes
-rw-r--r--FatBinPkg/EnhancedFatDxe/Ipf/Fat.efibin141568 -> 142976 bytes
-rw-r--r--FatBinPkg/EnhancedFatDxe/X64/Fat.efibin27136 -> 27552 bytes
-rw-r--r--FatBinPkg/FatBinPkg.dec4
-rw-r--r--FatBinPkg/ReadMe.txt2
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c125
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf3
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h1
-rw-r--r--IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c78
-rw-r--r--IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec4
-rw-r--r--IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h5
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c16
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c20
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h79
-rw-r--r--IntelFrameworkPkg/IntelFrameworkPkg.dec4
-rw-r--r--IntelFrameworkPkg/IntelFrameworkPkg.dsc4
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c95
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c75
-rw-r--r--MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c97
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c14
-rw-r--r--MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c125
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c6
-rw-r--r--MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf1
-rw-r--r--MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c17
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c27
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c12
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h15
-rw-r--r--MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c81
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c32
-rw-r--r--MdeModulePkg/Core/Pei/Memory/MemoryServices.c4
-rw-r--r--MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h2
-rw-r--r--MdeModulePkg/Include/Protocol/FormBrowserEx.h2
-rw-r--r--MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c2
-rw-r--r--MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c11
-rw-r--r--MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c6
-rw-r--r--MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdeModulePkg/MdeModulePkg.dec20
-rw-r--r--MdeModulePkg/MdeModulePkg.dsc4
-rw-r--r--MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c12
-rw-r--r--MdeModulePkg/Universal/DebugPortDxe/DebugPort.c177
-rw-r--r--MdeModulePkg/Universal/DebugPortDxe/DebugPort.h3
-rw-r--r--MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c8
-rw-r--r--MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h3
-rw-r--r--MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c1
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf3
-rw-r--r--MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c45
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf10
-rw-r--r--MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf10
-rw-r--r--MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c4
-rw-r--r--MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf3
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c95
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c13
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c69
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h31
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c40
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c9
-rw-r--r--MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h4
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c4
-rw-r--r--MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c68
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Pcd.c4
-rw-r--r--MdeModulePkg/Universal/PCD/Dxe/Service.c45
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c140
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c23
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.c77
-rw-r--r--MdeModulePkg/Universal/SetupBrowserDxe/Setup.h10
-rw-r--r--MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c8
-rw-r--r--MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h6
-rw-r--r--MdePkg/Include/IndustryStandard/Pci.h3
-rw-r--r--MdePkg/Include/IndustryStandard/PciExpress21.h220
-rw-r--r--MdePkg/Include/IndustryStandard/PciExpress30.h32
-rw-r--r--MdePkg/Include/IndustryStandard/SmBios.h18
-rw-r--r--MdePkg/Include/Library/MemoryAllocationLib.h5
-rw-r--r--MdePkg/Include/Library/PcdLib.h68
-rw-r--r--MdePkg/Include/Library/PeiServicesTablePointerLib.h21
-rw-r--r--MdePkg/Include/Library/S3BootScriptLib.h6
-rw-r--r--MdePkg/Include/Protocol/AdapterInformation.h224
-rw-r--r--MdePkg/Include/Protocol/DiskIo2.h7
-rw-r--r--MdePkg/Include/Protocol/FirmwareManagement.h6
-rw-r--r--MdePkg/Include/Protocol/FormBrowser2.h4
-rw-r--r--MdePkg/Include/Protocol/Hash.h12
-rw-r--r--MdePkg/Include/Protocol/SimpleFileSystem.h12
-rw-r--r--MdePkg/Include/Uefi/UefiSpec.h75
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Thunk16.S129
-rw-r--r--MdePkg/Library/BaseLib/Ia32/Thunk16.asm40
-rw-r--r--MdePkg/Library/BasePcdLibNull/PcdLib.c51
-rw-r--r--MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c6
-rw-r--r--MdePkg/Library/DxePcdLib/DxePcdLib.c64
-rw-r--r--MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c4
-rw-r--r--MdePkg/Library/PeiPcdLib/PeiPcdLib.c72
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c26
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c89
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf5
-rw-r--r--MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c21
-rw-r--r--MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c151
-rw-r--r--MdePkg/Library/UefiDevicePathLib/DevicePathToText.c68
-rw-r--r--MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h7
-rw-r--r--MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c6
-rw-r--r--MdePkg/MdePkg.dec14
-rw-r--r--MdePkg/MdePkg.dsc4
-rw-r--r--NetworkPkg/IScsiDxe/IScsiDriver.c216
-rw-r--r--NetworkPkg/IScsiDxe/IScsiIbft.c12
-rw-r--r--NetworkPkg/IScsiDxe/IScsiMisc.c69
-rw-r--r--NetworkPkg/IScsiDxe/IScsiMisc.h32
-rw-r--r--NetworkPkg/IpSecDxe/Ikev2/Exchange.c5
-rw-r--r--NetworkPkg/NetworkPkg.dec6
-rw-r--r--NetworkPkg/NetworkPkg.dsc6
-rw-r--r--NetworkPkg/TcpDxe/ComponentName.c4
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c46
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c59
-rw-r--r--NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c6
-rw-r--r--OvmfPkg/Include/IndustryStandard/E820.h46
-rw-r--r--OvmfPkg/Include/IndustryStandard/VirtioBlk.h40
-rw-r--r--OvmfPkg/Include/IndustryStandard/VirtioNet.h12
-rw-r--r--OvmfPkg/Include/IndustryStandard/VirtioScsi.h26
-rw-r--r--OvmfPkg/Include/Library/QemuFwCfgLib.h21
-rw-r--r--OvmfPkg/Include/Library/VirtioLib.h16
-rw-r--r--OvmfPkg/Include/Library/VirtioMmioDeviceLib.h131
-rw-r--r--OvmfPkg/Include/Protocol/VirtioDevice.h758
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c60
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf7
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c92
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c81
-rw-r--r--OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf54
-rw-r--r--OvmfPkg/Library/VirtioLib/VirtioLib.c16
-rw-r--r--OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c428
-rw-r--r--OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h294
-rw-r--r--OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c614
-rw-r--r--OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf85
-rw-r--r--OvmfPkg/OvmfPkg.dec2
-rw-r--r--OvmfPkg/OvmfPkgIa32.dsc9
-rw-r--r--OvmfPkg/OvmfPkgIa32.fdf2
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.dsc9
-rw-r--r--OvmfPkg/OvmfPkgIa32X64.fdf2
-rw-r--r--OvmfPkg/OvmfPkgX64.dsc9
-rw-r--r--OvmfPkg/OvmfPkgX64.fdf2
-rw-r--r--OvmfPkg/PlatformPei/MemDetect.c49
-rw-r--r--OvmfPkg/PlatformPei/Platform.c95
-rw-r--r--OvmfPkg/PlatformPei/Platform.h18
-rw-r--r--OvmfPkg/PlatformPei/PlatformPei.inf1
-rw-r--r--OvmfPkg/PlatformPei/Xen.c42
-rw-r--r--OvmfPkg/PlatformPei/Xen.h45
-rw-r--r--OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c2
-rw-r--r--OvmfPkg/QemuVideoDxe/Driver.c33
-rw-r--r--OvmfPkg/README22
-rw-r--r--OvmfPkg/VirtioBlkDxe/VirtioBlk.c214
-rw-r--r--OvmfPkg/VirtioBlkDxe/VirtioBlk.h24
-rw-r--r--OvmfPkg/VirtioBlkDxe/VirtioBlk.inf4
-rw-r--r--OvmfPkg/VirtioNetDxe/ComponentName.c6
-rw-r--r--OvmfPkg/VirtioNetDxe/DriverBinding.c121
-rw-r--r--OvmfPkg/VirtioNetDxe/Events.c2
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpGetStatus.c2
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpInitialize.c68
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpReceive.c10
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpShutdown.c2
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpTransmit.c12
-rw-r--r--OvmfPkg/VirtioNetDxe/VirtioNet.h24
-rw-r--r--OvmfPkg/VirtioNetDxe/VirtioNet.inf2
-rw-r--r--OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c1347
-rw-r--r--OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h332
-rw-r--r--OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf86
-rw-r--r--OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c568
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.c143
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.h22
-rw-r--r--OvmfPkg/VirtioScsiDxe/VirtioScsi.inf2
-rwxr-xr-xOvmfPkg/create-release.py151
-rw-r--r--PandaBoardPkg/Library/PandaBoardLib/PandaBoardHelper.S10
-rwxr-xr-xPandaBoardPkg/Library/PandaBoardLib/PandaBoardMem.c6
-rw-r--r--PandaBoardPkg/PandaBoardPkg.dsc5
-rw-r--r--PandaBoardPkg/PandaBoardPkg.fdf2
-rw-r--r--PcAtChipsetPkg/PcAtChipsetPkg.dec4
-rw-r--r--PcAtChipsetPkg/PcAtChipsetPkg.dsc4
-rwxr-xr-xSamsungPlatformPkg/ArndaleBoardPkg/Library/ArndaleBoardLib/Exynos5250/BoardMem.c4
-rw-r--r--SamsungPlatformPkg/ExynosPkg/Exynos5250/MemoryInitPei/MemoryInitPeiLib.c8
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec55
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dsc120
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.c175
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf46
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ComponentName.c182
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.c575
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.h274
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.c2011
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.h615
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsoleDxe.inf73
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/LaffStd.c276
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosLib.h24
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosTimerLib.h65
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform/ArmPlatform.h693
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Include/Protocol/ExynosGpio.h199
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.c36
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf40
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.c118
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf40
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.c167
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf44
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.c150
-rw-r--r--SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf38
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.c234
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf41
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.c1327
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.h293
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf49
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.c432
-rwxr-xr-xSamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf54
-rw-r--r--SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc480
-rw-r--r--SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf363
-rw-r--r--SamsungPlatformPkgOrigen/README67
-rw-r--r--SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec40
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/AcpiTables.inf37
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Dsdt.asl446
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facp.aslc79
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facs.aslc81
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Madt.aslc158
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Platform.h66
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EBLoadSecSyms.inc15
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EfiFuncs.inc463
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_boot_from_ram.inc20
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_convert_symbols.sh22
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_hw_setup.inc67
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_load_symbols.inc21
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_symbols_macros.inc193
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_unload_symbols.inc118
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.c414
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf53
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c78
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf37
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c210
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S635
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.asm609
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf49
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardMem.c210
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c57
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf50
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.dsc474
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.fdf316
-rw-r--r--SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec43
-rw-r--r--SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf4
-rw-r--r--SecurityPkg/SecurityPkg.dec12
-rw-r--r--SecurityPkg/SecurityPkg.dsc4
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c4
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c13
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h6
-rw-r--r--ShellPkg/Application/Shell/ConsoleLogger.c41
-rw-r--r--ShellPkg/Application/Shell/ConsoleWrappers.c4
-rw-r--r--ShellPkg/Application/Shell/FileHandleWrappers.c4
-rw-r--r--ShellPkg/Application/Shell/Shell.c1123
-rw-r--r--ShellPkg/Application/Shell/Shell.h44
-rw-r--r--ShellPkg/Application/Shell/ShellManParser.c13
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c43
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c46
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.h4
-rw-r--r--ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c35
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c18
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c722
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c849
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.unibin152966 -> 171002 bytes
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c18
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/For.c8
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c1
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c7
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c1
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c24
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c24
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf4
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c58
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.h1
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf4
-rw-r--r--SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf4
-rw-r--r--SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c29
-rw-r--r--SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf4
-rw-r--r--SourceLevelDebugPkg/SourceLevelDebugPkg.dec4
-rw-r--r--SourceLevelDebugPkg/SourceLevelDebugPkg.dsc4
-rw-r--r--StdLib/EfiSocketLib/Socket.c12
-rw-r--r--StdLib/EfiSocketLib/Tcp4.c8
-rw-r--r--StdLib/EfiSocketLib/Tcp6.c8
-rw-r--r--StdLib/LibC/Wchar/ConsDecons.c7
-rw-r--r--StdLib/LibC/Wchar/Wchar.inf5
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h4
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf4
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c6
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf6
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf4
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c2
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S8
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm8
-rw-r--r--UefiCpuPkg/Library/MtrrLib/MtrrLib.c18
-rw-r--r--UefiCpuPkg/Library/MtrrLib/MtrrLib.inf3
-rw-r--r--UefiCpuPkg/UefiCpuPkg.dec4
-rw-r--r--UefiCpuPkg/UefiCpuPkg.dsc4
-rw-r--r--UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c14
-rw-r--r--UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf4
578 files changed, 20994 insertions, 28571 deletions
diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec
index 1d6231c67..f11243f23 100644
--- a/ArmPkg/ArmPkg.dec
+++ b/ArmPkg/ArmPkg.dec
@@ -114,8 +114,8 @@
# System Memory (DRAM): These PCDs define the region of in-built system memory
# Some platforms can get DRAM extensions, these additional regions will be declared
# to UEFI by ArmPLatformPlib
- gArmTokenSpaceGuid.PcdSystemMemoryBase|0|UINT32|0x00000029
- gArmTokenSpaceGuid.PcdSystemMemorySize|0|UINT32|0x0000002A
+ gArmTokenSpaceGuid.PcdSystemMemoryBase|0|UINT64|0x00000029
+ gArmTokenSpaceGuid.PcdSystemMemorySize|0|UINT64|0x0000002A
# Use ClusterId + CoreId to identify the PrimaryCore
gArmTokenSpaceGuid.PcdArmPrimaryCoreMask|0xF03|UINT32|0x00000031
diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 661453c29..ea68fa59d 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -2,7 +2,7 @@
# ARM processor package.
#
# Copyright (c) 2009 - 2010, Apple Inc. All rights reserved.<BR>
-# Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
+# Copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -33,7 +33,7 @@
XCODE:*_*_ARM_PLATFORM_FLAGS == -arch armv7
XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
- GCC:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a -mfpu=neon
+ GCC:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a
GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A8
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
index ae3a66b68..46dc925fd 100644
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
@@ -1,9 +1,10 @@
-## @file
+##
# Component description file for PlatformAcpiTables module.
#
# ACPI table data and ASL sources required to boot the platform.
#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2013, Linaro Ltd.
+#
# 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
@@ -14,57 +15,37 @@
#
##
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = PlatformAcpiTables
FILE_GUID = 7E374E25-8E01-4FEE-87F2-390C23C606CD
MODULE_TYPE = USER_DEFINED
VERSION_STRING = 1.0
- FFS_EXT = SEC
- COMPILE_SELECT = .c=acpi_c
[Sources]
- Platform.h
- Apic.aslc
- Bert.aslc
- Dsdt.asl
- Ecdt.aslc
- Einj.aslc
- Erst.aslc
- Facp.aslc
- Facs.aslc
- Gtdt.aslc
- Hest.aslc
- Mcfg.aslc
- Mpst.aslc
- Msct.aslc
- Oem0.aslc
- Pmtt.aslc
- Slit.aslc
- Spmi.aslc
- Srat.aslc
- Ssdt0.asl
- Uefi.aslc
-
- ###rsdp/xsdt created by building the acpi table
- ###tables need to change format
- #asf!.asl
- #bgrt.asl
- #boot.asl
- #cpep.asl
- #fpdt.asl
- #tpm2.asl
+ facp.asl
+ dsdt.asl
+ ssdt0.asl
+ bert.asl
+ ecdt.asl
+ facs.asl
+ gtdt.asl
+ hest.asl
+ apic.asl
+ mcfg.asl
+ mpst.asl
+ oem0.asl
+ slit.asl
+ spmi.asl
+ srat.asl
+ uefi.asl
+ cpep.asl
+ einj.asl
+ erst.asl
+ fpdt.asl
+ mchi.asl
+ msct.asl
+ pmtt.asl
[Packages]
MdePkg/MdePkg.dec
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Apic.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Apic.aslc
deleted file mode 100644
index e18c1a555..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Apic.aslc
+++ /dev/null
@@ -1,216 +0,0 @@
-/** @file
- MADT Table
-
- This file contains a structure definition for the ACPI 1.0 Multiple APIC
- Description Table (MADT).
-
- Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
- 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.
-
-**/
-
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-//
-// Local APIC address
-//
-#define EFI_ACPI_LOCAL_APIC_ADDRESS 0x2C002000 // TBD
-
-
-#define ACPI_PROCESSOR_LOCAL_GIC 0xb
-#define ACPI_GIC_DISTRIBUTOR 0xc
-
-//These addresses are defined by the MP shared region defined in the UEFI memory map.
-#define MP_REGISTER_ADDRESS_GIC0 0x80301000
-#define DISTRIBUTOR_PHYSICAL_ADDRESS 0x02000000
-
-#define ACPI_GICC_NUM 0x8
-
-//
-// Ensure proper structure formats
-//
-#pragma pack (1)
-//
-// ACPI 5.0 MADT structure
-//
-typedef struct {
- EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
- EFI_ACPI_5_0_GIC_STRUCTURE Gic[ACPI_GICC_NUM];
- EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE Distributor;
-
-} EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
-
-#pragma pack ()
-
-//
-// Multiple APIC Description Table
-//
-EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
- {
- {
- EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE),
- EFI_ACPI_5_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
-
- //
- // MADT specific fields
- //
- EFI_ACPI_LOCAL_APIC_ADDRESS,
- 0x00000000
- },
- {
- //LocalGic0
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x00, //GicId
- 0x00, //AcpiProcessorUid
- 0x00000001, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- //LocalGic1
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x01, //GicId
- 0x01, //AcpiProcessorUid
- EFI_ACPI_5_0_GIC_ENABLED, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000 //PhysicalBaseAddress
- },
- //LocalGic2
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type:
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x02, //GicId
- 0x02, //AcpiProcessorUid
- EFI_ACPI_5_0_GIC_ENABLED, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- //LocalGic3
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x03, //GicId
- 0x03, //AcpiProcessorUid
- EFI_ACPI_5_0_GIC_ENABLED, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- //LocalGic4
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x04, //GicId
- 0x04, //AcpiProcessorUid
- 0, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- //LocalGic5
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x05, //GicId
- 0x05, //AcpiProcessorUid
- 0x0, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- //LocalGic6
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x06, //GicId
- 0x06, //AcpiProcessorUid
- 0x0, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000 , //PhysicalBaseAddress
- },
- //LocalGic7
- {
- ACPI_PROCESSOR_LOCAL_GIC, //Type
- sizeof (EFI_ACPI_5_0_GIC_STRUCTURE), //Length
- 0x00, //Reserved
- 0x07, //GicId
- 0x07, //AcpiProcessorUid
- 0x0, //Flags
- 0x00000000, //ParkingProtocolVersion
- 0x00000000, //PerformanceInterruptGsiv
- 0x0000000000000000, //ParkedAddress
- 0x000000002C002000, //PhysicalBaseAddress
- },
- },
- //Distributor
- {
- ACPI_GIC_DISTRIBUTOR, //Type
- sizeof (EFI_ACPI_5_0_GIC_DISTRIBUTOR_STRUCTURE), //Length
- 0, //Reserved1
- 0, //GicId
- 0x000000002C001000, //PhysicalBaseAddress
- 0, //SystemVectorBase
- 0 //Reserved2
- }
-
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Madt;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Bert.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Bert.aslc
deleted file mode 100644
index 0fe2bc43a..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Bert.aslc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-// Generic error severity in data entry
-#define BOOT_ERROR_SEVERITY_RECOVERABLE 0
-#define BOOT_ERROR_SEVERITY_FATAL 1
-#define BOOT_ERROR_SEVERITY_CORRECTED 2
-#define BOOT_ERROR_SEVERITY_NONE 3
-
-#pragma pack(1)
-
-// ErrorStatus block record definitions for various errors
-typedef struct {
- UINT32 UeValid:1;
- UINT32 CeValid:1;
- UINT32 MultipleUeValid:1;
- UINT32 MultipleCeValid:1;
- UINT32 NumErrorDataEntry:10;
- UINT32 Resv1:18;
-} BOOT_ERROR_BLOCK_STATUS;
-
-
-typedef struct {
- // Error Status block
- BOOT_ERROR_BLOCK_STATUS BlockStatus;
- UINT32 RawDataOffset;
- UINT32 RawDataSize;
- UINT32 ErrDataSize;
- UINT32 Severity;
- // Error Status data...
-} EFI_ACPI_5_0_BOOT_ERROR_REGION;
-
-
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 BootErrorRegionLen;
- UINT64 BootErrorRegion;
-} EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE;
-
-#pragma pack()
-
-
-
-EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE Bert = {
- {
- EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE),
- EFI_ACPI_5_0_BOOT_ERROR_RECORD_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x02,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x9D, //BootErrorRegionLen
- 0xFFFF0008 //BootErrorRegion
-
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Bert;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Dsdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Dsdt.asl
deleted file mode 100644
index c4185fecb..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Dsdt.asl
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
- *
- * [DSDT] Description of the armv8 VE Model
- *
- * This source is released under the terms of the GPLv2.
- */
-
-DefinitionBlock (
- "dsdt.aml", // output filename
- "DSDT", // table signature
- 2, // DSDT compliance revision
- "LINARO", // OEM ID
- "RTSMVEV8", // table ID
- 0x00000003) // OEM revision
-{
- Scope (\_SB)
- {
- Method (_OSC, 4, NotSerialized)
- {
- /* Platform-Wide OSPM Capabilities */
- If(LEqual(Arg0,ToUUID("0811B06E-4A27-44F9-8D60-3CBBC22E7B48")))
- {
- /* APEI support unconditionally */
- Return (Arg3)
- } Else {
- CreateDWordField (Arg3, Zero, CDW1)
- /* Set invalid UUID error bit */
- Or (CDW1, 0x04, CDW1)
- Return (Arg3)
- }
- }
-
- Device (HED)
- {
- Name (_HID, EisaId ("PNP0C33"))
- Name (_UID, 0x00)
- }
-
- Device (SCK0)
- {
- Name (_HID, "ACPI0004")
- Name (_UID, 0x00)
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0F)
- }
-
- Device (PRC0)
- {
- Name (_HID, "ACPI0007")
- Name (_UID, 0x00)
-
- /* CPU0 will be always present */
- Method (_STA, 0, NotSerialized)
- {
- Return (0x0F)
- }
-
- Name (MAT0, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* type, len, reserved, gic_id */
- /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* uid, flags */
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* parking_version, performance_interrupt */
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* parked_address */
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* base_address */
- })
-
- Name (MAT1, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Method (_MAT, 0, NotSerialized)
- {
- If (_STA())
- {
- Return (MAT0)
- }
- Else
- {
- Return (MAT1)
- }
- }
- }
-
- Device (PRC1)
- {
- Name (_HID, "ACPI0007")
- Name (_UID, 0x01)
-
- Name (STA1, 0x0F)
- Method (_STA, 0, NotSerialized)
- {
- Return (STA1)
- }
-
- Method (_EJ0, 1, NotSerialized)
- {
- If (LEqual (STA1, 0x0F))
- {
- Store (0x00, STA1)
- }
- }
-
- Name (MAT0, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- /* 0008 */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Name (MAT1, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
- /* 0008 */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Method (_MAT, 0, NotSerialized)
- {
- If (_STA())
- {
- Return (MAT0)
- }
- Else
- {
- Return (MAT1)
- }
- }
- }
-
- Device (PRC2)
- {
- Name (_HID, "ACPI0007")
- Name (_UID, 0x02)
-
- Name (STA2, 0x0F)
- Method (_STA, 0, NotSerialized)
- {
- Return (STA2)
- }
-
- Method (_EJ0, 1, NotSerialized)
- {
- If (LEqual (STA2, 0x0F))
- {
- Store (0x00, STA2)
- }
- }
-
- Name (MAT0, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- /* 0008 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Name (MAT1, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
- /* 0008 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Method (_MAT, 0, NotSerialized)
- {
- If (_STA())
- {
- Return (MAT0)
- }
- Else
- {
- Return (MAT1)
- }
- }
- }
-
- Device (PRC3)
- {
- Name (_HID, "ACPI0007")
- Name (_UID, 0x03)
-
- Name (STA3, 0x0F)
- Method (_STA, 0, NotSerialized)
- {
- Return (STA3)
- }
-
- Method (_EJ0, 1, NotSerialized)
- {
- If (LEqual (STA3, 0x0F))
- {
- Store (0x00, STA3)
- }
- }
-
- Name (MAT0, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- /* 0008 */ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Name (MAT1, Buffer (0x28)
- {
- /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
- /* 0008 */ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
- /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- })
-
- Method (_MAT, 0, NotSerialized)
- {
- If (_STA())
- {
- Return (MAT0)
- }
- Else
- {
- Return (MAT1)
- }
- }
- }
- }
-
- Device (NET0) {
- Name (_HID, "LINA0003")
- Name (_UID, 0)
-
- Method (_CRS, 0x0, Serialized) {
- Name (RBUF, ResourceTemplate () {
- Memory32Fixed (ReadWrite, 0x1a000000, 0x00010000)
- Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x2F}
- })
- Return (RBUF)
- }
- }
- }
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ecdt.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ecdt.aslc
deleted file mode 100644
index d817d5988..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ecdt.aslc
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-typedef struct
-{
- EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE table;
- UINT8 ucNamepath;
-}EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_EX;
-
-
-EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_EX Ecdt= {
- {
- {
- EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_EX),
- EFI_ACPI_5_0_EMBEDDED_CONTROLLER_BOOT_RESOURCES_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- /*Command/Status Register Generic Address Structure*/
- {
- 0x01, //Space ID:SystemIO
- 0x08, //Bit Width
- 0x00, //Bit Offset
- 0x00, //Encoded Access Width
- 0x0000000000000066, //Address
- },
- /*Data Register Generic Address Structure*/
- {
- 0x01, //Space ID:SystemIO
- 0x08, //Bit Width
- 0x00, //Bit Offset
- 0x00, //Encoded Access Width
- 0x0000000000000062, //Address
- },
- 0x00000000, //UID
- 0x9, //GPE Number
- },
- 0x0 //Namepath
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Ecdt;
-}
-
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Einj.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Einj.aslc
deleted file mode 100644
index 7392cc2f3..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Einj.aslc
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#pragma pack (1)
-typedef struct {
- UINT8 Operation;
- UINT8 Instruction;
- UINT8 Flags;
- UINT8 Reserved8;
- EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE Register;
- UINT64 Value;
- UINT64 Mask;
-} EFI_ACPI_WHEA_SERIALIZATION_ACTION;
-
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 InjectionHeaderSize;
- UINT32 Resv1;
- UINT32 InstructionEntryCount;
-} EFI_ACPI_WHEA_ERROR_INJECTION_HEADER;
-
-typedef struct {
- EFI_ACPI_WHEA_ERROR_INJECTION_HEADER header;
- EFI_ACPI_WHEA_SERIALIZATION_ACTION InstructionEntry[8];
-} EFI_ACPI_5_0_ERROR_INJECTION_TABLE;
-
-#pragma pack ()
-
-
-EFI_ACPI_5_0_ERROR_INJECTION_TABLE Einj = {
- {
- {
- EFI_ACPI_5_0_ERROR_INJECTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_ERROR_INJECTION_TABLE),
- EFI_ACPI_5_0_ERROR_INJECTION_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x00000002,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- sizeof(EFI_ACPI_WHEA_ERROR_INJECTION_HEADER),
- EFI_ACPI_RESERVED_DWORD,
- 0x08, /*Injection Entry Count*/
- },
-
- {
- { //Action0
- 0x00, // Action:Begin Operation
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action1
- 0x01, // Action:Get Trigger Table
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action2
- 0x02, // Action:Set Error Type
- 0x2, // Instruction:Write Register
- 0x1, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action3
- 0x03, // Action:Get Error Type
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action4
- 0x04, // Action:End Operation
- 0x3, // Instruction:Write Register
- 0x1, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action5
- 0x05, // Action:Execute Operation
- 0x3, // Instruction:Write Register
- 0x1, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_IO, //Space ID
- 0x10, //Bit Width
- 0x0, //Bit Offset
- 0x2, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action6
- 0x06, // Action:Check Busy Status
- 0x1, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action7
- 0x07, // Action:Get Command Status
- 0x0, // Instruction:Read Register
- 0x1, // Flags
- 0x00, // Reserved
- /*Register Region*/
- {
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- },
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Einj;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Erst.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Erst.aslc
deleted file mode 100644
index 0170b99f4..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Erst.aslc
+++ /dev/null
@@ -1,319 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define ACTION_BEGIN_WRITE_OPERATION 0x00
-#define ACTION_BEGIN_READ_OPERATION 0x01
-#define ACTION_BEGIN_CLEAR_OPERATION 0x02
-#define ACTION_END_OPERATION 0x03
-#define ACTION_SET_RECORD_OFFSET 0x04
-#define ACTION_EXECUTE_OPEARTION 0x05
-#define ACTION_CHECK_BUSY_STATUS 0x06
-#define ACTION_GET_COMMAND_STATUS 0x07
-#define ACTION_GET_RECORD_IDENTIFIER 0x08
-#define ACTION_SET_RECORD_IDENTIFIER 0x09
-#define ACTION_GET_RECORD_COUNT 0x0A
-#define ACTION_BEGIN_DUMMY_WRITE_OPERATION 0x0B
-#define ACTION_GET_NEXT_RECORD_IDENTIFIER 0x0C
-#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE 0x0D
-#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE_LENGTH 0x0E
-#define ACTION_GET_ERROR_LOG_ADDRESS_RANGE_ATTRIBUTES 0x0F
-
-
-#pragma pack (1)
-
-typedef struct {
- UINT8 Operation;
- UINT8 Instruction;
- UINT8 Flags;
- UINT8 Reserved8;
- EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE Register;
- UINT64 Value;
- UINT64 Mask;
-} EFI_ACPI_5_0_SERIALIZATION_ACTION;
-
-
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 SerializationHeaderSize;
- UINT32 Resv1;
- UINT32 InstructionEntryCount;
- EFI_ACPI_5_0_SERIALIZATION_ACTION InstructionEntry[16];
-} EFI_ACPI_5_0_BOOT_ERROR_RECORD_SERIALIZATION_TABLE;
-
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 SerializationHeaderSize;
- UINT32 Resv1;
- UINT32 InstructionEntryCount;
-} EFI_ACPI_5_0_SERIALIZATION_ACTION_HEADER;
-#pragma pack ()
-
-
-
-EFI_ACPI_5_0_BOOT_ERROR_RECORD_SERIALIZATION_TABLE Erst = {
- {
- EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_BOOT_ERROR_RECORD_SERIALIZATION_TABLE),
- EFI_ACPI_5_0_ERROR_RECORD_SERIALIZATION_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x00000002,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- sizeof(EFI_ACPI_5_0_SERIALIZATION_ACTION_HEADER),
- EFI_ACPI_RESERVED_DWORD,
- 0x10,
- {
- { //Action0
- 0x00, // Action:Begin Operation
- 0x3, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0100, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action1
- 0x01, // Action:Begin Read Operation
- 0x3, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0108, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action2
- 0x02, // Action:Begin Clear Operation
- 0x3, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0110, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action3
- 0x03, // Action:Begin Clear Operation
- 0x4, // Instruction:Noop
- 0x1, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0118, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action4
- 0x04, // Action:Begin Clear Operation
- 0x2, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0120, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action5
- 0x05, // Action:Execute Operation
- 0x3, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_5_0_SYSTEM_MEMORY, //Space ID
- 0x8, //Bit Width
- 0x0, //Bit Offset
- 0x1, //Encoded Access Width
- 0xFFFF0128, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action6
- 0x06, // Action:Check Busy Status
- 0x1, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0130, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action7
- 0x07, // Action:Get Command Status
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0138, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action8
- 0x08, // Action:Get Command Status
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0140, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action9
- 0x09, // Action:Set Record Identifier
- 0x2, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0148, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action10
- 0x0A, // Action:Get Record Count
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0150, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action11
- 0x0B, // Action:Begin Dummy Write
- 0x3, // Instruction:Write Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0158, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action12
- 0x0C, // Action:Unused/Unknown Action
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0160, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action13
- 0x0D, // Action:Get Error Address Range
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0168, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action14
- 0x0E, // Action:Get Error Address Length
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0170, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- { //Action15
- 0x0F, // Action:Get Error Attributes
- 0x0, // Instruction:Read Register
- 0x0, // Flags
- 0x00, // Reserved
- /*Register Region*/
- EFI_ACPI_3_0_SYSTEM_MEMORY, //Space ID
- 0x40, //Bit Width
- 0x0, //Bit Offset
- 0x4, //Encoded Access Width
- 0xFFFF0178, //Address
- 0x0000000000000000, // Value for InjectError()
- 0xFFFFFFFFFFFFFFFF // Mask is only valid for 32-bits
- },
- }
-
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Erst;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facp.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facp.aslc
deleted file mode 100644
index 729c5bc38..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facp.aslc
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @file
- FACP Table
-
- Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
- 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.
-
-**/
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include "Platform.h"
-
-EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE Facp = {
- {
- EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE),
- EFI_ACPI_5_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
- 0, // to make sum of entire table == 0
- {EFI_ACPI_OEM_ID}, // OEMID is a 6 bytes long field
- EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
- 0x00, // OEM revision number
- EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
- EFI_ACPI_CREATOR_REVISION // ASL compiler revision number
- },
- 0, // Physical addesss of FACS
- 0x00000010, // Physical address of DSDT
- 0x0, // System Interrupt Model
- 0x4, // PM Profile
- SCI_INT_VECTOR, // System vector of SCI interrupt
- SMI_CMD_IO_PORT, // Port address of SMI command port
- ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI
- ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI
- S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state
- 0, // PState control
- PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk
- PM1b_EVT_BLK, // Port address of Power Mgt 1b Event Reg Blk
- PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk
- PM1b_CNT_BLK, // Port address of Power Mgt 1b Ctrl Reg Blk
- PM2_CNT_BLK, // Port address of Power Mgt 2 Ctrl Reg Blk
- PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk
- GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk
- GPE1_BLK, // Port addr of General Purpose Event 1 Reg Blk
- PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk
- PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk
- PM2_CNT_LEN, // Byte Length of ports at pm2_cnt_blk
- PM_TM_LEN, // Byte Length of ports at pm_tm_blk
- GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk
- GPE1_BLK_LEN, // Byte Length of ports at gpe1_blk
- GPE1_BASE, // offset in gpe model where gpe1 events start
- 0, // _CST support
- P_LVL2_LAT, // worst case HW latency to enter/exit C2 state
- P_LVL3_LAT, // worst case HW latency to enter/exit C3 state
- FLUSH_SIZE, // Size of area read to flush caches
- FLUSH_STRIDE, // Stride used in flushing caches
- DUTY_OFFSET, // bit location of duty cycle field in p_cnt reg
- DUTY_WIDTH, // bit width of duty cycle field in p_cnt reg
- DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM
- MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM
- CENTURY, // index to century in RTC CMOS RAM
- 0x0000, // Boot architecture flag
- 0x00, // reserved
- FLAG,
-
- {
- 0x01, //Space ID
- 0x8, //Bit Width
- 0x0, //Bit Offset
- 0x1, //Encoded Access Width
- 0x0000000000000001,//Address
- },
-
- 0x0, //Value to cause reset
- {0,0,0}, //Reserved
- 0x0000000000000000,//FACS Address
- 0x0000000000000010,//DSDT Address
-
-
- /*PM1A Event Block*/
- 0x1, //Space ID:SystemIO
- 0x20, //Bit Width
- 0x0, //Bit Offset
- 0x2, //Encoded Access Width
- 0x0000000000000001, //Address
-
- /*PM1B Event Block*/
- 0x1, //Space ID:SystemIO
- 0x0, //Bit Width
- 0x0, //Bit Offset
- 0x0, //Encoded Access Width
- 0x0000000000000000, //Address
-
- /*PM1A Control Block*/
- 0x1, //Space ID:SystemIO
- 0x10, //Bit Width
- 0x0, //Bit Offset
- 0x02, //Encoded Access Width
- 0000000000000001, //Address
-
- /*PM1B Control Block*/
- 0x1, //Space ID:SystemIO
- 0x00, //Bit Width
- 0x0, //Bit Offset
- 0x0, //Encoded Access Width
- 0x0000000000000000, //Address
-
- /*PM2 Control Block*/
- 0x1, //Space ID:SystemIO
- 0x08, //Bit Width
- 0x0, //Bit Offset
- 0x0, //Encoded Access Width
- 0x0000000000000001, //Address
-
- /*PM Timer Block*/
- 0x1, //Space ID:SystemIO
- 0x20, //Bit Width
- 0x0, //Bit Offset
- 0x3, //Encoded Access Width
- 0x0000000000000001, //Address
-
- /*GPE0 Block*/
- 0x1, //Space ID:SystemIO
- 0x80, //Bit Width
- 0x0, //Bit Offset
- 0x1, //Encoded Access Width
- 0x0000000000000001, //Address
-
- /*GPE1 Block*/
- 0x1, //Space ID:SystemIO
- 0x00, //Bit Width
- 0x0, //Bit Offset
- 0x0, //Encoded Access Width
- 0x0000000000000000, //Address
-
- /*Sleep Control Register*/
- 0x1, //Space ID:SystemIO
- 0x08, //Bit Width
- 0x0, //Bit Offset
- 0x1, //Encoded Access Width
- 0x0000000000000000, //Address
-
- /*Sleep Status Register*/
- 0x1, //Space ID:SystemIO
- 0x08, //Bit Width
- 0x0, //Bit Offset
- 0x1, //Encoded Access Width
- 0x0000000000000000, //Address
-
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Facp;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facs.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facs.aslc
deleted file mode 100644
index 9bcddeaad..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Facs.aslc
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
- FACS Table
-
- Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
- 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.
-
-**/
-
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-
-EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE Facs = {
- EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE),
-
- //
- // Hardware Signature will be updated at runtime
- //
- 0x00000000, //HardwareSignature
- 0x00, //FirmwareWakingVector
- 0x00, //GlobalLock
- 0x00, //Flags
- 0x0000000000000000, //XFirmwareWakingVector
- 0x02, //Version
- {
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE
- },
- 0x00,
- {
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE
- }
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Facs;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Gtdt.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Gtdt.aslc
deleted file mode 100644
index ab8a60ac0..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Gtdt.aslc
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE Gtdt =
-{
- {
- EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE),
- EFI_ACPI_5_0_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x0000000000000000, //Timer Address
- 0x00000001, //Flags
- 0x00000000, //Secure PL1 Interrupt
- 0x00000000, //SPL1 Flags
- 0x00000000, //Non-Secure PL1 Interrupt
- 0x00000000, //NSPL1 Flags
- 0x00000000, //Virtual Timer Interrupt
- 0x00000000, //VT Flags
- 0x00000000, //Non-Secure PL2 Interrupt
- 0x00000000, //NSPL2 Flags
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Gtdt;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Hest.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Hest.aslc
deleted file mode 100644
index 08092acea..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Hest.aslc
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#pragma pack(1)
-
-typedef struct {
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT32 ErrorEntryCount;
- EFI_ACPI_5_0_GENERIC_HARDWARE_ERROR_SOURCE_STRUCTURE GenHardWareError;
-
-} EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE;
-
-#pragma pack()
-
-EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE Hest = {
- {
- EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE),
- EFI_ACPI_5_0_HARDWARE_ERROR_SOURCE_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x02,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x00000001, //Error Source Count
-{
- 0x0009, //Subtable Type:Generic Hardware Error Source
- 0x0002, //Source Id
- 0xFFFF, //Related Source Id
- 0x00, //Reserved
- 0x01, //Enabled
- 0x00000001, //Records To Preallocate
- 0x00000001, //Max Sections Per Record
- 0x00001000, //Max Raw Data Length
-
- /* Error Status Address : [Generic Address Structure]*/
- {
- 0x00, //Space ID:SystemMemory
- 0x40, //Bit Width
- 0x00, //Bit Offset
- 0x04, //Encoded Access Width
- 0xFFFF0000, //Address
- },
- /*Notify : [Hardware Error Notification Structure]*/
- {
- 0x03, //Notify Type:SCI
- 0x1c, //Notify Length
- 0x0000, //Configuration Write Enable
- 0x00000000, //PollInterval
- 0x00000000, //Vector
- 0x00000000, //Polling Threshold Value
- 0x00000000, //Polling Threshold Window
- 0x00000000, //Error Threshold Value
- 0x00000000, //Error Threshold Window
- },
- 0x00001000, //Error Status Block Length
-},
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Hest;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mcfg.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mcfg.aslc
deleted file mode 100644
index 9451e9c50..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mcfg.aslc
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define ACPI_5_0_MCFG_VERSION 0x1
-
-#pragma pack(1)
-typedef struct
-{
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT64 Reserved1;
- UINT64 ullBaseAddress;
- UINT16 usSegGroupNum;
- UINT8 ucStartBusNum;
- UINT8 ucEndBusNum;
- UINT32 Reserved2;
-}EFI_ACPI_5_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE;
-#pragma pack()
-
-EFI_ACPI_5_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE Mcfg=
-{
- {
- EFI_ACPI_5_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_TABLE),
- ACPI_5_0_MCFG_VERSION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x0000000000000000, //Reserved
- 0x0000000000000000, //Base Address
- 0x0000, //Segment Group Number
- 0x00, //Start Bus Number
- 0x00, //End Bus Number
- 0x00000000, //Reserved
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Mcfg;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mpst.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mpst.aslc
deleted file mode 100644
index dfdda34a5..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Mpst.aslc
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define MAX_POWER_STATES_NUM 0x2
-#define MAX_PHYSICAL_COMPONENTS_NUM 0x3
-#define MAX_MEMORY_POWER_NODE_COUNT 0x2
-#define MAX_CHARACTERISTICS_COUNT 0x2
-
-#pragma pack (1)
-typedef struct
-{
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE structre;
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE state[MAX_POWER_STATES_NUM];
- UINT16 components[MAX_PHYSICAL_COMPONENTS_NUM];
-}EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_EX;
-
-typedef struct
-{
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE structre;
- UINT64 ulResverd;
-}EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_EX;
-
-typedef struct
-{
- EFI_ACPI_5_0_MEMORY_POWER_STATUS_TABLE table;
- EFI_ACPI_5_0_MPST_MEMORY_POWER_NODE_TABLE node;
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STRUCTURE_EX powerNode[MAX_MEMORY_POWER_NODE_COUNT];
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_TABLE Characteristics;
- EFI_ACPI_5_0_MPST_MEMORY_POWER_STATE_CHARACTERISTICS_STRUCTURE_EX powerChar[MAX_CHARACTERISTICS_COUNT];
-}EFI_ACPI_5_0_MEMORY_POWER_STATUS_TABLE_EX;
-#pragma pack ()
-
-
-EFI_ACPI_5_0_MEMORY_POWER_STATUS_TABLE_EX Mpst ={
- {
- {
- EFI_ACPI_5_0_MEMORY_POWER_STATE_TABLE_SIGNATURE,
- 0x000000B6,
- EFI_ACPI_5_0_MEMORY_POWER_STATE_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x00, //Channel ID
- {0,0,0}, //Reserved
-
- },
- 0x0002, //Power Node Count
- {0,0}, //Reserved
- {
- {
- 0x00, //Flags
- 0x00, //Reserved
- 0x0000, //Node ID
- 0x0000000000, //Length
- 0x00000000000000000000, //ange Address
- 0x00000000000000000000, //Range Length
- 0x00000002, // Num Power
- 0x00000003, // Num Physical Components
- {
- {
- 0x00, //Power State
- 0x00, //InfoIndex
- },
- {
- 0x00, //Power State
- 0x00, //InfoIndex
- },
- },
- 0x0000, //Component Id
- 0x0001, //Component Id
- 0x0002, //Component Id
- },
- {
- 0x00, //Flags
- 0x00, //Reserved
- 0x0000, //Node ID
- 0x0000000000, //Length
- 0x00000000000000000000, //ange Address
- 0x00000000000000000000, //Range Length
- 0x00000001, // Num Power
- 0x00000001, // Num Physical Components
- {
- 0x00, //Power State
- 0x00, //InfoIndex
- },
- 0x0000, //Component Id
-
- },
- },
-
- 0x0002, //Characteristics Count
- {0,0}, //Reserved
- {
- {
- 0x01, //Structure ID
- 0x00, //Flags
- 0x0000, //Reserved
- 0x00000000, //Average Power
- 0x00000000, //Power Saving
- 0x0000000000000000, //Exit Latency
- 0x0000000000000000, //Reserved
- },
- {
- 0x01, //Structure ID
- 0x00, //Flags
- 0x0000, //Reserved
- 0x00000000, //Average Power
- 0x00000000, //Power Saving
- 0x0000000000000000, //Exit Latency
- 0x0000000000000000, //Reserved
- },
- },
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Mpst;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Msct.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Msct.aslc
deleted file mode 100644
index 80c9d59b4..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Msct.aslc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE_REVISION 0x1
-//
-// MSCT Table definition
-//
-#pragma pack (1)
-typedef struct {
- UINT8 Revision;
- UINT8 Length;
- UINT32 ProxDomRangeLow;
- UINT32 ProxDomRangeHigh;
- UINT32 MaxProcessorCapacity;
- UINT64 MaxMemoryCapacity;
-} EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE;
-
-typedef struct {
- EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_HEADER Header;
- EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE ProxDomInfoStructure[4];
-} EFI_ACPI_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE;
-
-#pragma pack ()
-
-EFI_ACPI_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE Msct = {
- {
- {
- EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE),
- EFI_ACPI_5_0_MAXIMUM_SYSTEM_CHARACTERISTICS_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- //
- // Beginning of MSCT specific fields
- //
- 0x00000038, // OffsetProxDomInfo
- 4 - 1, // MaxNumProxDom
- 0x00000000, // MaxNumClockDom
- 0x00000FFFFFFFFFFF, // MaxPhysicalAddress
- },
- {
- {
- EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE_REVISION, // Revision
- sizeof (EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE), // Length
- 0x00000000, // ProxDomRangeLow
- 0x00000003, // ProxDomRangeHigh
- 0x00000010, // MaxProcessorCapacity
- 0x0000004000000000 // MaxMemoryCapacity
- },
- {
- EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE_REVISION, // Revision
- sizeof (EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE), // Length
- 0x00000000, // ProxDomRangeLow
- 0x00000000, // ProxDomRangeHigh
- 0x00000000, // MaxProcessorCapacity
- 0x0000000000000000, // MaxMemoryCapacity
- },
-
- {
- EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE_REVISION, // Revision
- sizeof (EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE), // Length
- 0x00000000, // ProxDomRangeLow
- 0x00000000, // ProxDomRangeHigh
- 0x00000000, // MaxProcessorCapacity
- 0x0000000000000000, // MaxMemoryCapacity
- },
-
- {
- EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE_REVISION, // Revision
- sizeof (EFI_ACPI_MAXIMUM_PROXIMITY_DOMAIN_INFORMATION_STRUCTURE), // Length
- 0x00000000, // ProxDomRangeLow
- 0x00000000, // ProxDomRangeHigh
- 0x00000000, // MaxProcessorCapacity
- 0x0000000000000000, // MaxMemoryCapacity
- },
- },
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Msct;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Oem0.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Oem0.aslc
deleted file mode 100644
index 2e84daf4a..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Oem0.aslc
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define EFI_ACPI_5_0_OEM0_SIGNATURE SIGNATURE_32('O', 'E', 'M', '0')
-#define ACPI_5_0_OEM0_REVISION 0x1
-
-typedef struct{
- EFI_ACPI_DESCRIPTION_HEADER Header;
-}EFI_ACPI_5_0_OEM0_TABLE;
-
-EFI_ACPI_5_0_OEM0_TABLE Oem0=
-{
- {
- EFI_ACPI_5_0_OEM0_SIGNATURE,
- sizeof (EFI_ACPI_5_0_OEM0_TABLE),
- ACPI_5_0_OEM0_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x0000000A,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Oem0;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Platform.h b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Platform.h
deleted file mode 100644
index 147d3324e..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Platform.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/** @file
- Platform specific defines for constructing ACPI tables
-
- Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
- 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.
-
-**/
-
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#ifndef _Platform_h_INCLUDED_
-#define _Platform_h_INCLUDED_
-
-#include <PiDxe.h>
-#include <IndustryStandard/Acpi.h>
-
-//
-// ACPI table information used to initialize tables.RTSMVEV8
-//
-#define EFI_ACPI_OEM_ID 'L','I','N','A','R','O' // OEMID 6 bytes long
-#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('R','T','S','M','V','E','V','8' ) // OEM table id 8 bytes long
-#define EFI_ACPI_OEM_REVISION 0x00000001
-#define EFI_ACPI_CREATOR_ID SIGNATURE_32('I','N','T','L')
-#define EFI_ACPI_CREATOR_REVISION 0x20130517
-
-#define INT_MODEL 0x01
-#define SCI_INT_VECTOR 0x0
-#define SMI_CMD_IO_PORT 0x0
-#define ACPI_ENABLE 0x0
-#define ACPI_DISABLE 0x0
-#define S4BIOS_REQ 0x00
-#define PM1a_EVT_BLK 0x00000001
-#define PM1b_EVT_BLK 0x00000000
-#define PM1a_CNT_BLK 0x00000001
-#define PM1b_CNT_BLK 0x00000000
-#define PM2_CNT_BLK 0x00000001
-#define PM_TMR_BLK 0x00000001
-#define GPE0_BLK 0x00000001
-#define GPE1_BLK 0x00000000
-#define PM1_EVT_LEN 0x04
-#define PM1_CNT_LEN 0x02
-#define PM2_CNT_LEN 0x01
-#define PM_TM_LEN 0x04
-#define GPE0_BLK_LEN 0x08
-#define GPE1_BLK_LEN 0x00
-#define GPE1_BASE 0x00
-#define RESERVED 0x00
-#define P_LVL2_LAT 0x0000
-#define P_LVL3_LAT 0x0000
-#define FLUSH_SIZE 0x0000
-#define FLUSH_STRIDE 0x0000
-#define DUTY_OFFSET 0x00
-#define DUTY_WIDTH 0x00
-#define DAY_ALRM 0x00
-#define MON_ALRM 0x00
-#define CENTURY 0x00
-#define FLAG 0x00321033
-#endif
-
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Pmtt.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Pmtt.aslc
deleted file mode 100644
index f0b4f6cfe..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Pmtt.aslc
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define EFI_ACPI_MEMORY_AGGREGATOR_TYPE_SOCKET 00 //socket
-#define EFI_ACPI_MEMORY_AGGREGATOR_TYPE_MEMCTRL 01 //Memory Controller
-#define EFI_ACPI_MEMORY_AGGREGATOR_TYPE_DIMM 02 //DIMM
-#define EFI_ACPI_MEMORY_AGGREGATOR_TYPE_RESVERVED 03 //RESVERVED
-
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG_TLAD 01
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG_PHYELEMENT 02 // BIT1 - set to 1 since socket is a physical element of the topology
-//Bit 2 and 3 - If 00, indicates that all components aggregated by this device implements volatile memory
-// If 01, indicates that components aggregated by this device implements both volatile and non-volatile memory
-// If 10, indicates that all components aggregated by this device implements non-volatile memory
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG__VOLATILE 00
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG__MIXED 4
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG__NONVOLATILE 0x08
-#define EFI_ACPI_MEMORY_AGGREGATOR_FLAG__RSVD 0x0C
-
-#define MAXNUMBER_OF_PROXIMITY_DOMAINS 0x3
-
-#define MAX_SOCKET 0x2
-#define NUM_MEM_CONTROLLERS 0x2
-#define MAX_DIMM 0x02
-
-#pragma pack (1)
-// PMMT Table fields
-typedef struct {
- UINT32 ReadLatency;
- UINT32 WriteLatency;
- UINT32 ReadBW;
- UINT32 WriteBW;
- UINT16 OptimalAccUnit;
- UINT16 OptimalAccAlignment;
-} EFI_ACPI_MEMCTRL_CHAR_TABLE;
-
-typedef struct {
- UINT8 Type;
- UINT8 Rsvd;
- UINT16 Length;
- UINT16 Flag;
- UINT16 Rsvd1;
- UINT16 PhyCompIdentifier;
- UINT16 Rsvd2;
- UINT32 Size;
- UINT32 SmBiosHandle;
-} EFI_ACPI_MEMORY_AGGREGATOR_DIMM_STRUC;
-
-typedef struct {
- UINT8 Type;
- UINT8 Rsvd;
- UINT16 Length;
- UINT16 Flag;
- UINT16 Rsvd1;
- EFI_ACPI_MEMCTRL_CHAR_TABLE MemCtrlCharTable;
- UINT16 Rsvd2;
- UINT16 NumProxDomains;
- UINT32 ProxDomain[MAXNUMBER_OF_PROXIMITY_DOMAINS];
- EFI_ACPI_MEMORY_AGGREGATOR_DIMM_STRUC PhyCompIdentStruc[MAX_DIMM];
-} EFI_ACPI_MEMORY_AGGREGATOR_MEMCTRL_STRUC;
-
-typedef struct {
- UINT8 Type;
- UINT8 Rsvd;
- UINT16 Length;
- UINT16 Flag;
- UINT16 Rsvd1;
- UINT16 SckIdent;
- UINT16 Rsvd2;
- EFI_ACPI_MEMORY_AGGREGATOR_MEMCTRL_STRUC MemCtrlStruc[NUM_MEM_CONTROLLERS];
-} EFI_ACPI_MEMORY_AGGREGATOR_SOCKET_STRUC;
-
-typedef struct {
- EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE Header;
- EFI_ACPI_MEMORY_AGGREGATOR_SOCKET_STRUC TopLevelmemAggrDevStruc[MAX_SOCKET];
-} EFI_ACPI_5_0_PLATFORM_MEMORY_TOPOLOGY_TABLE;
-#pragma pack ()
-
-
-EFI_ACPI_5_0_PLATFORM_MEMORY_TOPOLOGY_TABLE Pmtt = {
- {
- {
- EFI_ACPI_5_0_PLATFORM_MEMORY_TOPOLOGY_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_PLATFORM_MEMORY_TOPOLOGY_TABLE), // Length
- EFI_ACPI_5_0_MEMORY_TOPOLOGY_TABLE_REVISION, // Revision
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- EFI_ACPI_RESERVED_DWORD, // Reserved[0]
- },
- {
- /*Socket 0*/
- {
- 0x00, //Subtable Type:Socket
- 0x00, //Reserved
- 0x0080, //Length
- 0x0001, //Flags
- 0x0000, //Reserved
- 0x0000, //Socket ID
- 0x0000, //Reserved
- {
- /*Memory Controller 1*/
-
- {
- 0x01, //Subtable Type:Memory Controller
- 0x00, //Reserved
- 0x0054, //Length
- 0x0005, //Flags
- 0x0000, //Reserved
- {
- 0x00000000, //Read Latency
- 0x00000000, //Write Latency
- 0x00000000, //Read Bandwidth
- 0x00000000, //Write Bandwidth
- 0x0000, //Access Width
- 0x0000, //Alignment
- },
- 0x0000, //Reserved
- MAXNUMBER_OF_PROXIMITY_DOMAINS, //Domain Count
- 0x00000000, //Proximity Domain
- 0x00000000, //Proximity Domain
- 0x00000000, //Proximity Domain
- {
- /*DIMM 0*/
- {
- 0x02, //Subtable Type:Physical Component (DIMM)
- 0x00, //Reserved
- 0x0014, //Length
- 0x0002, //Flags
- 0x0000, //Reserved
- 0x0000, //Component ID
- 0x0000, //Reserved
- 0x00000000, //Memory Size
- 0x00000000, //Bios Handle
- },
- /*DIMM 1*/
- {
- 0x02, //Subtable Type:Physical Component (DIMM)
- 0x00, //Reserved
- 0x0014, //Length
- 0x0002, //Flags
- 0x0000, //Reserved
- 0x0000, //Component ID
- 0x0000, //Reserved
- 0x00000000, //Memory Size
- 0x00000000, //Bios Handle
- },
- },
- },
-
- /*Memory Controller 2*/
- {
- 0x01, //Subtable Type:Memory Controller
- 0x00, //Reserved
- 0x0020, //Length
- 0x0001, //Flags
- 0x0000, //Reserved
- {
- 0x00000000, //Read Latency
- 0x00000000, //Write Latency
- 0x00000000, //Read Bandwidth
- 0x00000000, //Write Bandwidth
- 0x0000, //Access Width
- 0x0000 //Alignment
- },
- 0x0000, //Reserved
- 0x0000, //Domain Count
- {0},
- {0},
-
- },
- },
- },
-
-
- /*Socket 1*/
- {
- 0x00, //Subtable Type:Socket
- 0x00, //Reserved
- 0x000c, //Length
- 0x0001, //Flags
- 0x0000, //Reserved
- 0x0000, //Socket ID
- 0x0000 //Reserved
- },
- },
-
-
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Pmtt;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Slit.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Slit.aslc
deleted file mode 100644
index 05d96e029..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Slit.aslc
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT 0x0000000000000014
-
-#pragma pack(1)
-typedef struct {
- UINT8 Entry[EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT];
-} EFI_ACPI_5_0_NUMBER_OF_SYSTEM_LOCALITIES_STRUCTURE;
-
-typedef struct {
- EFI_ACPI_5_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER Header;
- EFI_ACPI_5_0_NUMBER_OF_SYSTEM_LOCALITIES_STRUCTURE NumSlit[EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT];
-
-} EFI_ACPI_5_0_SYSTEM_LOCALITY_INFORMATION_TABLE;
-#pragma pack()
-
-//
-// System Locality Information Table
-// Please modify all values in Slit.h only.
-//
-EFI_ACPI_5_0_SYSTEM_LOCALITY_INFORMATION_TABLE Slit = {
- {
- {
- EFI_ACPI_5_0_SYSTEM_LOCALITY_INFORMATION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_SYSTEM_LOCALITY_INFORMATION_TABLE),
- EFI_ACPI_5_0_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION,
- },
- //
- // Beginning of SLIT specific fields
- //
- EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT,
- },
- {
- {0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27}, //Locality 0
- {0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,}, //Locality 1
- {0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,}, //Locality 2
- {0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24,}, //Locality 3
- {0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23,}, //Locality 4
- {0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22,}, //Locality 5
- {0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21,}, //Locality 6
- {0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20,}, //Locality 7
- {0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,}, //Locality 8
- {0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E,}, //Locality 9
- {0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D,}, //Locality 10
- {0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C,}, //Locality 11
- {0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B,}, //Locality 12
- {0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A,}, //Locality 13
- {0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17, 0x18, 0x19,}, //Locality 14
- {0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16, 0x17, 0x18,}, //Locality 15
- {0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10, 0x16, 0x17,}, //Locality 16
- {0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A, 0x15, 0x16,}, //Locality 17
- {0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x15, 0x0A, 0x10,}, //Locality 18
- {0x27, 0x26, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, 0x17, 0x16, 0x10, 0x0A,}, //Locality 19
- },
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Slit;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Spmi.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Spmi.aslc
deleted file mode 100644
index 77836a471..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Spmi.aslc
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-#define ACPI_5_0_SPMI_REVISION 0x4
-
-#pragma pack(1)
-typedef struct
-{
-
- EFI_ACPI_DESCRIPTION_HEADER Header;
- UINT8 ucInterfaceType;
- UINT8 Reserved;
- UINT16 usIPMISpecVersion;
- UINT8 ucInterruptType;
- UINT8 ucGPENumber;
- UINT8 Reserved2;
- UINT8 ucPCIDeviceFlag;
- UINT32 uwInterrupt;
- EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE IPMIRegister;
- UINT8 ucPCISegment;
- UINT8 ucPCIBus;
- UINT8 ucPCIDevice;
- UINT8 ucPCIFunction;
- UINT8 Reserved3;
-}EFI_ACPI_5_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE;
-#pragma pack()
-
-EFI_ACPI_5_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE Spmi =
-{
- {
- EFI_ACPI_5_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_SERVER_PLATFORM_MANAGEMENT_INTERFACE_TABLE),
- ACPI_5_0_SPMI_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- 0x00,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- 0x00, //Interface Type
- 0x00, //Reserved
- 0x0000, //IPMI Spec Version
- 0x00, //Interrupt Type
- 0x00, //GPE Number
- 0x00, //Reserved
- 0x00, //PCI Device Flag
- 0x00000000, //Interrupt
- {
- 0x00, //Space ID:SystemMemory
- 0x08, //Bit Width
- 0x00, //Bit Offset
- 0x01, //Encoded Access Width
- 0x0000000000000000, //Address
- },
- 0x00, //PCI Segment
- 0x00, //PCI Bus
- 0x00, //PCI Device
- 0x00, //PCI Function
- 0x00, //Reserved
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
-
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Spmi;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Srat.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Srat.aslc
deleted file mode 100644
index d5c433ffc..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Srat.aslc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-
-//
-// Define the number of each table type.
-// This is where the table layout is modified.
-//
-#define EFI_ACPI_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE_COUNT 4
-#define EFI_ACPI_MEMORY_AFFINITY_STRUCTURE_COUNT 4
-
-
-#pragma pack(1)
-typedef struct {
- EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER Header;
- EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE Apic;
- EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE Memory;
- EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE x2APIC;
-} EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE;
-
-#pragma pack()
-
-
-//
-// Static Resource Affinity Table definition
-//
-EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE Srat = {
- {
- EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE),
- EFI_ACPI_5_0_SYSTEM_RESOURCE_AFFINITY_TABLE_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION,
- /*Reserved*/
- 0x00000001, // Reserved to be 1 for backward compatibility
- EFI_ACPI_RESERVED_QWORD
- },
- /**/
- {
- 0x00, // Subtable Type:Processor Local APIC/SAPIC Affinity
- sizeof(EFI_ACPI_5_0_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE), //Length
- 0x00, //Proximity Domain Low(8)
- 0x00, //Apic ID
- 0x00000001, //Flags
- 0x00, //Local Sapic EID
- {0,0,0}, //Proximity Domain High(24)
- 0x00000000, //ClockDomain
- },
- //
- //
- // Memory Affinity
- //
- {
- 0x01, // Subtable Type:Memory Affinity
- sizeof (EFI_ACPI_5_0_MEMORY_AFFINITY_STRUCTURE), // Length
- 0x00000000, // Proximity Domain
- EFI_ACPI_RESERVED_WORD, // Reserved
- 0x00000000, // Address Base Low
- 0x00000000, // Address Base High
- 0x0009FC00, // Length Low
- 0x00000000, // Length High
- EFI_ACPI_RESERVED_DWORD, // Reserved
- 0x00000001, // Flags disabled, until enabled by Platform driver
- EFI_ACPI_RESERVED_QWORD , // Reserved
- },
-
- /*Processor Local x2APIC Affinity*/
- {
- 0x02, // Subtable Type:Processor Local x2APIC Affinity
- sizeof(EFI_ACPI_5_0_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE),
- {0,0}, //Reserved1
- 0x00000000, //Proximity Domain
- 0x00000000, //Apic ID
- 0x00000001, //Flags
- 0x00000000, //Clock Domain
- {0,0,0,0}, //Reserved2
- },
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Srat;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ssdt0.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ssdt0.asl
deleted file mode 100644
index c13ceef56..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Ssdt0.asl
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
- *
- * [SSDT] Description of the armv8 VE Model
- *
- * This source is released under the terms of the GPLv2.
- */
-
-DefinitionBlock (
- "ssdt0.aml", // output filename
- "SSDT", // table signature
- 2, // SSDT compliance revision
- "LINARO", // OEM ID
- "RTSMVEV8", // table ID
- 0x00000001) // OEM revision
-{
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Uefi.aslc b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Uefi.aslc
deleted file mode 100644
index c3bbce3ed..000000000
--- a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/Uefi.aslc
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2013 Linaro Limited
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the BSD License which accompanies
- * this distribution, and is available at
- * http://opensource.org/licenses/bsd-license.php
- *
- * Contributors:
- * Yi Li - yi.li@linaro.org
-*/
-
-#include <IndustryStandard/Acpi.h>
-#include <Platform.h>
-
-
-#define ACPI_5_0_UEFI_REVISION 0x1
-
-#pragma pack(1)
-
-typedef struct
-{
- EFI_ACPI_DESCRIPTION_HEADER Header;
- EFI_GUID guid;
- UINT16 usDataOffset;
-}EFI_ACPI_5_0_UEFI_TABLE;
-#pragma pack()
-
-EFI_ACPI_5_0_UEFI_TABLE Uefi=
-{
- {
- EFI_ACPI_5_0_UEFI_ACPI_DATA_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_5_0_UEFI_TABLE),
- ACPI_5_0_UEFI_REVISION,
- 0x00, // Checksum will be updated at runtime
- {EFI_ACPI_OEM_ID},
- EFI_ACPI_OEM_TABLE_ID,
- EFI_ACPI_OEM_REVISION,
- EFI_ACPI_CREATOR_ID,
- EFI_ACPI_CREATOR_REVISION
- },
- //03020100-0504-0706-0809-0A0B0C0D0E0F
- { 0x03020100, 0x0504, 0x0706, { 0x08, 0x09, 0x0A, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f } },
- 0x0036 //Data Offset
-};
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from removing the
- // data structure from the exeutable
- //
- return (VOID*)&Uefi;
-}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/apic.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/apic.asl
new file mode 100644
index 000000000..81351c3cc
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/apic.asl
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [APIC] Multiple APIC Description Table (MADT)
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "APIC"
+[0004] Table Length : 000000F6
+[0001] Revision : 03
+[0001] Checksum : B0
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20110623
+
+[0004] Local Apic Address : 2C000000
+[0004] Flags (decoded below) : 00000001
+ PC-AT Compatibility : 0
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000000 /* Should be equal to FDT provided or CPU hardware ID */
+[0004] Processor UID : 00000000
+[0004] Flags (decoded below) : 00000001
+ Processor Enabled : 1
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000 /* armv8 FVP Base GIC address */
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000001
+[0004] Processor UID : 00000001
+[0004] Flags (decoded below) : 00000001
+ Processor Enabled : 1
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000002
+[0004] Processor UID : 00000002
+[0004] Flags (decoded below) : 00000001
+ Processor Enabled : 1
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000003
+[0004] Processor UID : 00000003
+[0004] Flags (decoded below) : 00000001
+ Processor Enabled : 1
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000004
+[0004] Processor UID : 00000004
+[0004] Flags (decoded below) : 00000000
+ Processor Enabled : 0
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000005
+[0004] Processor UID : 00000005
+[0004] Flags (decoded below) : 00000000
+ Processor Enabled : 0
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000006
+[0004] Processor UID : 00000006
+[0004] Flags (decoded below) : 00000000
+ Processor Enabled : 0
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0B [Generic Interrupt Controller]
+[0001] Length : 28
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000007
+[0004] Processor UID : 00000007
+[0004] Flags (decoded below) : 00000000
+ Processor Enabled : 0
+[0004] Parking Protocol Version : 00000000
+[0004] Performance Interrupt : 00000000
+[0008] Parked Address : 0000000000000000
+[0008] Base Address : 000000002C000000
+
+[0001] Subtable Type : 0C [Generic Interrupt Distributor]
+[0001] Length : 18
+[0002] Reserved : 0000
+[0004] Local GIC Hardware ID : 00000000
+[0008] Base Address : 000000002F000000 /* armv8 FVP Base GIC distributor base addr */
+[0004] Interrupt Base : 00000000
+[0004] Reserved : 00000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/bert.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/bert.asl
new file mode 100644
index 000000000..1b9f3d61c
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/bert.asl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [BERT] Boot Error Record Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "BERT"
+[0004] Table Length : 00000030
+[0001] Revision : 01
+[0001] Checksum : 15
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000002
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Boot Error Region Length : 0x9D
+[0008] Boot Error Region Address : 0xFFFF0008
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/cpep.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/cpep.asl
new file mode 100644
index 000000000..c84d07d4e
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/cpep.asl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [CPEP] Corrected Platform Error Polling Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "CPEP"
+[0004] Table Length : 00000034
+[0001] Revision : 01
+[0001] Checksum : 0F
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000000
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0008] Reserved : 0000000000000000
+
+[0001] Subtable Type : 00
+[0001] Length : 08
+[0001] Processor ID : 00
+[0001] Processor EID : 00
+[0004] Polling Interval : 00000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/dsdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/dsdt.asl
new file mode 100644
index 000000000..43ac1706c
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/dsdt.asl
@@ -0,0 +1,758 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [DSDT] Description of the armv8 VE Model
+ *
+ */
+
+DefinitionBlock (
+ "dsdt.aml", // output filename
+ "DSDT", // table signature
+ 2, // DSDT compliance revision
+ "LINARO", // OEM ID
+ "RTSMVEV8", // table ID
+ 0x00000004) // OEM revision
+{
+ Scope (\_SB)
+ {
+ Method (_OSC, 4, NotSerialized)
+ {
+ /* Platform-Wide OSPM Capabilities */
+ If(LEqual(Arg0,ToUUID("0811B06E-4A27-44F9-8D60-3CBBC22E7B48")))
+ {
+ /* APEI support unconditionally */
+ Return (Arg3)
+ } Else {
+ CreateDWordField (Arg3, Zero, CDW1)
+ /* Set invalid UUID error bit */
+ Or (CDW1, 0x04, CDW1)
+ Return (Arg3)
+ }
+ }
+
+ Device (HED)
+ {
+ Name (_HID, EisaId ("PNP0C33"))
+ Name (_UID, 0x00)
+ }
+
+ Device (SCK0)
+ {
+ Name (_HID, "ACPI0004")
+ Name (_UID, 0x00)
+ Method (_STA, 0, NotSerialized)
+ {
+ Return (0x0F)
+ }
+
+ Device (PRC0)
+ {
+ Name (_HID, "ACPI0007")
+ Name (_UID, 0x00)
+
+ /* CPU0 will be always present */
+ Method (_STA, 0, NotSerialized)
+ {
+ Return (0x0F)
+ }
+
+ Name (MAT0, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* type, len, reserved, gic_id */
+ /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* uid, flags */
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* parking_version, performance_interrupt */
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* parked_address */
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* base_address */
+ })
+
+ Name (MAT1, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Method (_MAT, 0, NotSerialized)
+ {
+ If (_STA())
+ {
+ Return (MAT0)
+ }
+ Else
+ {
+ Return (MAT1)
+ }
+ }
+ }
+
+ Device (PRC1)
+ {
+ Name (_HID, "ACPI0007")
+ Name (_UID, 0x01)
+
+ Name (STA1, 0x0F)
+ Method (_STA, 0, NotSerialized)
+ {
+ Return (STA1)
+ }
+
+ Method (_EJ0, 1, NotSerialized)
+ {
+ If (LEqual (STA1, 0x0F))
+ {
+ Store (0x00, STA1)
+ }
+ }
+
+ Name (MAT0, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Name (MAT1, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Method (_MAT, 0, NotSerialized)
+ {
+ If (_STA())
+ {
+ Return (MAT0)
+ }
+ Else
+ {
+ Return (MAT1)
+ }
+ }
+ }
+
+ Device (PRC2)
+ {
+ Name (_HID, "ACPI0007")
+ Name (_UID, 0x02)
+
+ Name (STA2, 0x0F)
+ Method (_STA, 0, NotSerialized)
+ {
+ Return (STA2)
+ }
+
+ Method (_EJ0, 1, NotSerialized)
+ {
+ If (LEqual (STA2, 0x0F))
+ {
+ Store (0x00, STA2)
+ }
+ }
+
+ Name (MAT0, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Name (MAT1, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Method (_MAT, 0, NotSerialized)
+ {
+ If (_STA())
+ {
+ Return (MAT0)
+ }
+ Else
+ {
+ Return (MAT1)
+ }
+ }
+ }
+
+ Device (PRC3)
+ {
+ Name (_HID, "ACPI0007")
+ Name (_UID, 0x03)
+
+ Name (STA3, 0x0F)
+ Method (_STA, 0, NotSerialized)
+ {
+ Return (STA3)
+ }
+
+ Method (_EJ0, 1, NotSerialized)
+ {
+ If (LEqual (STA3, 0x0F))
+ {
+ Store (0x00, STA3)
+ }
+ }
+
+ Name (MAT0, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Name (MAT1, Buffer (0x28)
+ {
+ /* 0000 */ 0x0B, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ /* 0008 */ 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+ /* 0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0018 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ /* 0020 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ })
+
+ Method (_MAT, 0, NotSerialized)
+ {
+ If (_STA())
+ {
+ Return (MAT0)
+ }
+ Else
+ {
+ Return (MAT1)
+ }
+ }
+ }
+ }
+
+ Device (PMU0) {
+ Name (_HID, "LNRO0007")
+ Name (_UID, 0)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, , , ) {92, 93, 94, 95}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (SMB) {
+ Name (_HID, "ACPI0004")
+ Name (_UID, 0)
+
+ Name (_CRS, ResourceTemplate () {
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x08000000, // Address Range Minimum (base address in FDT)
+ 0x0BFFFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x14000000, // Address Range Minimum (base address in FDT)
+ 0x17FFFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x18000000, // Address Range Minimum (base address in FDT)
+ 0x1BFFFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x1C000000, // Address Range Minimum (base address in FDT)
+ 0x1FFFFFFF, // Address Range Maximum (base + (len -1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x0C000000, // Address Range Minimum (base address in FDT)
+ 0x0FFFFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x10000000, // Address Range Minimum (base address in FDT)
+ 0x13FFFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x04000000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+
+ })
+
+ Device (NET0) {
+ Name (_HID, "LNRO0003")
+ Name (_UID, 0)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1a000000, 0x00010000)
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, , , ) {0x2F}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (CLK0) {
+ Name (_HID, "LNRO0008")
+ Name (_UID, 0)
+
+ Method (FREQ, 0x0, NotSerialized) {
+ Return (24000000)
+ }
+ }
+
+ Device (CLK1) {
+ Name (_HID, "LNRO0008")
+ Name (_UID, 1)
+
+ Method (FREQ, 0x0, NotSerialized) {
+ Return (1000000)
+ }
+ }
+
+ Device (CLK2) {
+ Name (_HID, "LNRO0008")
+ Name (_UID, 2)
+
+ Method (FREQ, 0x0, NotSerialized) {
+ Return (32768)
+ }
+ }
+
+ Device (FPGA) {
+ Name (_HID, "ACPI0004")
+ Name (_UID, 0)
+
+ Name (_CRS, ResourceTemplate () {
+
+ DWordMemory (ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
+ 0x00000000, // Address Space Granularity
+ 0x1C000000, // Address Range Minimum (base address in FDT)
+ 0x1C1FFFFF, // Address Range Maximum (base + (len-1))
+ 0x00000000, // Address Translation Offset
+ 0x00200000, // Address Length (len in FDT)
+ ,, , AddressRangeMemory, TypeStatic)
+ })
+
+ Device (SREG) {
+ Name (_HID, "LNRO0009")
+ Name (_UID, 0)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c010000, 0x1000)
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (VIRT) {
+ Name (_HID, "LNRO0005")
+ Name (_UID, 0)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c130000, 0x1000)
+ Interrupt (ResourceConsumer, Level, ActiveHigh, Exclusive, , , ) {0x4A}
+ })
+ Return (RBUF)
+ }
+ }
+ } // End of FPGA
+ } // End SMB
+
+ Method (DTGP, 5, NotSerialized)
+ {
+ If (LEqual (Arg0, Buffer (0x10)
+ {
+ /* UUID: a706b112-bf0b-48d2-9fa3-95591a3c4c06 */
+ /* 0000 */ 0xa7, 0x06, 0xb1, 0x12, 0xbf, 0x0b, 0x48, 0xd2,
+ /* 0008 */ 0x9f, 0xa3, 0x95, 0x59, 0x1a, 0x3c, 0x4c, 0x06
+ }))
+ {
+ If (LEqual (Arg1, 0x01)) {
+ If (LEqual (Arg2, 0x00)) {
+ Store (Buffer (0x01)
+ {
+ 0x03
+ }, Arg4)
+ Return (0x01)
+ }
+
+ If (LEqual (Arg2, 0x01)) {
+ Return (0x01)
+ }
+ }
+ }
+
+ Store (Buffer (0x01)
+ {
+ 0x00
+ }, Arg4)
+
+ Return (0x00)
+ }
+
+ Device (REG0) {
+ Name (_HID, "LNRO0019")
+ Name (_UID, 0)
+
+ Method(_DSM, 4, NotSerialized) {
+ Store (Package (8)
+ {
+ "regulator-name", "3V3",
+ "regulator-min-microvolt", "3300000",
+ "regulator-max-microvolt", "3300000",
+ "regulator-always-on", "1",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (FLH0) {
+ Name (_HID, "LNRO0015")
+ Name (_UID, 0)
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x08000000, 0x04000000)
+ Memory32Fixed (ReadWrite, 0x0C000000, 0x04000000)
+ })
+ Return (RBUF)
+ }
+
+ Method(_DSM, 4, NotSerialized) {
+ Store (Package ()
+ {
+ "bank-width", "4",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (AMBA) {
+ Name (_HID, "AMBA0000")
+ Name (_UID, 0)
+
+ /* Define 'apb_pclk' as a default clock source since it is
+ common with devices below */
+
+ Method(_DSM, 4, NotSerialized) {
+ Store (Package (2)
+ {
+ "clock-name", "apb_pclk \\_SB.SMB.CLK0",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+
+ Device (SCT0) {
+ Name (_HID, "LNRO000C")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c020000) /* SYSCTL */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c020000, 0x00001000)
+ })
+ Return (RBUF)
+ }
+ Method(_DSM, 4, Serialized) {
+ Store (Package (4)
+ {
+ "clock-name", "refclk \\_SB.SMB.CLK2",
+ "clock-name", "timclk \\_SB.SMB.CLK1",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (AAC0) {
+ Name (_HID, "LNRO000D")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c040000) /* AACI */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c040000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {43}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (MMC0) {
+ Name (_HID, "LNRO000E")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c050000) /* MMCI */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c050000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {41, 42}
+ })
+ Return (RBUF)
+ }
+ Method(_DSM, 4, Serialized) {
+ Store (Package (2)
+ {
+ "clock-name", "MCLK \\_SB.SMB.CLK0",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (KMI0) {
+ Name (_HID, "LNRO000F")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c060000)
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c060000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {44}
+ })
+ Return (RBUF)
+ }
+ Method(_DSM, 4, Serialized) {
+ Store (Package (2)
+ {
+ "clock-name", "KMIREFCLK \\_SB.SMB.CLK0",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (KMI1) {
+ Name (_HID, "LNRO000F")
+ Name (_UID, 1)
+ Name (_ADR, 0x1c070000)
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c070000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {45}
+ })
+ Return (RBUF)
+ }
+ Method(_DSM, 4, NotSerialized) {
+ Store (Package (2)
+ {
+ "clock-name", "KMIREFCLK \\_SB.SMB.CLK0",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ Device (SER0) {
+ Name (_HID, "LNRO000A")
+ Name (_ADR, 0x1c090000)
+ Name (_UID, 0)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c090000, 0x1000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x25}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (SER1) {
+ Name (_HID, "LNRO000A")
+ Name (_ADR, 0x1c0a0000)
+ Name (_UID, 1)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c0a0000, 0x1000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x26}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (SER2) {
+ Name (_HID, "LNRO000A")
+ Name (_ADR, 0x1c0b0000)
+ Name (_UID, 2)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c0b0000, 0x1000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x27}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (SER3) {
+ Name (_HID, "LNRO000A")
+ Name (_ADR, 0x1c0c0000)
+ Name (_UID, 3)
+
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate() {
+ Memory32Fixed (ReadWrite, 0x1c0c0000, 0x1000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth, Exclusive, , , ) {0x28}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (WDT0) {
+ Name (_HID, "LNRO0011")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c0f0000) /* WDT */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c0f0000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {32}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (TIM0) {
+ Name (_HID, "LNRO0012")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c110000) /* TIMER01 */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c110000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {34}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (TIM2) {
+ Name (_HID, "LNRO0012")
+ Name (_UID, 1)
+ Name (_ADR, 0x1c120000) /* TIMER23 */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c120000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {35}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (RTC0) {
+ Name (_HID, "LNRO0013")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c170000) /* RTC */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c170000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {36}
+ })
+ Return (RBUF)
+ }
+ }
+
+ Device (CLCD) {
+ Name (_HID, "LNRO0014")
+ Name (_UID, 0)
+ Name (_ADR, 0x1c1f0000) /* CLCD */
+ Method (_CRS, 0x0, Serialized) {
+ Name (RBUF, ResourceTemplate () {
+ Memory32Fixed (ReadWrite, 0x1c1f0000, 0x00001000)
+ Interrupt (ResourceConsumer, Edge, ActiveBoth,
+ Exclusive, , , ) {46}
+ })
+ Return (RBUF)
+ }
+ Method(_DSM, 4, Serialized) {
+ Store (Package (2)
+ {
+ "clock-name", "CCLDCLK \\_SB.SMB.CLK0",
+ }, Local0)
+
+ DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
+
+ Return (Local0)
+ }
+ }
+
+ } // End of AMBA
+ }
+}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ecdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ecdt.asl
new file mode 100644
index 000000000..2eb0acf92
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ecdt.asl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [ECDT] Embedded Controller Boot Resources Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "ECDT"
+[0004] Table Length : 00000042
+[0001] Revision : 01
+[0001] Checksum : 2D
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+
+[0012] Command/Status Register : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000066
+
+[0012] Data Register : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000062
+
+[0004] UID : 00000000
+[0001] GPE Number : 09
+[0001] Namepath : ""
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/einj.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/einj.asl
new file mode 100644
index 000000000..63044fc25
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/einj.asl
@@ -0,0 +1,178 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [EINJ] Error Injection Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "EINJ"
+[0004] Table Length : 00000130
+[0001] Revision : 01
+[0001] Checksum : 09
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000003
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Injection Header Length : 00000030
+[0001] Flags : 00
+[0003] Reserved : 000000
+[0004] Injection Entry Count : 00000008
+
+[0001] Action : 00 [Begin Operation]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0200
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 01 [Get Trigger Table]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0208
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 02 [Set Error Type]
+[0001] Instruction : 02 [Write Register]
+[0001] Flags (decoded below) : 01
+ Preserve Register Bits : 1
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0210
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 03 [Get Error Type]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0218
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 04 [End Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 01
+ Preserve Register Bits : 1
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0220
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 05 [Execute Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 01
+ Preserve Register Bits : 1
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 10
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 02 [Word Access:16]
+[0008] Address : 0xFFFF0228
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 06 [Check Busy Status]
+[0001] Instruction : 01 [Read Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0230
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 07 [Get Command Status]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 01
+ Preserve Register Bits : 1
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0238
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/erst.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/erst.asl
new file mode 100644
index 000000000..2bf2aff26
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/erst.asl
@@ -0,0 +1,305 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [ERST] Error Record Serialization Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "ERST"
+[0004] Table Length : 00000230
+[0001] Revision : 01
+[0001] Checksum : AB
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000002
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Serialization Header Length : 00000030
+[0004] Reserved : 00000000
+[0004] Instruction Entry Count : 00000010
+
+[0001] Action : 00 [Begin Write Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0100
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 01 [Begin Read Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0108
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 02 [Begin Clear Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0110
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 03 [End Operation]
+[0001] Instruction : 04 [Noop]
+[0001] Flags (decoded below) : 01
+ Preserve Register Bits : 1
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0118
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 04 [Set Record Offset]
+[0001] Instruction : 02 [Write Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0120
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 05 [Execute Operation]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0xFFFF0128
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 06 [Check Busy Status]
+[0001] Instruction : 01 [Read Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0130
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 07 [Get Command Status]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0138
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 08 [Get Record Identifier]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0140
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 09 [Set Record Identifier]
+[0001] Instruction : 02 [Write Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0148
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0A [Get Record Count]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0150
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0B [Begin Dummy Write]
+[0001] Instruction : 03 [Write Register Value]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0158
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0C [Unused/Unknown Action]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0160
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0D [Get Error Address Range]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0168
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0E [Get Error Address Length]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0170
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
+
+[0001] Action : 0F [Get Error Attributes]
+[0001] Instruction : 00 [Read Register]
+[0001] Flags (decoded below) : 00
+ Preserve Register Bits : 0
+[0001] Reserved : 00
+
+[0012] Register Region : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0178
+
+[0008] Value : 0000000000000000
+[0008] Mask : FFFFFFFFFFFFFFFF
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facp.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facp.asl
new file mode 100644
index 000000000..8d742f7ce
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facp.asl
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [FACP] ACPI Table
+ *
+ */
+
+[0004] Signature : "FACP"
+[0004] Table Length : 0000010C
+[0001] Revision : 05
+[0001] Checksum : 18
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000000
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20111123
+
+[0004] FACS Address : 00000000
+[0004] DSDT Address : 00000010
+[0001] Model : 00
+[0001] PM Profile : 04 /* Enterprise Server */
+[0002] SCI Interrupt : 0000
+[0004] SMI Command Port : 00000000
+[0001] ACPI Enable Value : 00
+[0001] ACPI Disable Value : 00
+[0001] S4BIOS Command : 00
+[0001] P-State Control : 00
+[0004] PM1A Event Block Address : 00000001
+[0004] PM1B Event Block Address : 00000000
+[0004] PM1A Control Block Address : 00000001
+[0004] PM1B Control Block Address : 00000000
+[0004] PM2 Control Block Address : 00000001
+[0004] PM Timer Block Address : 00000001
+[0004] GPE0 Block Address : 00000001
+[0004] GPE1 Block Address : 00000000
+[0001] PM1 Event Block Length : 04
+[0001] PM1 Control Block Length : 02
+[0001] PM2 Control Block Length : 01
+[0001] PM Timer Block Length : 04
+[0001] GPE0 Block Length : 08
+[0001] GPE1 Block Length : 00
+[0001] GPE1 Base Offset : 00
+[0001] _CST Support : 00
+[0002] C2 Latency : 0000
+[0002] C3 Latency : 0000
+[0002] CPU Cache Size : 0000
+[0002] Cache Flush Stride : 0000
+[0001] Duty Cycle Offset : 00
+[0001] Duty Cycle Width : 00
+[0001] RTC Day Alarm Index : 00
+[0001] RTC Month Alarm Index : 00
+[0001] RTC Century Index : 00
+[0002] Boot Flags (decoded below) : 0000
+ Legacy Devices Supported (V2) : 0
+ 8042 Present on ports 60/64 (V2) : 0
+ VGA Not Present (V4) : 0
+ MSI Not Supported (V4) : 0
+ PCIe ASPM Not Supported (V4) : 0
+ CMOS RTC Not Present (V5) : 0
+[0001] Reserved : 00
+[0004] Flags (decoded below) : 00000000
+ WBINVD instruction is operational (V1) : 1
+ WBINVD flushes all caches (V1) : 1
+ All CPUs support C1 (V1) : 0
+ C2 works on MP system (V1) : 0
+ Control Method Power Button (V1) : 1
+ Control Method Sleep Button (V1) : 1
+ RTC wake not in fixed reg space (V1) : 0
+ RTC can wake system from S4 (V1) : 0
+ 32-bit PM Timer (V1) : 0
+ Docking Supported (V1) : 0
+ Reset Register Supported (V2) : 0
+ Sealed Case (V3) : 0
+ Headless - No Video (V3) : 1
+ Use native instr after SLP_TYPx (V3) : 0
+ PCIEXP_WAK Bits Supported (V4) : 0
+ Use Platform Timer (V4) : 0
+ RTC_STS valid on S4 wake (V4) : 0
+ Remote Power-on capable (V4) : 1
+ Use APIC Cluster Model (V4) : 0
+ Use APIC Physical Destination Mode (V4) : 0
+ Hardware Reduced (V5) : 1
+ Low Power S0 Idle (V5) : 1
+
+[0012] Reset Register : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0000000000000001
+
+[0001] Value to cause reset : 00
+[0003] Reserved : 000000
+[0008] FACS Address : 0000000000000000
+[0008] DSDT Address : 0000000000000010
+[0012] PM1A Event Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 20
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 02 [Word Access:16]
+[0008] Address : 0000000000000001
+
+[0012] PM1B Event Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 00
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000000
+
+[0012] PM1A Control Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 10
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 02 [Word Access:16]
+[0008] Address : 0000000000000001
+
+[0012] PM1B Control Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 00
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000000
+
+[0012] PM2 Control Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000001
+
+[0012] PM Timer Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 20
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 03 [DWord Access:32]
+[0008] Address : 0000000000000001
+
+[0012] GPE0 Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 80
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0000000000000001
+
+[0012] GPE1 Block : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 00
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000000
+
+
+[0012] Sleep Control Register : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0000000000000000
+
+[0012] Sleep Status Register : [Generic Address Structure]
+[0001] Space ID : 01 [SystemIO]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0000000000000000
+
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facs.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facs.asl
new file mode 100644
index 000000000..8dbb38b38
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/facs.asl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [FACS] ACPI Table
+ *
+ */
+
+[0004] Signature : "FACS"
+[0004] Length : 00000040
+[0004] Hardware Signature : 00000000
+[0004] 32 Firmware Waking Vector : 00000000
+[0004] Global Lock : 00000000
+[0004] Flags (decoded below) : 00000000
+ S4BIOS Support Present : 0
+ 64-bit Wake Supported (V2) : 0
+[0008] 64 Firmware Waking Vector : 0000000000000000
+[0001] Version : 02
+[0003] Reserved : 000000
+[0004] OspmFlags (decoded below) : 00000000
+ 64-bit Wake Env Required (V2) : 0
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/fpdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/fpdt.asl
new file mode 100644
index 000000000..53afa6676
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/fpdt.asl
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [FPDT] Firmware Performance Data Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "FPDT"
+[0004] Table Length : 00000064
+[0001] Revision : 01
+[0001] Checksum : BD
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20110804
+
+
+[0002] Subtable Type : 0000
+[0001] Length : 30
+[0001] Revision : 01
+[0004] Reserved : 00000000
+[0008] Reset End : 0000000000000000
+[0008] Load Image Start : 0000000000000000
+[0008] Start Image Start : 0000000000000000
+[0008] Exit Services Entry : 0000000000000000
+[0008] Exit Services Exit : 0000000000000000
+
+[0002] Subtable Type : 0001
+[0001] Length : 10
+[0001] Revision : 01
+[0004] Reserved : 00000000
+[0008] S3PT Address : 0000000000000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/gtdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/gtdt.asl
new file mode 100644
index 000000000..afaf9f41b
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/gtdt.asl
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * Hanjun Guo <hanjun.guo@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [GTDT] Generic Timer Description Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "GTDT"
+[0004] Table Length : 00000050
+[0001] Revision : 01
+[0001] Checksum : F1
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20110623
+
+[0008] Timer Address : 0000000000000000
+[0004] Flags (decoded below) : 00000001
+ Memory Present : 1
+
+/* In RTSM model's dts file, the last cell of interrupts
+ * is 0xff01, it means its cpu mask is FF, and trigger type
+ * and flag is 1 = low-to-high edge triggered.
+ *
+ * so in ACPI the Trigger Mode is 1 - Edge triggered, and
+ * Polarity is 0 - Active high as ACPI spec describled.
+ *
+ * using direct mapping for hwirqs, it means that we using
+ * ID [16, 31] for PPI, not [0, 15] used in FDT.
+ */
+[0004] Secure PL1 Interrupt : 0000001d
+[0004] SPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
+ Polarity : 0
+
+[0004] Non-Secure PL1 Interrupt : 0000001e
+[0004] NSPL1 Flags (decoded below) : 00000001
+ Trigger Mode : 1
+ Polarity : 0
+
+[0004] Virtual Timer Interrupt : 0000001b
+[0004] VT Flags (decoded below) : 00000001
+ Trigger Mode : 1
+ Polarity : 0
+
+[0004] Non-Secure PL2 Interrupt : 0000001a
+[0004] NSPL2 Flags (decoded below) : 00000001
+ Trigger Mode : 1
+ Polarity : 0
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/hest.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/hest.asl
new file mode 100644
index 000000000..70ba8f2f1
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/hest.asl
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [HEST] Hardware Error Source Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "HEST"
+[0004] Table Length : 000001D4
+[0001] Revision : 01
+[0001] Checksum : 20
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000002
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Error Source Count : 00000001
+
+[0002] Subtable Type : 0009 [Generic Hardware Error Source]
+[0002] Source Id : 0002
+[0002] Related Source Id : FFFF
+[0001] Reserved : 00
+[0001] Enabled : 01
+[0004] Records To Preallocate : 00000001
+[0004] Max Sections Per Record : 00000001
+[0004] Max Raw Data Length : 00001000
+
+[0012] Error Status Address : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 40
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 04 [QWord Access:64]
+[0008] Address : 0xFFFF0000
+
+[0028] Notify : [Hardware Error Notification Structure]
+[0001] Notify Type : 03 [SCI]
+[0001] Notify Length : 1C
+[0002] Configuration Write Enable : 0000
+[0004] PollInterval : 00000000
+[0004] Vector : 00000000
+[0004] Polling Threshold Value : 00000000
+[0004] Polling Threshold Window : 00000000
+[0004] Error Threshold Value : 00000000
+[0004] Error Threshold Window : 00000000
+
+[0004] Error Status Block Length : 00001000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mcfg.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mcfg.asl
new file mode 100644
index 000000000..470637e07
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mcfg.asl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [MCFG] PCIe Memory Mapped Configuration Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "MCFG"
+[0004] Table Length : 0000003C
+[0001] Revision : 01
+[0001] Checksum : 19
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0008] Reserved : 0000000000000000
+
+[0008] Base Address : 0000000000000000
+[0002] Segment Group Number : 0000
+[0001] Start Bus Number : 00
+[0001] End Bus Number : 00
+[0004] Reserved : 00000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mchi.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mchi.asl
new file mode 100644
index 000000000..759ff193c
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mchi.asl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [MCHI] Management Controller Host Interface Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "MCHI"
+[0004] Table Length : 00000045
+[0001] Revision : 01
+[0001] Checksum : E4
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 02000715
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0001] Interface Type : 01
+[0001] Protocol : 00
+[0008] Protocol Data : 0000000000000000
+[0001] Interrupt Type : 00
+[0001] Gpe : 00
+[0001] Pci Device Flag : 00
+[0004] Global Interrupt : 00000000
+
+[0012] Control Register : [Generic Address Structure]
+[0001] Space ID : 02 [PCI_Config]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 00 [Undefined/Legacy]
+[0008] Address : 0000000000000000
+
+[0001] Pci Segment : 00
+[0001] Pci Bus : 00
+[0001] Pci Device : 00
+[0001] Pci Function : 00
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mpst.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mpst.asl
new file mode 100644
index 000000000..d8b0d8cf5
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/mpst.asl
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [MPST] Memory Power State Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "MPST"
+[0004] Table Length : 000000B6
+[0001] Revision : 01
+[0001] Checksum : 77
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20120913
+
+[0001] Channel ID : 00
+[0003] Reserved : 000000
+[0002] Power Node Count : 0002
+[0002] Reserved : 0000
+
+[0001] Flags (decoded below) : 00
+ Node Enabled : 0
+ Power Managed : 0
+ Hot Plug Capable : 0
+[0001] Reserved : 00
+[0002] Node ID : 0000
+[0004] Length : 00000000
+[0008] Range Address : 0000000000000000
+[0008] Range Length : 0000000000000000
+[0004] Num Power States : 00000002
+[0004] Num Physical Components : 00000003
+
+[0001] Power State : 00
+[0001] InfoIndex : 00
+
+[0001] Power State : 00
+[0001] InfoIndex : 00
+
+[0002] Component Id : 0000
+[0002] Component Id : 0001
+[0002] Component Id : 0002
+
+[0001] Flags (decoded below) : 00
+ Node Enabled : 0
+ Power Managed : 0
+ Hot Plug Capable : 0
+[0001] Reserved : 00
+[0002] Node ID : 0000
+[0004] Length : 00000000
+[0008] Range Address : 0000000000000000
+[0008] Range Length : 0000000000000000
+[0004] Num Power States : 00000001
+[0004] Num Physical Components : 00000001
+
+[0001] Power State : 00
+[0001] InfoIndex : 00
+
+[0002] Component Id : 0000
+
+[0002] Characteristics Count : 0002
+[0002] Reserved : 0000
+
+[0001] Structure ID : 01
+[0001] Flags (decoded below) : 00
+ Memory Preserved : 0
+ Auto Entry : 0
+ Auto Exit : 0
+[0002] Reserved : 0000
+[0004] Average Power : 00000000
+[0004] Power Saving : 00000000
+[0008] Exit Latency : 0000000000000000
+[0008] Reserved : 0000000000000000
+
+[0001] Structure ID : 01
+[0001] Flags (decoded below) : 00
+ Memory Preserved : 0
+ Auto Entry : 0
+ Auto Exit : 0
+[0002] Reserved : 0000
+[0004] Average Power : 00000000
+[0004] Power Saving : 00000000
+[0008] Exit Latency : 0000000000000000
+[0008] Reserved : 0000000000000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/msct.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/msct.asl
new file mode 100644
index 000000000..aecde848b
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/msct.asl
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [MSCT] Maximum System Characteristics Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "MSCT"
+[0004] Table Length : 00000090
+[0001] Revision : 01
+[0001] Checksum : B7
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Proximity Offset : 00000038
+[0004] Max Proximity Domains : 00000003
+[0004] Max Clock Domains : 00000000
+[0008] Max Physical Address : 00000FFFFFFFFFFF
+
+[0001] Revision : 01
+[0001] Length : 16
+[0004] Domain Range Start : 00000000
+[0004] Domain Range End : 00000003
+[0004] Processor Capacity : 00000010
+[0008] Memory Capacity : 0000004000000000
+
+[0001] Revision : 01
+[0001] Length : 16
+[0004] Domain Range Start : 00000000
+[0004] Domain Range End : 00000000
+[0004] Processor Capacity : 00000000
+[0008] Memory Capacity : 0000000000000000
+
+[0001] Revision : 01
+[0001] Length : 16
+[0004] Domain Range Start : 00000000
+[0004] Domain Range End : 00000000
+[0004] Processor Capacity : 00000000
+[0008] Memory Capacity : 0000000000000000
+
+[0001] Revision : 01
+[0001] Length : 16
+[0004] Domain Range Start : 00000000
+[0004] Domain Range End : 00000000
+[0004] Processor Capacity : 00000000
+[0008] Memory Capacity : 0000000000000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/oem0.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/oem0.asl
new file mode 100644
index 000000000..ae4fa2805
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/oem0.asl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [OEMx] OEM Specific Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "OEM0"
+[0004] Table Length : 00000024
+[0001] Revision : 01
+[0001] Checksum : 8B
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 0000000A
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/pmtt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/pmtt.asl
new file mode 100644
index 000000000..019116f17
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/pmtt.asl
@@ -0,0 +1,132 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [PMTT] Platform Memory Topology Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "PMTT"
+[0004] Table Length : 000000B4
+[0001] Revision : 01
+[0001] Checksum : 3A
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20110826
+
+[0004] Reserved : 00000000
+
+[0001] Subtable Type : 00 [Socket]
+[0001] Reserved : 00
+[0002] Length : 0080
+[0002] Flags (decoded below) : 0001
+ Top-level Device : 1
+ Physical Element : 0
+ Memory Type : 0
+[0002] Reserved : 0000
+[0002] Socket ID : 0000
+[0002] Reserved : 0000
+
+[0001] Subtable Type : 01 [Memory Controller]
+[0001] Reserved : 00
+[0002] Length : 0054
+[0002] Flags (decoded below) : 0005
+ Top-level Device : 1
+ Physical Element : 0
+ Memory Type : 1
+[0002] Reserved : 0000
+[0004] Read Latency : 00000000
+[0004] Write Latency : 00000000
+[0004] Read Bandwidth : 00000000
+[0004] Write Bandwidth : 00000000
+[0002] Access Width : 0000
+[0002] Alignment : 0000
+[0002] Reserved : 0000
+[0002] Domain Count : 0003
+[0004] Proximity Domain : 00000000
+[0004] Proximity Domain : 00000000
+[0004] Proximity Domain : 00000000
+
+[0001] Subtable Type : 02 [Physical Component (DIMM)]
+[0001] Reserved : 00
+[0002] Length : 0014
+[0002] Flags (decoded below) : 0002
+ Top-level Device : 0
+ Physical Element : 1
+ Memory Type : 0
+[0002] Reserved : 0000
+[0002] Component ID : 0000
+[0002] Reserved : 0000
+[0004] Memory Size : 00000000
+[0004] Bios Handle : 00000000
+
+[0001] Subtable Type : 02 [Physical Component (DIMM)]
+[0001] Reserved : 00
+[0002] Length : 0014
+[0002] Flags (decoded below) : 0002
+ Top-level Device : 0
+ Physical Element : 1
+ Memory Type : 0
+[0002] Reserved : 0000
+[0002] Component ID : 0000
+[0002] Reserved : 0000
+[0004] Memory Size : 00000000
+[0004] Bios Handle : 00000000
+
+[0001] Subtable Type : 01 [Memory Controller]
+[0001] Reserved : 00
+[0002] Length : 0020
+[0002] Flags (decoded below) : 0001
+ Top-level Device : 1
+ Physical Element : 0
+ Memory Type : 0
+[0002] Reserved : 0000
+[0004] Read Latency : 00000000
+[0004] Write Latency : 00000000
+[0004] Read Bandwidth : 00000000
+[0004] Write Bandwidth : 00000000
+[0002] Access Width : 0000
+[0002] Alignment : 0000
+[0002] Reserved : 0000
+[0002] Domain Count : 0000
+
+[0001] Subtable Type : 00 [Socket]
+[0001] Reserved : 00
+[0002] Length : 000C
+[0002] Flags (decoded below) : 0001
+ Top-level Device : 1
+ Physical Element : 0
+ Memory Type : 0
+[0002] Reserved : 0000
+[0002] Socket ID : 0000
+[0002] Reserved : 0000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/rsdp.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/rsdp.asl
new file mode 100644
index 000000000..0595647cc
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/rsdp.asl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [RSDP] ACPI Table
+ *
+ */
+
+[0008] Signature : "RSD PTR "
+[0001] Checksum : 43
+[0006] Oem ID : "LINARO"
+[0001] Revision : 02
+[0004] RSDT Address : 00000000
+[0004] Length : 00000024
+[0008] XSDT Address : 0000000000000000
+[0001] Extended Checksum : DC
+[0003] Reserved : 000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/slit.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/slit.asl
new file mode 100644
index 000000000..3d62f3210
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/slit.asl
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [SLIT] System Locality Information Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "SLIT"
+[0004] Table Length : 000001BC
+[0001] Revision : 01
+[0001] Checksum : 00
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20110316
+
+[0008] Localities : 0000000000000014
+[0020] Locality 0 : 0A 10 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 \
+ 24 25 26 27
+[0020] Locality 1 : 10 0A 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 \
+ 23 24 25 26
+[0020] Locality 2 : 16 15 0A 10 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 \
+ 22 23 24 25
+[0020] Locality 3 : 17 16 10 0A 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 \
+ 21 22 23 24
+[0020] Locality 4 : 18 17 16 15 0A 10 16 17 18 19 1A 1B 1C 1D 1E 1F \
+ 20 21 22 23
+[0020] Locality 5 : 19 18 17 16 10 0A 15 16 17 18 19 1A 1B 1C 1D 1E \
+ 1F 20 21 22
+[0020] Locality 6 : 1A 19 18 17 16 15 0A 10 16 17 18 19 1A 1B 1C 1D \
+ 1E 1F 20 21
+[0020] Locality 7 : 1B 1A 19 18 17 16 10 0A 15 16 17 18 19 1A 1B 1C \
+ 1D 1E 1F 20
+[0020] Locality 8 : 1C 1B 1A 19 18 17 16 15 0A 10 16 17 18 19 1A 1B \
+ 1C 1D 1E 1F
+[0020] Locality 9 : 1D 1C 1B 1A 19 18 17 16 10 0A 15 16 17 18 19 1A \
+ 1B 1C 1D 1E
+[0020] Locality 10 : 1E 1D 1C 1B 1A 19 18 17 16 15 0A 10 16 17 18 19 \
+ 1A 1B 1C 1D
+[0020] Locality 11 : 1F 1E 1D 1C 1B 1A 19 18 17 16 10 0A 15 16 17 18 \
+ 19 1A 1B 1C
+[0020] Locality 12 : 20 1F 1E 1D 1C 1B 1A 19 18 17 16 15 0A 10 16 17 \
+ 18 19 1A 1B
+[0020] Locality 13 : 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 10 0A 15 16 \
+ 17 18 19 1A
+[0020] Locality 14 : 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 15 0A 10 \
+ 16 17 18 19
+[0020] Locality 15 : 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 10 0A \
+ 15 16 17 18
+[0020] Locality 16 : 24 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 15 \
+ 0A 10 16 17
+[0020] Locality 17 : 25 24 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 16 \
+ 10 0A 15 16
+[0020] Locality 18 : 26 25 24 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 17 \
+ 16 15 0A 10
+[0020] Locality 19 : 27 26 25 24 23 22 21 20 1F 1E 1D 1C 1B 1A 19 18 \
+ 17 16 10 0A
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/spmi.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/spmi.asl
new file mode 100644
index 000000000..11b1c994d
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/spmi.asl
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [SPMI] Server Platform Management Interface Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "SPMI"
+[0004] Table Length : 00000041
+[0001] Revision : 04
+[0001] Checksum : ED
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000000
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0001] Interface Type : 00
+[0001] Reserved : 00
+[0002] IPMI Spec Version : 0000
+[0001] Interrupt Type : 00
+[0001] GPE Number : 00
+[0001] Reserved : 00
+[0001] PCI Device Flag : 00
+[0004] Interrupt : 00000000
+
+[0012] IPMI Register : [Generic Address Structure]
+[0001] Space ID : 00 [SystemMemory]
+[0001] Bit Width : 08
+[0001] Bit Offset : 00
+[0001] Encoded Access Width : 01 [Byte Access:8]
+[0008] Address : 0000000000000000
+
+[0001] PCI Segment : 00
+[0001] PCI Bus : 00
+[0001] PCI Device : 00
+[0001] PCI Function : 00
+[0001] Reserved : 00
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/srat.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/srat.asl
new file mode 100644
index 000000000..670bdd3cb
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/srat.asl
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [SRAT] System Resource Affinity Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "SRAT"
+[0004] Table Length : 00000080
+[0001] Revision : 03
+[0001] Checksum : 5A
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0004] Table Revision : 00000001
+[0008] Reserved : 0000000000000000
+
+[0001] Subtable Type : 00 [Processor Local APIC/SAPIC Affinity]
+[0001] Length : 10
+
+[0001] Proximity Domain Low(8) : 00
+[0001] Apic ID : 00
+[0004] Flags (decoded below) : 00000001
+ Enabled : 1
+[0001] Local Sapic EID : 00
+[0003] Proximity Domain High(24) : 000000
+[0004] Reserved : 00000000
+
+[0001] Subtable Type : 01 [Memory Affinity]
+[0001] Length : 28
+
+[0004] Proximity Domain : 00000000
+[0002] Reserved1 : 0000
+[0008] Base Address : 0000000000000000
+[0008] Address Length : 000000000009FC00
+[0004] Reserved2 : 00000000
+[0004] Flags (decoded below) : 00000001
+ Enabled : 1
+ Hot Pluggable : 0
+ Non-Volatile : 0
+[0008] Reserved3 : 0000000000000000
+
+[0001] Subtable Type : 02 [Processor Local x2APIC Affinity]
+[0001] Length : 18
+
+[0002] Reserved1 : 0000
+[0004] Proximity Domain : 00000000
+[0004] Apic ID : 00000000
+[0004] Flags (decoded below) : 00000001
+ Enabled : 1
+[0004] Clock Domain : 00000000
+[0004] Reserved2 : 00000000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ssdt0.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ssdt0.asl
new file mode 100644
index 000000000..a5515acbe
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/ssdt0.asl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [SSDT] Description of the armv8 VE Model
+ *
+ */
+
+DefinitionBlock (
+ "ssdt0.aml", // output filename
+ "SSDT", // table signature
+ 2, // SSDT compliance revision
+ "LINARO", // OEM ID
+ "RTSMVEV8", // table ID
+ 0x00000001) // OEM revision
+{
+}
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/tpm2.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/tpm2.asl
new file mode 100644
index 000000000..c88eb2c4b
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/tpm2.asl
@@ -0,0 +1,22 @@
+/*
+ * Intel ACPI Component Architecture
+ * iASL Compiler/Disassembler version 20130117-64 [Jan 31 2013]
+ * Copyright (c) 2000 - 2013 Intel Corporation
+ *
+ * Template for [TPM2] ACPI Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ */
+
+[0004] Signature : "TPM2" [Trusted Platform Module hardware interface table]
+[0004] Table Length : 00000034
+[0001] Revision : 03
+[0001] Checksum : 42
+[0006] Oem ID : "INTEL "
+[0008] Oem Table ID : "TEMPLATE"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20121114
+
+[0004] Flags : 00000000
+[0008] Control Address : 0011223344556677
+[0004] Start Method : 00000001
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/uefi.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/uefi.asl
new file mode 100644
index 000000000..a39aa52f5
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/uefi.asl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [UEFI] UEFI Boot Optimization Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "UEFI"
+[0004] Table Length : 00000036
+[0001] Revision : 01
+[0001] Checksum : 9B
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000001
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0016] UUID Identifier : 03020100-0504-0706-0809-0A0B0C0D0E0F
+[0002] Data Offset : 0000
diff --git a/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/xsdt.asl b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/xsdt.asl
new file mode 100644
index 000000000..b33f82e21
--- /dev/null
+++ b/ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/xsdt.asl
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2013, Al Stone <al.stone@linaro.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * NB: This License is also known as the "BSD 2-Clause License".
+ *
+ *
+ * [XSDT] Extended System Description Table
+ * Format: [ByteLength] FieldName : HexFieldValue
+ *
+ */
+
+[0004] Signature : "XSDT"
+[0004] Table Length : 00000064
+[0001] Revision : 01
+[0001] Checksum : 8B
+[0006] Oem ID : "LINARO"
+[0008] Oem Table ID : "RTSMVEV8"
+[0004] Oem Revision : 00000014
+[0004] Asl Compiler ID : "INTL"
+[0004] Asl Compiler Revision : 20100528
+
+[0008] ACPI Table Address 0 : 0000000000000010
+[0008] ACPI Table Address 0 : 0000000000000020
+[0008] ACPI Table Address 0 : 0000000000000030
+[0008] ACPI Table Address 0 : 0000000000000040
+[0008] ACPI Table Address 0 : 0000000000000050
+[0008] ACPI Table Address 0 : 0000000000000060
+[0008] ACPI Table Address 0 : 0000000000000070
+[0008] ACPI Table Address 0 : 0000000000000080
+[0008] ACPI Table Address 0 : 0000000000000090
+[0008] ACPI Table Address 0 : 00000000000000A0
+[0008] ACPI Table Address 0 : 00000000000000B0
+[0008] ACPI Table Address 0 : 00000000000000C0
+[0008] ACPI Table Address 0 : 00000000000000D0
+[0008] ACPI Table Address 0 : 00000000000000E0
+[0008] ACPI Table Address 0 : 00000000000000F0
+[0008] ACPI Table Address 0 : 0000000000000100
+[0008] ACPI Table Address 0 : 0000000000000110
+[0008] ACPI Table Address 0 : 0000000000000120
+[0008] ACPI Table Address 0 : 0000000000000130
+[0008] ACPI Table Address 0 : 0000000000000140
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.c b/ArmPkg/Drivers/ArmGic/ArmGicDxe.c
index 111ce1443..b3085f93e 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.c
+++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.c
@@ -320,6 +320,9 @@ ExitBootServicesEvent (
// Disable Gic Distributor
MmioWrite32 (PcdGet32(PcdGicDistributorBase) + ARM_GIC_ICDDCR, 0x0);
+
+ // Mask interrupts globally
+ ArmDisableInterrupts ();
}
/**
diff --git a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
index 9dc557a03..7ddecde58 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
+++ b/ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
@@ -33,6 +33,7 @@
ArmPkg/ArmPkg.dec
[LibraryClasses]
+ ArmLib
BaseLib
UefiLib
UefiBootServicesTableLib
diff --git a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.h b/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.h
deleted file mode 100644
index 620ccd528..000000000
--- a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
-
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
-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 _UPDATE_SMBIOS_DRIVER_H_
-#define _UPDATE_SMBIOS_DRIVER_H_
-
-
-#include <PiDxe.h>
-#include <Protocol/Smbios.h>
-#include <IndustryStandard/SmBios.h>
-#include <Guid/SmBios.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/PcdLib.h>
-
-
-EFI_STATUS
-EFIAPI
-UpdateSmbios (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-#endif
-
diff --git a/ArmPkg/Include/Chipset/AArch64Mmu.h b/ArmPkg/Include/Chipset/AArch64Mmu.h
index 7c9890331..77a96ec63 100644
--- a/ArmPkg/Include/Chipset/AArch64Mmu.h
+++ b/ArmPkg/Include/Chipset/AArch64Mmu.h
@@ -102,12 +102,12 @@
#define TCR_TG0_4KB (0 << 14)
-#define TCR_IPS_4GB (0UL << 32)
-#define TCR_IPS_64GB (1UL << 32)
-#define TCR_IPS_1TB (2UL << 32)
-#define TCR_IPS_4TB (3UL << 32)
-#define TCR_IPS_16TB (4UL << 32)
-#define TCR_IPS_256TB (5UL << 32)
+#define TCR_IPS_4GB (0ULL << 32)
+#define TCR_IPS_64GB (1ULL << 32)
+#define TCR_IPS_1TB (2ULL << 32)
+#define TCR_IPS_4TB (3ULL << 32)
+#define TCR_IPS_16TB (4ULL << 32)
+#define TCR_IPS_256TB (5ULL << 32)
#define TTBR_ASID_FIELD (48)
diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLib.h
index 611622e1a..a05f7251a 100644
--- a/ArmPkg/Include/Library/ArmLib.h
+++ b/ArmPkg/Include/Library/ArmLib.h
@@ -76,7 +76,7 @@ typedef enum {
typedef struct {
EFI_PHYSICAL_ADDRESS PhysicalBase;
EFI_VIRTUAL_ADDRESS VirtualBase;
- UINTN Length;
+ UINT64 Length;
ARM_MEMORY_REGION_ATTRIBUTES Attributes;
} ARM_MEMORY_REGION_DESCRIPTOR;
diff --git a/ArmPkg/Include/Ppi/ArmMpCoreInfo.h b/ArmPkg/Include/Ppi/ArmMpCoreInfo.h
index 08276b135..fdacd811b 100644
--- a/ArmPkg/Include/Ppi/ArmMpCoreInfo.h
+++ b/ArmPkg/Include/Ppi/ArmMpCoreInfo.h
@@ -13,7 +13,7 @@
**/
#ifndef __ARM_MP_CORE_INFO_PPI_H__
-#define __ARM_MP_CORE_INFO_PPI_H_
+#define __ARM_MP_CORE_INFO_PPI_H__
#include <Guid/ArmMpCoreInfo.h>
diff --git a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
index dfab4cc2e..fbe8949d7 100644
--- a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
+++ b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c
@@ -773,17 +773,17 @@ DisassembleThumbInstruction (
case LDM_REG_INDIRECT_LSL:
// <rt>, [<rn>, <rm> {, LSL #<imm2>]}
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a, %a", gReg[Rt], gReg[Rn], gReg[Rm]);
- if (((OpCode32 >> 4) && 3) == 0) {
+ if (((OpCode32 >> 4) & 3) == 0) {
AsciiSPrint (&Buf[Offset], Size - Offset, "]");
} else {
- AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL #%d]", (OpCode32 >> 4) && 3);
+ AsciiSPrint (&Buf[Offset], Size - Offset, ", LSL #%d]", (OpCode32 >> 4) & 3);
}
return;
case LDM_REG_IMM12:
// <rt>, [<rn>, {, #<imm12>]}
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]);
- if ((OpCode32 && 0xfff) == 0) {
+ if ((OpCode32 & 0xfff) == 0) {
AsciiSPrint (&Buf[Offset], Size - Offset, "]");
} else {
AsciiSPrint (&Buf[Offset], Size - Offset, ", #0x%x]", OpCode32 & 0xfff);
@@ -797,7 +797,7 @@ DisassembleThumbInstruction (
P = (OpCode32 & BIT10) == BIT10;
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, [%a", gReg[Rt], gReg[Rn]);
if (P) {
- if ((OpCode32 && 0xff) == 0) {
+ if ((OpCode32 & 0xff) == 0) {
AsciiSPrint (&Buf[Offset], Size - Offset, "]%a", W?"!":"");
} else {
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-" , OpCode32 & 0xff, W?"!":"");
@@ -814,13 +814,13 @@ DisassembleThumbInstruction (
W = (OpCode32 & BIT21) == BIT21;
Offset += AsciiSPrint (&Buf[Offset], Size - Offset, " %a, %a, [%a", gReg[Rt], gReg[Rt2], gReg[Rn]);
if (P) {
- if ((OpCode32 && 0xff) == 0) {
+ if ((OpCode32 & 0xff) == 0) {
AsciiSPrint (&Buf[Offset], Size - Offset, "]");
} else {
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x]%a", U?"":"-", (OpCode32 & 0xff) << 2, W?"!":"");
}
} else {
- if ((OpCode32 && 0xff) != 0) {
+ if ((OpCode32 & 0xff) != 0) {
AsciiSPrint (&Buf[Offset], Size - Offset, ", #%a0x%x", U?"":"-", (OpCode32 & 0xff) << 2);
}
}
diff --git a/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c
index 887058baf..19177c8e4 100644
--- a/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c
+++ b/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c
@@ -223,7 +223,7 @@ BdsBootLinuxFdt (
// Try to put the kernel at the start of RAM so as to give it access to all memory.
// If that fails fall back to try loading it within LINUX_KERNEL_MAX_OFFSET of memory start.
- LinuxImage = PcdGet32(PcdSystemMemoryBase) + 0x80000;
+ LinuxImage = PcdGet64 (PcdSystemMemoryBase) + 0x80000;
Status = BdsLoadImage (LinuxKernelDevicePath, AllocateAddress, &LinuxImage, &LinuxImageSize);
if (EFI_ERROR(Status)) {
// Try again but give the loader more freedom of where to put the image.
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxFdt.c b/ArmPkg/Library/BdsLib/BdsLinuxFdt.c
index 58db0bdd6..ae302aff8 100644
--- a/ArmPkg/Library/BdsLib/BdsLinuxFdt.c
+++ b/ArmPkg/Library/BdsLib/BdsLinuxFdt.c
@@ -25,7 +25,7 @@
#define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a))))
#define GET_CELL(p) (p += 4, *((const UINT32 *)(p-4)))
-STATIC inline
+STATIC
UINTN
cpu_to_fdtn (UINTN x) {
if (sizeof (UINTN) == sizeof (UINT32)) {
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxLoader.h b/ArmPkg/Library/BdsLib/BdsLinuxLoader.h
index 09b212f36..8949cfa98 100644
--- a/ArmPkg/Library/BdsLib/BdsLinuxLoader.h
+++ b/ArmPkg/Library/BdsLib/BdsLinuxLoader.h
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -16,9 +16,9 @@
#define __BDSLINUXLOADER_H
#define LINUX_UIMAGE_SIGNATURE 0x56190527
-#define LINUX_KERNEL_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxKernelMaxOffset))
-#define LINUX_ATAG_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxAtagMaxOffset))
-#define LINUX_FDT_MAX_OFFSET (PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxFdtMaxOffset))
+#define LINUX_KERNEL_MAX_OFFSET (PcdGet64 (PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxKernelMaxOffset))
+#define LINUX_ATAG_MAX_OFFSET (PcdGet64 (PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxAtagMaxOffset))
+#define LINUX_FDT_MAX_OFFSET (PcdGet64 (PcdSystemMemoryBase) + PcdGet32(PcdArmLinuxFdtMaxOffset))
// Additional size that could be used for FDT entries added by the UEFI OS Loader
// Estimation based on: EDID (300bytes) + bootargs (200bytes) + initrd region (20bytes)
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S
index 07e0cd6bb..b68ed8a6e 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.S
@@ -1,4 +1,4 @@
-#------------------------------------------------------------------------------
+#------------------------------------------------------------------------------
#
# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
#
@@ -14,21 +14,19 @@
.text
.align 2
+ GCC_ASM_EXPORT(__aeabi_memcpy)
GCC_ASM_EXPORT(memcpy)
+ASM_PFX(__aeabi_memcpy):
ASM_PFX(memcpy):
- stmfd sp!, {r7, lr}
- mov ip, #0
- add r7, sp, #0
- mov lr, r0
- b L4
+ cmp r2, #0
+ bxeq lr
+ push {lr}
+ mov lr, r0
L5:
ldrb r3, [r1], #1 @ zero_extendqisi2
- add ip, ip, #1
- and r3, r3, #255
strb r3, [lr], #1
-L4:
- cmp ip, r2
+ subs r2, r2, #1
bne L5
- ldmfd sp!, {r7, pc}
+ pop {pc}
diff --git a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm
index e01b80d4b..f81db28fb 100644
--- a/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm
+++ b/ArmPkg/Library/CompilerIntrinsicsLib/Arm/memcpy.asm
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
//
@@ -27,14 +27,15 @@
; );
;
__aeabi_memcpy
- CMP r2, #0
- BXEQ r14
-loop
- LDRB r3, [r1], #1
- STRB r3, [r0], #1
- SUBS r2, r2, #1
- BXEQ r14
- B loop
-
- END
+ cmp r2, #0
+ bxeq lr
+ push {lr}
+ mov lr, r0
+L5
+ ldrb r3, [r1], #1
+ strb r3, [lr], #1
+ subs r2, r2, #1
+ bne L5
+ pop {pc}
+ END \ No newline at end of file
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc
index 998b82629..2fc87f3af 100644
--- a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc
+++ b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A8.dsc
@@ -40,7 +40,7 @@
ArmPlatformLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf
[BuildOptions]
- RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A8 --fpu=softvfp -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
+ RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A8 -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a8 -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc
index 36bd1ab3e..1722d9c48 100644
--- a/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc
+++ b/ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb-RTSM-A9x2.dsc
@@ -40,7 +40,7 @@
ArmPlatformLib|ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbLibSec.inf
[BuildOptions]
- RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 --fpu=softvfp -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
+ RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmRealViewEbPkg/Include/Platform
diff --git a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c
index c7a413dc2..1ed2c4780 100644
--- a/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c
+++ b/ArmPlatformPkg/ArmRealViewEbPkg/Library/ArmRealViewEbLibRTSM/ArmRealViewEbMem.c
@@ -65,9 +65,9 @@ ArmPlatformGetVirtualMemoryMap (
VirtualMemoryTable[Index].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes;
// DDR
- VirtualMemoryTable[++Index].PhysicalBase = PcdGet32 (PcdSystemMemoryBase);
- VirtualMemoryTable[Index].VirtualBase = PcdGet32 (PcdSystemMemoryBase);
- VirtualMemoryTable[Index].Length = PcdGet32 (PcdSystemMemorySize);
+ VirtualMemoryTable[++Index].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].Length = PcdGet64 (PcdSystemMemorySize);
VirtualMemoryTable[Index].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes;
// SMC CS7
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.c b/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.c
index 8982568c5..1885b6993 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.c
@@ -1,73 +1,75 @@
-/** @file
-
- Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
-
- 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 <Library/UefiLib.h>
-#include <Library/VirtioMmioDeviceLib.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-
-#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000
-
-typedef struct {
- VENDOR_DEVICE_PATH Vendor;
- EFI_DEVICE_PATH_PROTOCOL End;
-} VIRTIO_BLK_DEVICE_PATH;
-
-VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =
-{
- {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- {
- (UINT8)( sizeof(VENDOR_DEVICE_PATH) ),
- (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)
- }
- },
- EFI_CALLER_ID_GUID,
- },
- {
- END_DEVICE_PATH_TYPE,
- END_ENTIRE_DEVICE_PATH_SUBTYPE,
- {
- sizeof (EFI_DEVICE_PATH_PROTOCOL),
- 0
- }
- }
-};
-
-EFI_STATUS
-EFIAPI
-ArmFvpInitialise (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->InstallProtocolInterface (&ImageHandle,
- &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
- &mVirtioBlockDevicePath);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- // Declare the Virtio BlockIo device
- Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);
- if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install Virtio block device\n"));
- }
-
- return Status;
-}
+/** @file
+
+ Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
+
+ 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 <Library/UefiLib.h>
+#include <Library/VirtioMmioDeviceLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+#define ARM_FVP_BASE_VIRTIO_BLOCK_BASE 0x1c130000
+
+#pragma pack(1)
+typedef struct {
+ VENDOR_DEVICE_PATH Vendor;
+ EFI_DEVICE_PATH_PROTOCOL End;
+} VIRTIO_BLK_DEVICE_PATH;
+#pragma pack()
+
+VIRTIO_BLK_DEVICE_PATH mVirtioBlockDevicePath =
+{
+ {
+ {
+ HARDWARE_DEVICE_PATH,
+ HW_VENDOR_DP,
+ {
+ (UINT8)( sizeof(VENDOR_DEVICE_PATH) ),
+ (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8)
+ }
+ },
+ EFI_CALLER_ID_GUID,
+ },
+ {
+ END_DEVICE_PATH_TYPE,
+ END_ENTIRE_DEVICE_PATH_SUBTYPE,
+ {
+ sizeof (EFI_DEVICE_PATH_PROTOCOL),
+ 0
+ }
+ }
+};
+
+EFI_STATUS
+EFIAPI
+ArmFvpInitialise (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ EFI_STATUS Status;
+
+ Status = gBS->InstallProtocolInterface (&ImageHandle,
+ &gEfiDevicePathProtocolGuid, EFI_NATIVE_INTERFACE,
+ &mVirtioBlockDevicePath);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ // Declare the Virtio BlockIo device
+ Status = VirtioMmioInstallDevice (ARM_FVP_BASE_VIRTIO_BLOCK_BASE, ImageHandle);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "ArmFvpDxe: Failed to install Virtio block device\n"));
+ }
+
+ return Status;
+}
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf b/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
index 893fd8d41..bc7475878 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
@@ -1,35 +1,35 @@
-#/** @file
-#
-# Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
-#
-# 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 = 0x00010006
- BASE_NAME = ArmFvpDxe
- FILE_GUID = fe61bb5f-1b67-4c24-b346-73db42e873e5
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = ArmFvpInitialise
-
-[Sources.common]
- ArmFvpDxe.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- OvmfPkg/OvmfPkg.dec
-
-[LibraryClasses]
- UefiDriverEntryPoint
- UefiBootServicesTableLib
- VirtioMmioDeviceLib
- BaseMemoryLib
+#/** @file
+#
+# Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
+#
+# 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 = 0x00010006
+ BASE_NAME = ArmFvpDxe
+ FILE_GUID = fe61bb5f-1b67-4c24-b346-73db42e873e5
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = ArmFvpInitialise
+
+[Sources.common]
+ ArmFvpDxe.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ ArmPlatformPkg/ArmPlatformPkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ UefiDriverEntryPoint
+ UefiBootServicesTableLib
+ VirtioMmioDeviceLib
+ BaseMemoryLib
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
index 5ea1d9008..1536fb4f6 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2012, ARM Limited. All rights reserved.
+# Copyright (c) 2012-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -60,9 +60,9 @@
GCC:*_*_ARM_PP_FLAGS = -DARM_BIGLITTLE_TC2=1
!endif
- RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 --fpu=softvfp -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7
+ RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7
- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15-A7
@@ -257,6 +257,11 @@
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/HdLcdGraphicsOutputDxe.inf
ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
+
+ # SMBIOS Support
+
+ ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
+ MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
#
# Filesystems
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf
index 948985c6b..c19d1b0de 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.fdf
@@ -25,7 +25,7 @@
################################################################################
[FD.ARM_VEXPRESS_CTA15A7_EFI]
-BaseAddress = 0x81000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in remapped DRAM.
+BaseAddress = 0xB0000000|gArmTokenSpaceGuid.PcdFdBaseAddress # The base address of the Firmware in remapped DRAM.
Size = 0x000D5000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device
ErasePolarity = 1
BlockSize = 0x00001000
@@ -104,6 +104,12 @@ READ_LOCK_STATUS = TRUE
#
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+
+ #
+ # SMBIOS Support
+ #
+ INF ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
+ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
#
# Filesystems
@@ -151,7 +157,7 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/Bds/Bds.inf
[FV.FVMAIN_COMPACT]
-FvBaseAddress = 0x81000000
+FvBaseAddress = 0xB0000000
FvForceRebase = TRUE
FvAlignment = 8
ERASE_POLARITY = 1
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.dsc
index 79b5b2018..fa5809e55 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.dsc
@@ -275,19 +275,6 @@
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # SMBIOS Support
- #
- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
- # ACPI Support
- #
- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- ArmPkg/Drivers/AcpiTables/rtsm_ve-v7/AcpiTables.inf
-
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.fdf
index f28a0aa8d..0fa16c070 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15x2.fdf
@@ -143,19 +143,6 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # SMBIOS Support
- #
- INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
- # ACPI Support
- #
- INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- INF RuleOverride=ACPITABLE ArmPkg/Drivers/AcpiTables/rtsm_ve-v7/AcpiTables.inf
-
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
@@ -354,11 +341,3 @@ READ_LOCK_STATUS = TRUE
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
-
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc
index e28d79f78..c82b95cd5 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.dsc
@@ -266,19 +266,6 @@
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # SMBIOS Support
- #
- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
- # ACPI Support
- #
- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- ArmPkg/Drivers/AcpiTables/rtsm_ve-v7/AcpiTables.inf
-
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.fdf
index 109061803..0dc616525 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA5s.fdf
@@ -143,19 +143,6 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # SMBIOS Support
- #
- INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
- # ACPI Support
- #
- INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- INF RuleOverride=ACPITABLE ArmPkg/Drivers/AcpiTables/rtsm_ve-v7/AcpiTables.inf
-
INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
INF ArmPlatformPkg/Drivers/SP804TimerDxe/SP804TimerDxe.inf
INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
@@ -337,11 +324,3 @@ READ_LOCK_STATUS = TRUE
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
-
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
index 2c3ef61ca..15ed617b4 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA9x4.dsc
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -81,9 +81,9 @@
[BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4
- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4
- XCODE:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4
+ XCODE:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4
################################################################################
#
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc
index db61aa8e0..430c18e2a 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc
@@ -46,6 +46,10 @@
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
+ # Virtio Support
+ VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
+ VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+
[LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibSec.inf
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
@@ -281,6 +285,12 @@
!endif
#
+ # Platform Driver
+ #
+ ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+
+ #
# FAT filesystem + GPT/MBR partitioning
#
MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf
index 1ceb7cbdf..1e2a613a3 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.fdf
@@ -200,6 +200,12 @@ READ_LOCK_STATUS = TRUE
!endif
#
+ # Platform Driver
+ #
+ INF ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+
+ #
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellBinPkg/UefiShell/UefiShell.inf
@@ -351,8 +357,6 @@ READ_LOCK_STATUS = TRUE
[Rule.Common.USER_DEFINED.ACPITABLE]
FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
}
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
index 6844f378f..f67cda4bb 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -46,6 +46,10 @@
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
+ # Virtio Support
+ VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
+ VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+
[LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
@@ -54,7 +58,7 @@
[BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@@ -136,13 +140,19 @@
gArmPlatformTokenSpaceGuid.PcdPL180MciBaseAddress|0x1C050000
#
- # ARM General Interrupt Controller
+ # Select network device based on build time macro
+!if $(EDK2_ARMVE_SUPPORT_QEMU) == 1
+ # Ethernet (SMSC 9118, for QEMU, matches real hardware)
+ gArmPlatformTokenSpaceGuid.PcdLan9118DxeBaseAddress|0x1A000000
+!else
+ # Ethernet (SMSC 91C111, for RTSM)
+ gArmPlatformTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1A000000
+!endif
+
#
gArmTokenSpaceGuid.PcdGicDistributorBase|0x2C001000
gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x2C002000
- # Ethernet (SMSC 91C111)
- gArmPlatformTokenSpaceGuid.PcdLan91xDxeBaseAddress|0x1A000000
#
# ARM OS Loader
@@ -262,6 +272,12 @@
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+
+ #
+ # Platform Driver
+ #
+ ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FAT filesystem + GPT/MBR partitioning
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf
index ed3787794..6e1202b1d 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.fdf
@@ -144,7 +144,13 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/Network/Udp4Dxe/Udp4Dxe.inf
INF MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
INF MdeModulePkg/Universal/Network/IScsiDxe/IScsiDxe.inf
+!if $(EDK2_ARMVE_SUPPORT_QEMU) == 1
+ # LAN9118Dxe.inf for QEMU (matches use of 9118 on real VExpress board)
+ INF ArmPlatformPkg/Drivers/LAN9118Dxe/LAN9118Dxe.inf
+!else
+ # LAN91xDxe.inf for RTSM
INF ArmPlatformPkg/Drivers/LAN91xDxe/LAN91xDxe.inf
+!endif
#
# Multiple Console IO support
@@ -181,6 +187,12 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
#
+ # Platform Driver
+ #
+ INF ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+
+ #
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellBinPkg/UefiShell/UefiShell.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
index f46f16e40..8f26342ad 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -46,6 +46,10 @@
TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
+ # Virtio Support
+ VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
+ VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+
[LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
@@ -54,7 +58,7 @@
[BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
XCODE:*_*_ARM_PLATFORM_FLAGS = -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
@@ -253,6 +257,12 @@
ArmPkg/Drivers/TimerDxe/TimerDxe.inf
ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf
ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
+
+ #
+ # SMBIOS Support
+ #
+ ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
+ MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
#
# Semi-hosting filesystem
@@ -264,6 +274,12 @@
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+
+ #
+ # Platform Driver
+ #
+ ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FAT filesystem + GPT/MBR partitioning
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf
index 837985aae..6d25bd1d1 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.fdf
@@ -162,6 +162,12 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
#
+ # SMBIOS Support
+ #
+ INF ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
+ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
+
+ #
# Semi-hosting filesystem
#
INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
@@ -181,6 +187,12 @@ READ_LOCK_STATUS = TRUE
INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
#
+ # Platform Driver
+ #
+ INF ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+
+ #
# UEFI application (Shell Embedded Boot Loader)
#
INF ShellBinPkg/UefiShell/UefiShell.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
index 337bf6bcb..035f70498 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -44,6 +44,11 @@
#DebugAgentTimerLib|ArmPlatformPkg/ArmVExpressPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
+
+ # Virtio Support
+ VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
+ VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+
[LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
ArmPlatformSecLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSecLibRTSM/ArmVExpressSecLib.inf
@@ -55,9 +60,9 @@
[BuildOptions]
RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
- GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
+ GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a9 -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
- XCODE:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a -mfpu=neon -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
+ XCODE:*_*_ARM_PLATFORM_FLAGS == -march=armv7-a -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include -I$(WORKSPACE)/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM
################################################################################
#
@@ -280,6 +285,12 @@
#
EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
+
+ #
+ # Platform Driver
+ #
+ ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
#
# FAT filesystem + GPT/MBR partitioning
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf
index 75f18e4f2..45e82c223 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.fdf
@@ -185,7 +185,13 @@ READ_LOCK_STATUS = TRUE
#
INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
-
+
+ #
+ # Platform Driver
+ #
+ INF ArmPlatformPkg/ArmVExpressPkg/ArmFvpDxe/ArmFvpDxe.inf
+ INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+
#
# UEFI application (Shell Embedded Boot Loader)
#
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc
index 0654ebb0b..2942b99ac 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc
@@ -80,13 +80,9 @@
gArmTokenSpaceGuid.PcdVFPEnabled|1
# Stacks for MPCores in Secure World (No SRAM on foundation model, put in RAM at 64MB)
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0xA4009000
+ gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0xA4008000
gArmPlatformTokenSpaceGuid.PcdCPUCoreSecPrimaryStackSize|0x1000
- # Stacks for MPCores in Monitor Mod (No SRAM on foundation model, put in RAM at 64MB)
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0xA4008000
- gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x100
-
# Stacks for MPCores in Normal World (No SRAM on foundation model, put in RAM at 64MB)
gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0xA4000000
gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
@@ -219,18 +215,6 @@
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # ACPI Support
- #
- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- ArmPkg/Drivers/AcpiTables/foundation-v8/AcpiTables.inf
- #
- # SMBIOS Support
- #
- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
ArmPkg/Drivers/TimerDxe/TimerDxe.inf
MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf
index c070c571e..bfb6cdf3d 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.fdf
@@ -129,19 +129,6 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
#
- # ACPI Support
- #
- INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- INF RuleOverride=ACPITABLE ArmPkg/Drivers/AcpiTables/foundation-v8/AcpiTables.inf
-
- #
- # SMBIOS Support
- #
- INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
# Multiple Console IO support
#
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
@@ -325,11 +312,3 @@ READ_LOCK_STATUS = TRUE
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
-
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc
index d61eb5d4c..5d22f1d9b 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc
@@ -241,19 +241,6 @@
MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
- #
- # ACPI Support
- #
- MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
-
- #
- # SMBIOS Support
- #
- MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
ArmPkg/Drivers/TimerDxe/TimerDxe.inf
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf
index 107e8d415..5e34115cb 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf
+++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.fdf
@@ -131,19 +131,6 @@ READ_LOCK_STATUS = TRUE
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
#
- # ACPI Support
- #
- INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
- INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
- INF RuleOverride=ACPITABLE ArmPkg/Drivers/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
-
- #
- # SMBIOS Support
- #
- INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
- INF ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
-
- #
# Multiple Console IO support
#
INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
@@ -336,10 +323,3 @@ READ_LOCK_STATUS = TRUE
UI STRING="$(MODULE_NAME)" Optional
VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
}
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15x2/ArmPlatform.h b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15x2/ArmPlatform.h
index 19d551dab..5454b003e 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15x2/ArmPlatform.h
+++ b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA15x2/ArmPlatform.h
@@ -53,8 +53,8 @@
#define ARM_VE_SMB_PERIPH_SZ SIZE_64MB
// DRAM
-#define ARM_VE_DRAM_BASE PcdGet32 (PcdSystemMemoryBase)
-#define ARM_VE_DRAM_SZ PcdGet32 (PcdSystemMemorySize)
+#define ARM_VE_DRAM_BASE PcdGet64 (PcdSystemMemoryBase)
+#define ARM_VE_DRAM_SZ PcdGet64 (PcdSystemMemorySize)
// This can be any value since we only support motherboard PL111
#define LCD_VRAM_CORE_TILE_BASE 0x84000000
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA5s/ArmPlatform.h b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA5s/ArmPlatform.h
index 4efd10e78..990e407a8 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA5s/ArmPlatform.h
+++ b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA5s/ArmPlatform.h
@@ -53,8 +53,8 @@
#define ARM_VE_SMB_PERIPH_SZ SIZE_64MB
// DRAM
-#define ARM_VE_DRAM_BASE PcdGet32 (PcdSystemMemoryBase)
-#define ARM_VE_DRAM_SZ PcdGet32 (PcdSystemMemorySize)
+#define ARM_VE_DRAM_BASE PcdGet64 (PcdSystemMemoryBase)
+#define ARM_VE_DRAM_SZ PcdGet64 (PcdSystemMemorySize)
// This can be any value since we only support motherboard PL111
#define LCD_VRAM_CORE_TILE_BASE 0x84000000
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4/ArmPlatform.h b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4/ArmPlatform.h
index 06537a428..b692b168c 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4/ArmPlatform.h
+++ b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/CTA9x4/ArmPlatform.h
@@ -52,8 +52,8 @@
#define ARM_VE_SMB_PERIPH_SZ SIZE_64MB
// DRAM
-#define ARM_VE_DRAM_BASE PcdGet32 (PcdSystemMemoryBase)
-#define ARM_VE_DRAM_SZ PcdGet32 (PcdSystemMemorySize)
+#define ARM_VE_DRAM_BASE PcdGet64 (PcdSystemMemoryBase)
+#define ARM_VE_DRAM_SZ PcdGet64 (PcdSystemMemorySize)
// Inside the DRAM we allocate a section for the VRAM (Video RAM)
#define LCD_VRAM_CORE_TILE_BASE 0x64000000
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h
index b568d6fa2..06414e6e7 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h
+++ b/ArmPlatformPkg/ArmVExpressPkg/Include/Platform/RTSM/ArmPlatform.h
@@ -45,8 +45,8 @@
#define ARM_VE_SMB_PERIPH_SZ SIZE_64MB
// DRAM
-#define ARM_VE_DRAM_BASE PcdGet32 (PcdSystemMemoryBase)
-#define ARM_VE_DRAM_SZ PcdGet32 (PcdSystemMemorySize)
+#define ARM_VE_DRAM_BASE PcdGet64 (PcdSystemMemoryBase)
+#define ARM_VE_DRAM_SZ PcdGet64 (PcdSystemMemorySize)
// This can be any value since we only support motherboard PL111
#define LCD_VRAM_CORE_TILE_BASE 0x00000000
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S
index b560f56c5..ac5378a62 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.S
@@ -22,6 +22,7 @@
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
ASM_PFX(ArmPlatformPeiBootAction):
bx lr
@@ -66,3 +67,23 @@ ASM_PFX(ArmPlatformIsPrimaryCore):
movne r0, #0
bx lr
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
+ // Extract cpu_id and cluster_id from ARM_SCC_CFGREG48
+ // with cpu_id[0:3] and cluster_id[4:7]
+ LoadConstantToReg (ARM_CTA15A7_SCC_CFGREG48, r0)
+ ldr r0, [r0]
+ lsr r0, #24
+
+ // Shift the SCC value to get the cluster ID at the offset #8
+ lsl r1, r0, #4
+ and r1, r1, #0xF00
+
+ // Keep only the cpu ID from the original SCC
+ and r0, r0, #0x0F
+ // Add the Cluster ID to the Cpu ID
+ orr r0, r0, r1
+ bx lr
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm
index ec2093adc..2e323a1dd 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Helper.asm
@@ -21,6 +21,7 @@
EXPORT ArmPlatformPeiBootAction
EXPORT ArmPlatformGetCorePosition
EXPORT ArmPlatformIsPrimaryCore
+ EXPORT ArmPlatformGetPrimaryCoreMpId
PRESERVE8
AREA CTA15A7Helper, CODE, READONLY
@@ -71,4 +72,26 @@ ArmPlatformIsPrimaryCore FUNCTION
bx lr
ENDFUNC
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ArmPlatformGetPrimaryCoreMpId FUNCTION
+ // Extract cpu_id and cluster_id from ARM_SCC_CFGREG48
+ // with cpu_id[0:3] and cluster_id[4:7]
+ LoadConstantToReg (ARM_CTA15A7_SCC_CFGREG48, r0)
+ ldr r0, [r0]
+ lsr r0, #24
+
+ // Shift the SCC value to get the cluster ID at the offset #8
+ lsl r1, r0, #4
+ and r1, r1, #0xF00
+
+ // Keep only the cpu ID from the original SCC
+ and r0, r0, #0x0F
+ // Add the Cluster ID to the Cpu ID
+ orr r0, r0, r1
+ bx lr
+ ENDFUNC
+
END
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
index 473b3f323..e633c8937 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA15-A7/CTA15-A7Mem.c
@@ -136,18 +136,18 @@ ArmPlatformGetVirtualMemoryMap (
#ifndef ARM_BIGLITTLE_TC2
// Workaround for SRAM bug in RTSM
- if (PcdGet32 (PcdSystemMemoryBase) != 0x80000000) {
+ if (PcdGet64 (PcdSystemMemoryBase) != 0x80000000) {
VirtualMemoryTable[++Index].PhysicalBase = 0x80000000;
VirtualMemoryTable[Index].VirtualBase = 0x80000000;
- VirtualMemoryTable[Index].Length = PcdGet32 (PcdSystemMemoryBase) - 0x80000000;
+ VirtualMemoryTable[Index].Length = PcdGet64 (PcdSystemMemoryBase) - 0x80000000;
VirtualMemoryTable[Index].Attributes = CacheAttributes;
}
#endif
// DDR
- VirtualMemoryTable[++Index].PhysicalBase = PcdGet32 (PcdSystemMemoryBase);
- VirtualMemoryTable[Index].VirtualBase = PcdGet32 (PcdSystemMemoryBase);
- VirtualMemoryTable[Index].Length = PcdGet32 (PcdSystemMemorySize);
+ VirtualMemoryTable[++Index].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].Length = PcdGet64 (PcdSystemMemorySize);
VirtualMemoryTable[Index].Attributes = CacheAttributes;
// Detect if it is a 1GB or 2GB Test Chip
@@ -159,13 +159,13 @@ ArmPlatformGetVirtualMemoryMap (
EFI_RESOURCE_ATTRIBUTE_PRESENT | EFI_RESOURCE_ATTRIBUTE_INITIALIZED | EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
EFI_RESOURCE_ATTRIBUTE_TESTED,
- PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize),
+ PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize),
SIZE_1GB
);
// Map the additional 1GB into the MMU
- VirtualMemoryTable[++Index].PhysicalBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize);
- VirtualMemoryTable[Index].VirtualBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize);
+ VirtualMemoryTable[++Index].PhysicalBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize);
VirtualMemoryTable[Index].Length = SIZE_1GB;
VirtualMemoryTable[Index].Attributes = CacheAttributes;
}
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S
index e12b8cd4e..d419bcfea 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.S
@@ -19,6 +19,7 @@
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)
@@ -29,7 +30,7 @@ GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask)
// VOID
// );
ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm
index 9508cedd8..e969db874 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4Helper.asm
@@ -33,7 +33,7 @@
// VOID
// );
ArmPlatformGetPrimaryCoreMpId FUNCTION
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
ENDFUNC
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S
index 50703ec27..b24085cb2 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/AArch64/RTSMHelper.S
@@ -22,6 +22,7 @@
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
GCC_ASM_EXPORT(ArmGetCpuCountPerCluster)
@@ -32,6 +33,15 @@ GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdCoreCount)
ASM_PFX(ArmPlatformPeiBootAction):
ret
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, x0)
+ ldrh w0, [x0]
+ ret
+
# IN None
# OUT x0 = number of cores present in the system
ASM_PFX(ArmGetCpuCountPerCluster):
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.S b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.S
index 95006c5f2..04651e7ea 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.S
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.S
@@ -49,7 +49,7 @@ ASM_PFX(ArmGetScuBaseAddress):
// VOID
// );
ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
diff --git a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm
index 5befec31e..bcc56ca56 100644
--- a/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm
+++ b/ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibRTSM/Arm/RTSMHelper.asm
@@ -52,7 +52,7 @@ ArmGetScuBaseAddress FUNCTION
// VOID
// );
ArmPlatformGetPrimaryCoreMpId FUNCTION
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
ENDFUNC
diff --git a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
index d1da60b5a..799ead968 100644
--- a/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
+++ b/ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805Watchdog.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2012, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -36,7 +36,7 @@ EFI_EVENT EfiExitBootServicesEvent = (EFI_EVENT)NULL;
i.e. it inhibits all writes to avoid rogue software accidentally
corrupting their contents.
**/
-inline
+STATIC
VOID
SP805Unlock (
VOID
@@ -54,7 +54,7 @@ SP805Unlock (
i.e. it inhibits all writes to avoid rogue software accidentally
corrupting their contents.
**/
-inline
+STATIC
VOID
SP805Lock (
VOID
@@ -69,7 +69,7 @@ SP805Lock (
/**
Stop the SP805 watchdog timer from counting down by disabling interrupts.
**/
-inline
+STATIC
VOID
SP805Stop (
VOID
@@ -86,7 +86,7 @@ SP805Stop (
The count down will start from the value stored in the Load register,
not from the value where it was previously stopped.
**/
-inline
+STATIC
VOID
SP805Start (
VOID
diff --git a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
index 47430e302..02cbb00da 100644
--- a/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
+++ b/ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.c
@@ -19,8 +19,8 @@
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
-#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize))) || \
- ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet32 (PcdSystemMemoryBase)))
+#define IS_XIP() (((UINT32)PcdGet32 (PcdFdBaseAddress) > (UINT32)(PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize))) || \
+ ((PcdGet32 (PcdFdBaseAddress) + PcdGet32 (PcdFdSize)) < PcdGet64 (PcdSystemMemoryBase)))
// Declared by ArmPlatformPkg/PrePi Module
extern UINTN mGlobalVariableBase;
@@ -40,7 +40,7 @@ ArmPlatformGetGlobalVariable (
if (IS_XIP()) {
// In Case of XIP, we expect the Primary Stack at the top of the System Memory
// The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
} else {
GlobalVariableBase = mGlobalVariableBase;
}
@@ -69,7 +69,7 @@ ArmPlatformSetGlobalVariable (
if (IS_XIP()) {
// In Case of XIP, we expect the Primary Stack at the top of the System Memory
// The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
} else {
GlobalVariableBase = mGlobalVariableBase;
}
@@ -96,7 +96,7 @@ ArmPlatformGetGlobalVariableAddress (
if (IS_XIP()) {
// In Case of XIP, we expect the Primary Stack at the top of the System Memory
// The size must be 64bit aligned to allow 64bit variable to be aligned
- GlobalVariableBase = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
+ GlobalVariableBase = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize) - ALIGN_VALUE(PcdGet32 (PcdPeiGlobalVariableSize),0x8);
} else {
GlobalVariableBase = mGlobalVariableBase;
}
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S
index 49f3fde66..1fc6b7af5 100644
--- a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.S
@@ -43,7 +43,7 @@ ASM_PFX(ArmPlatformGetCorePosition):
// VOID
// );
ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
diff --git a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
index 6047ca25c..5cdf6fa1a 100644
--- a/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
+++ b/ArmPlatformPkg/Library/ArmPlatformLibNull/Arm/ArmPlatformHelper.asm
@@ -47,7 +47,7 @@ ArmPlatformGetCorePosition FUNCTION
// VOID
// );
ArmPlatformGetPrimaryCoreMpId FUNCTION
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCoreMask, r0)
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
ldr r0, [r0]
bx lr
ENDFUNC
diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S
index 34fab31dd..96e925981 100644
--- a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S
+++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.S
@@ -22,10 +22,11 @@ GCC_ASM_EXPORT(ArmPlatformStackSet)
GCC_ASM_EXPORT(ArmPlatformStackSetPrimary)
GCC_ASM_EXPORT(ArmPlatformStackSetSecondary)
+GCC_ASM_IMPORT(ArmPlatformIsPrimaryCore)
GCC_ASM_IMPORT(ArmPlatformGetCorePosition)
+GCC_ASM_IMPORT(ArmPlatformGetPrimaryCoreMpId)
GCC_ASM_IMPORT(gPcd_FixedAtBuild_PcdCoreCount)
-GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)
//VOID
//ArmPlatformStackSet (
@@ -35,14 +36,29 @@ GCC_ASM_IMPORT(_gPcd_FixedAtBuild_PcdArmPrimaryCore)
// IN UINTN SecondaryStackSize
// );
ASM_PFX(ArmPlatformStackSet):
+ // Save parameters
+ mov r6, r3
+ mov r5, r2
+ mov r4, r1
+ mov r3, r0
+
+ // Save the Link register
+ mov r7, lr
+
// Identify Stack
- // Mask for ClusterId|CoreId
- LoadConstantToReg (0xFFFF, r4)
- and r1, r1, r4
- // Is it the Primary Core ?
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r4)
- ldr r4, [r4]
- cmp r1, r4
+ mov r0, r1
+ bl ASM_PFX(ArmPlatformIsPrimaryCore)
+ cmp r0, #1
+
+ // Restore parameters
+ mov r0, r3
+ mov r1, r4
+ mov r2, r5
+ mov r3, r6
+
+ // Restore the Link register
+ mov lr, r7
+
beq ASM_PFX(ArmPlatformStackSetPrimary)
bne ASM_PFX(ArmPlatformStackSetSecondary)
@@ -87,8 +103,7 @@ ASM_PFX(ArmPlatformStackSetSecondary):
mov r5, r0
// Get Primary Core Position
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
- ldr r0, [r0]
+ bl ASM_PFX(ArmPlatformGetPrimaryCoreMpId)
bl ASM_PFX(ArmPlatformGetCorePosition)
// Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1)
diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm
index db9202392..e7fd4a06a 100644
--- a/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm
+++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/Arm/ArmPlatformStackLib.asm
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2012, ARM Limited. All rights reserved.
+// Copyright (c) 2012-2013, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -21,10 +21,11 @@
EXPORT ArmPlatformStackSetPrimary
EXPORT ArmPlatformStackSetSecondary
+ IMPORT ArmPlatformIsPrimaryCore
IMPORT ArmPlatformGetCorePosition
+ IMPORT ArmPlatformGetPrimaryCoreMpId
IMPORT _gPcd_FixedAtBuild_PcdCoreCount
- IMPORT _gPcd_FixedAtBuild_PcdArmPrimaryCore
PRESERVE8
AREA ArmPlatformStackLib, CODE, READONLY
@@ -37,14 +38,29 @@
// IN UINTN SecondaryStackSize
// );
ArmPlatformStackSet FUNCTION
+ // Save parameters
+ mov r6, r3
+ mov r5, r2
+ mov r4, r1
+ mov r3, r0
+
+ // Save the Link register
+ mov r7, lr
+
// Identify Stack
- // Mask for ClusterId|CoreId
- LoadConstantToReg (0xFFFF, r4)
- and r1, r1, r4
- // Is it the Primary Core ?
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r4)
- ldr r4, [r4]
- cmp r1, r4
+ mov r0, r1
+ bl ArmPlatformIsPrimaryCore
+ cmp r0, #1
+
+ // Restore parameters
+ mov r0, r3
+ mov r1, r4
+ mov r2, r5
+ mov r3, r6
+
+ // Restore the Link register
+ mov lr, r7
+
beq ArmPlatformStackSetPrimary
bne ArmPlatformStackSetSecondary
ENDFUNC
@@ -91,8 +107,7 @@ ArmPlatformStackSetSecondary FUNCTION
mov r5, r0
// Get Primary Core Position
- LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
- ldr r0, [r0]
+ bl ArmPlatformGetPrimaryCoreMpId
bl ArmPlatformGetCorePosition
// Get Secondary Core Position. We should get consecutive secondary stack number from 1...(CoreCount-1)
diff --git a/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf b/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
index 700bc89ea..affd32196 100644
--- a/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
+++ b/ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
@@ -33,10 +33,8 @@
[Sources.AARCH64]
AArch64/ArmPlatformStackLib.S | GCC
-[FixedPcd]
- gArmPlatformTokenSpaceGuid.PcdCoreCount
+[LibraryClasses]
+ ArmPlatformLib
+[FixedPcd]
gArmPlatformTokenSpaceGuid.PcdCoreCount
-
- gArmTokenSpaceGuid.PcdArmPrimaryCoreMask
- gArmTokenSpaceGuid.PcdArmPrimaryCore
diff --git a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
index cb0041f90..8be91c000 100644
--- a/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
+++ b/ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
@@ -67,4 +67,24 @@ GetPeiServicesTablePointer (
return (CONST EFI_PEI_SERVICES**)PeiServicesTablePointer;
}
+/**
+ Perform CPU specific actions required to migrate the PEI Services Table
+ pointer from temporary RAM to permanent RAM.
+
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
+ a dedicated CPU register. This means that there is no memory storage
+ associated with storing the PEI Services Table pointer, so no additional
+ migration actions are required for Itanium or ARM CPUs.
+**/
+VOID
+EFIAPI
+MigratePeiServicesTablePointer (
+ )
+{
+ return;
+}
diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
index d1bf394c4..0214897d8 100755
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.c
@@ -78,7 +78,7 @@ MemoryPeim (
BOOLEAN Found;
// Ensure PcdSystemMemorySize has been set
- ASSERT (PcdGet32 (PcdSystemMemorySize) != 0);
+ ASSERT (PcdGet64 (PcdSystemMemorySize) != 0);
//
// Now, the permanent memory has been installed, we can call AllocatePages()
@@ -97,16 +97,16 @@ MemoryPeim (
BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
ResourceAttributes,
- PcdGet32 (PcdSystemMemoryBase),
- PcdGet32 (PcdSystemMemorySize)
+ PcdGet64 (PcdSystemMemoryBase),
+ PcdGet64 (PcdSystemMemorySize)
);
- SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemoryBase) + (EFI_PHYSICAL_ADDRESS)PcdGet32 (PcdSystemMemorySize);
+ SystemMemoryTop = (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemoryBase) + (EFI_PHYSICAL_ADDRESS)PcdGet64 (PcdSystemMemorySize);
FdTop = (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdBaseAddress) + (EFI_PHYSICAL_ADDRESS)PcdGet32(PcdFdSize);
// EDK2 does not have the concept of boot firmware copied into DRAM. To avoid the DXE
// core to overwrite this area we must mark the region with the attribute non-present
- if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet32 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
+ if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet64 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
Found = FALSE;
// Search for System Memory Hob that contains the firmware
diff --git a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
index 1de7d3807..c6a6fe64b 100755
--- a/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
+++ b/ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.c
@@ -104,10 +104,10 @@ InitializeMemory (
DEBUG ((EFI_D_ERROR, "Memory Init PEIM Loaded\n"));
// Ensure PcdSystemMemorySize has been set
- ASSERT (FixedPcdGet32 (PcdSystemMemorySize) != 0);
+ ASSERT (FixedPcdGet64 (PcdSystemMemorySize) != 0);
- SystemMemoryBase = (UINTN)FixedPcdGet32 (PcdSystemMemoryBase);
- SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet32 (PcdSystemMemorySize);
+ SystemMemoryBase = (UINTN)FixedPcdGet64 (PcdSystemMemoryBase);
+ SystemMemoryTop = SystemMemoryBase + (UINTN)FixedPcdGet64 (PcdSystemMemorySize);
FdBase = (UINTN)PcdGet32 (PcdFdBaseAddress);
FdTop = FdBase + (UINTN)PcdGet32 (PcdFdSize);
diff --git a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.c b/ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.c
index bd2d7008c..33db76a29 100644
--- a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.c
+++ b/ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.c
@@ -1,23 +1,46 @@
/** @file
+ Static SMBIOS Table for ARM platform
+ Derived from EmulatorPkg package
+
+ Note SMBIOS 2.7.1 Required structures:
+ BIOS Information (Type 0)
+ System Information (Type 1)
+ Board Information (Type 2)
+ System Enclosure (Type 3)
+ Processor Information (Type 4) - CPU Driver
+ Cache Information (Type 7) - For cache that is external to processor
+ System Slots (Type 9) - If system has slots
+ Physical Memory Array (Type 16)
+ Memory Device (Type 17) - For each socketed system-memory Device
+ Memory Array Mapped Address (Type 19) - One per contiguous block per Physical Memroy Array
+ System Boot Information (Type 32)
+
+ Copyright (c) 2012, Apple Inc. All rights reserved.<BR>
+ Copyright (c) 2013 Linaro.org
+ 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.
- This code responsible for constructing and updating SMBIOS table into system table.
-Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
-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 "UpdateSmbios.h"
-
-
+//#include <PiDxe.h>
+#include <Protocol/Smbios.h>
+#include <IndustryStandard/SmBios.h>
+#include <Guid/SmBios.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiDriverEntryPoint.h>
+#include <Library/UefiLib.h>
+#include <Library/BaseLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
/***********************************************************************
SMBIOS data definition TYPE0 BIOS Information
************************************************************************/
-
SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
{ EFI_SMBIOS_TYPE_BIOS_INFORMATION, sizeof (SMBIOS_TABLE_TYPE0), 0 },
1, // Vendor String
@@ -32,7 +55,7 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
0, // IsaIsSupported :1;
0, // McaIsSupported :1;
0, // EisaIsSupported :1;
- 1, // PciIsSupported :1;
+ 0, // PciIsSupported :1;
0, // PcmciaIsSupported :1;
0, // PlugAndPlayIsSupported :1;
0, // ApmIsSupported :1;
@@ -83,15 +106,13 @@ SMBIOS_TABLE_TYPE0 mBIOSInfoType0 = {
0xFF, // EmbeddedControllerFirmwareMinorRelease
};
-
CHAR8 *mBIOSInfoType0Strings[] = {
- "edk2.sourceforge.net", // Vendor String
- __TIME__, // BiosVersion String
- __DATE__, // BiosReleaseDate String
+ "edk2.sourceforge.net", // Vendor String
+ __TIME__, // BiosVersion String
+ __DATE__, // BiosReleaseDate String
NULL
};
-
/***********************************************************************
SMBIOS data definition TYPE1 System Information
************************************************************************/
@@ -107,8 +128,8 @@ SMBIOS_TABLE_TYPE1 mSysInfoType1 = {
6, // Family String
};
CHAR8 *mSysInfoType1Strings[] = {
- "edk2.sourceforge.net",
- "EmulatorPkg",
+ "ARM",
+ "Arm Versatile Express",
"1.0",
"System Serial#",
"System SKU#",
@@ -119,7 +140,6 @@ CHAR8 *mSysInfoType1Strings[] = {
/***********************************************************************
SMBIOS data definition TYPE2 Board Information
************************************************************************/
-
SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
{ EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION, sizeof (SMBIOS_TABLE_TYPE2), 0 },
1, // Manufacturer String
@@ -142,8 +162,8 @@ SMBIOS_TABLE_TYPE2 mBoardInfoType2 = {
{ 0 } // ContainedObjectHandles[1];
};
CHAR8 *mBoardInfoType2Strings[] = {
- "edk2.sourceforge.net",
- "EmulatorPkg",
+ "ARM",
+ "Arm Versatile Express",
"1.0",
"Base Board Serial#",
"Base Board Asset Tag#",
@@ -151,11 +171,9 @@ CHAR8 *mBoardInfoType2Strings[] = {
NULL
};
-
/***********************************************************************
SMBIOS data definition TYPE3 Enclosure Information
************************************************************************/
-
SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 = {
{ EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE, sizeof (SMBIOS_TABLE_TYPE3), 0 },
1, // Manufacturer String
@@ -175,26 +193,21 @@ SMBIOS_TABLE_TYPE3 mEnclosureInfoType3 = {
{ 0 }, // ContainedElements[1];
};
CHAR8 *mEnclosureInfoType3Strings[] = {
- "edk2.sourceforge.net",
- "EmulatorPkg",
+ "ARM",
+ "1.0",
"Chassis Board Serial#",
"Chassis Board Asset Tag#",
NULL
};
-
-
/***********************************************************************
SMBIOS data definition TYPE4 Processor Information
************************************************************************/
-
SMBIOS_TABLE_TYPE4 mProcessorInfoType4 = {
-
{ EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION, sizeof (SMBIOS_TABLE_TYPE4), 0},
-
1, // Socket String
- ProcessorOther, // ProcessorType; ///< The enumeration value from PROCESSOR_TYPE_DATA.
- ProcessorFamilyOther, // ProcessorFamily; ///< The enumeration value from PROCESSOR_FAMILY_DATA.
+ ProcessorOther, // ProcessorType; ///< The enumeration value from PROCESSOR_TYPE_DATA.
+ ProcessorFamilyIndicatorFamily2, // ProcessorFamily; ///< The enumeration value from PROCESSOR_FAMILY2_DATA.
2, // ProcessorManufacture String;
{ // ProcessorId;
{ // PROCESSOR_SIGNATURE
@@ -266,25 +279,22 @@ SMBIOS_TABLE_TYPE4 mProcessorInfoType4 = {
0, // EnabledCoreCount;
0, // ThreadCount;
0, // ProcessorCharacteristics;
- 0, // ProcessorFamily2;
+ ProcessorFamilyARM, // ARM Processor Family;
};
-
CHAR8 *mProcessorInfoType4Strings[] = {
"Socket",
- "edk2.svn.sourceforge.net",
- "Emulated Processor",
+ "ARM",
+ "v7",
"1.0",
"1.0",
"1.0",
NULL
};
-
/***********************************************************************
SMBIOS data definition TYPE7 Cache Information
************************************************************************/
-
SMBIOS_TABLE_TYPE7 mCacheInfoType7 = {
{ EFI_SMBIOS_TYPE_CACHE_INFORMATION, sizeof (SMBIOS_TABLE_TYPE7), 0 },
1, // SocketDesignation String
@@ -321,11 +331,9 @@ CHAR8 *mCacheInfoType7Strings[] = {
NULL
};
-
/***********************************************************************
SMBIOS data definition TYPE9 System Slot Information
************************************************************************/
-
SMBIOS_TABLE_TYPE9 mSysSlotInfoType9 = {
{ EFI_SMBIOS_TYPE_SYSTEM_SLOTS, sizeof (SMBIOS_TABLE_TYPE9), 0 },
1, // SlotDesignation String
@@ -362,7 +370,6 @@ CHAR8 *mSysSlotInfoType9Strings[] = {
/***********************************************************************
SMBIOS data definition TYPE16 Physical Memory ArrayInformation
************************************************************************/
-
SMBIOS_TABLE_TYPE16 mPhyMemArrayInfoType16 = {
{ EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY, sizeof (SMBIOS_TABLE_TYPE16), 0 },
MemoryArrayLocationSystemBoard, // Location; ///< The enumeration value from MEMORY_ARRAY_LOCATION.
@@ -380,7 +387,6 @@ CHAR8 *mPhyMemArrayInfoType16Strings[] = {
/***********************************************************************
SMBIOS data definition TYPE17 Memory Device Information
************************************************************************/
-
SMBIOS_TABLE_TYPE17 mMemDevInfoType17 = {
{ EFI_SMBIOS_TYPE_MEMORY_DEVICE, sizeof (SMBIOS_TABLE_TYPE17), 0 },
0, // MemoryArrayHandle;
@@ -430,7 +436,6 @@ CHAR8 *mMemDevInfoType17Strings[] = {
/***********************************************************************
SMBIOS data definition TYPE19 Memory Array Mapped Address Information
************************************************************************/
-
SMBIOS_TABLE_TYPE19 mMemArrMapInfoType19 = {
{ EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS, sizeof (SMBIOS_TABLE_TYPE19), 0 },
0x80000000, // StartingAddress;
@@ -444,13 +449,9 @@ CHAR8 *mMemArrMapInfoType19Strings[] = {
NULL
};
-
-
-
/***********************************************************************
SMBIOS data definition TYPE32 Boot Information
************************************************************************/
-
SMBIOS_TABLE_TYPE32 mBootInfoType32 = {
{ EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION, sizeof (SMBIOS_TABLE_TYPE32), 0 },
{ 0, 0, 0, 0, 0, 0 }, // Reserved[6];
@@ -492,7 +493,6 @@ CHAR8 *mBootInfoType32Strings[] = {
NULL is OK.
**/
-
EFI_STATUS
EFIAPI
LogSmbiosData (
@@ -500,7 +500,6 @@ LogSmbiosData (
IN CHAR8 **StringPack
)
{
-
EFI_STATUS Status;
EFI_SMBIOS_PROTOCOL *Smbios;
EFI_SMBIOS_HANDLE SmbiosHandle;
@@ -513,85 +512,50 @@ LogSmbiosData (
//
// Locate Smbios protocol.
//
-
Status = gBS->LocateProtocol (&gEfiSmbiosProtocolGuid, NULL, (VOID **)&Smbios);
if (EFI_ERROR (Status)) {
-
return Status;
-
}
-
// Calculate the size of the fixed record and optional string pack
Size = Template->Length;
-
if (StringPack == NULL) {
-
// At least a double null is required
-
Size += 2;
-
} else {
-
for (Index = 0; StringPack[Index] != NULL; Index++) {
-
StringSize = AsciiStrSize (StringPack[Index]);
-
Size += StringSize;
-
}
-
- if (StringPack[0] == NULL) {
-
- // At least a double null is required
-
- Size += 1;
-
+ if (StringPack[0] == NULL) {
+ // At least a double null is required
+ Size += 1;
}
// Don't forget the terminating double null
-
Size += 1;
-
}
-
-
// Copy over Template
Record = (EFI_SMBIOS_TABLE_HEADER *)AllocateZeroPool (Size);
-
if (Record == NULL) {
-
return EFI_OUT_OF_RESOURCES;
-
}
-
CopyMem (Record, Template, Template->Length);
-
-
// Append string pack
-
Str = ((CHAR8 *)Record) + Record->Length;
-
-
for (Index = 0; StringPack[Index] != NULL; Index++) {
-
StringSize = AsciiStrSize (StringPack[Index]);
-
CopyMem (Str, StringPack[Index], StringSize);
-
Str += StringSize;
-
}
*Str = 0;
-
SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
-
Status = Smbios->Add (
Smbios,
gImageHandle,
@@ -600,33 +564,21 @@ LogSmbiosData (
);
ASSERT_EFI_ERROR (Status);
-
FreePool (Record);
-
return Status;
-
}
-
-
/***********************************************************************
SMBIOS data update TYPE0 BIOS Information
************************************************************************/
-
-
VOID
BIOSInfoUpdateSmbiosType0 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBIOSInfoType0, mBIOSInfoType0Strings);
-
}
-
-
/***********************************************************************
SMBIOS data update TYPE1 System Information
************************************************************************/
@@ -634,11 +586,8 @@ VOID
SysInfoUpdateSmbiosType1 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mSysInfoType1, mSysInfoType1Strings);
-
}
/***********************************************************************
@@ -648,11 +597,8 @@ VOID
BoardInfoUpdateSmbiosType2 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBoardInfoType2, mBoardInfoType2Strings);
-
}
/***********************************************************************
@@ -662,42 +608,25 @@ VOID
EnclosureInfoUpdateSmbiosType3 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mEnclosureInfoType3, mEnclosureInfoType3Strings);
-
}
-
/***********************************************************************
SMBIOS data update TYPE4 Processor Information
************************************************************************/
-
-
VOID
-
ProcessorInfoUpdateSmbiosType4 (
-
IN UINTN MaxCpus
-
)
-
{
-
mProcessorInfoType4.CoreCount = (UINT8) MaxCpus;
-
mProcessorInfoType4.EnabledCoreCount = (UINT8) MaxCpus;
-
mProcessorInfoType4.ThreadCount = (UINT8) MaxCpus;
-
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mProcessorInfoType4, mProcessorInfoType4Strings);
-
}
-
/***********************************************************************
SMBIOS data update TYPE7 Cache Information
************************************************************************/
@@ -705,11 +634,8 @@ VOID
CacheInfoUpdateSmbiosType7 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mCacheInfoType7, mCacheInfoType7Strings);
-
}
/***********************************************************************
@@ -719,11 +645,8 @@ VOID
SysSlotInfoUpdateSmbiosType9 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mSysSlotInfoType9, mSysSlotInfoType9Strings);
-
}
/***********************************************************************
@@ -733,11 +656,8 @@ VOID
PhyMemArrayInfoUpdateSmbiosType16 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mPhyMemArrayInfoType16, mPhyMemArrayInfoType16Strings);
-
}
/***********************************************************************
@@ -747,11 +667,8 @@ VOID
MemDevInfoUpdateSmbiosType17 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mMemDevInfoType17, mMemDevInfoType17Strings);
-
}
/***********************************************************************
@@ -761,11 +678,8 @@ VOID
MemArrMapInfoUpdateSmbiosType19 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mMemArrMapInfoType19, mMemArrMapInfoType19Strings);
-
}
@@ -776,32 +690,20 @@ VOID
BootInfoUpdateSmbiosType32 (
VOID
)
-
{
-
LogSmbiosData ((EFI_SMBIOS_TABLE_HEADER *)&mBootInfoType32, mBootInfoType32Strings);
-
}
-
/***********************************************************************
Driver Entry
************************************************************************/
-
EFI_STATUS
-
EFIAPI
-
-UpdateSmbios (
-
+PlatfomrSmbiosDriverEntryPoint (
IN EFI_HANDLE ImageHandle,
-
IN EFI_SYSTEM_TABLE *SystemTable
-
)
-
{
-
BIOSInfoUpdateSmbiosType0();
SysInfoUpdateSmbiosType1();
@@ -810,7 +712,7 @@ UpdateSmbios (
EnclosureInfoUpdateSmbiosType3();
- ProcessorInfoUpdateSmbiosType4 (2);
+ ProcessorInfoUpdateSmbiosType4 (4); //One example for creating and updating
CacheInfoUpdateSmbiosType7();
@@ -825,5 +727,4 @@ UpdateSmbios (
BootInfoUpdateSmbiosType32();
return EFI_SUCCESS;
-
}
diff --git a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf b/ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
index 36552fd1e..502aa2ea3 100644
--- a/ArmPkg/Drivers/UpdateSmbios/UpdateSmbios.inf
+++ b/ArmPlatformPkg/PlatformSmbiosDxe/PlatformSmbiosDxe.inf
@@ -1,28 +1,27 @@
-## @file
-#
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+#/** @file
+# SMBIOS Table for ARM platform
#
+# Copyright (c) 2013 Linaro.org
# 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
+# 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 = UpdateSmbios
+ BASE_NAME = PlatformSmbiosDxe
FILE_GUID = 3847D23F-1D95-4772-B60C-4BBFBC4D532F
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
- ENTRY_POINT = UpdateSmbios
+ ENTRY_POINT = PlatfomrSmbiosDriverEntryPoint
[Sources]
- UpdateSmbios.c
- UpdateSmbios.h
+ PlatformSmbiosDxe.c
[Packages]
MdePkg/MdePkg.dec
@@ -37,7 +36,6 @@
UefiLib
UefiDriverEntryPoint
DebugLib
- PcdLib
[Protocols]
gEfiSmbiosProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
@@ -46,4 +44,3 @@
[Depex]
gEfiSmbiosProtocolGuid
-
diff --git a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
index 6358e3a27..86b2f2459 100644
--- a/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
+++ b/ArmPlatformPkg/PrePi/AArch64/ModuleEntryPoint.S
@@ -42,8 +42,8 @@ _SetSVCMode:
// at the top of the DRAM)
_SetupStackPosition:
// Compute Top of System Memory
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryBase), x1)
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemorySize), x2)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemoryBase), x1)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemorySize), x2)
sub x2, x2, #1
add x1, x1, x2 // x1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize
diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
index 3d4e1e927..4fe10addc 100644
--- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
+++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.S
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+// Copyright (c) 2011-2014, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -38,7 +38,7 @@ ASM_PFX(_ModuleEntryPoint):
// Get ID of this CPU in Multicore system
bl ASM_PFX(ArmReadMpidr)
// Keep a copy of the MpId register value
- mov r6, r0
+ mov r8, r0
_SetSVCMode:
// Enter SVC mode, Disable FIQ and IRQ
@@ -50,8 +50,8 @@ _SetSVCMode:
// at the top of the DRAM)
_SetupStackPosition:
// Compute Top of System Memory
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryBase), r1)
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemorySize), r2)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemoryBase), r1)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemorySize), r2)
sub r2, r2, #1
add r1, r1, r2 // r1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize
@@ -83,47 +83,47 @@ _SetupStack:
// Because the 'push' instruction is equivalent to 'stmdb' (decrement before), we need to increment
// one to the top of the stack. We check if incrementing one does not overflow (case of DRAM at the
// top of the memory space)
- adds r7, r1, #1
+ adds r9, r1, #1
bcs _SetupOverflowStack
_SetupAlignedStack:
- mov r1, r7
+ mov r1, r9
b _GetBaseUefiMemory
_SetupOverflowStack:
// Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE
// aligned (4KB)
- LoadConstantToReg (EFI_PAGE_MASK, r7)
- and r7, r7, r1
- sub r1, r1, r7
+ LoadConstantToReg (EFI_PAGE_MASK, r9)
+ and r9, r9, r1
+ sub r1, r1, r9
_GetBaseUefiMemory:
// Calculate the Base of the UEFI Memory
- sub r7, r1, r4
+ sub r9, r1, r4
_GetStackBase:
// r1 = The top of the Mpcore Stacks
// Stack for the primary core = PrimaryCoreStack
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
- sub r8, r1, r2
+ sub r10, r1, r2
// Stack for the secondary core = Number of Cores - 1
LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)
sub r0, r0, #1
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)
mul r1, r1, r0
- sub r8, r8, r1
+ sub r10, r10, r1
- // r8 = The base of the MpCore Stacks (primary stack & secondary stacks)
- mov r0, r8
- mov r1, r6
+ // r10 = The base of the MpCore Stacks (primary stack & secondary stacks)
+ mov r0, r10
+ mov r1, r8
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)
bl ASM_PFX(ArmPlatformStackSet)
// Is it the Primary Core ?
- mov r0, r6
+ mov r0, r8
bl ASM_PFX(ArmPlatformIsPrimaryCore)
cmp r0, #1
bne _PrepareArguments
@@ -134,9 +134,9 @@ _ReserveGlobalVariable:
InitializePrimaryStack(r0, r1)
_PrepareArguments:
- mov r0, r6
- mov r1, r7
- mov r2, r8
+ mov r0, r8
+ mov r1, r9
+ mov r2, r10
mov r3, sp
// Move sec startup address into a data register
diff --git a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
index 993fccfa4..028a9a1b2 100644
--- a/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
+++ b/ArmPlatformPkg/PrePi/Arm/ModuleEntryPoint.asm
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+// Copyright (c) 2011-2014, ARM Limited. All rights reserved.
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
@@ -40,7 +40,7 @@ _ModuleEntryPoint
// Get ID of this CPU in Multicore system
bl ArmReadMpidr
// Keep a copy of the MpId register value
- mov r6, r0
+ mov r8, r0
_SetSVCMode
// Enter SVC mode, Disable FIQ and IRQ
@@ -52,8 +52,8 @@ _SetSVCMode
// at the top of the DRAM)
_SetupStackPosition
// Compute Top of System Memory
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemoryBase), r1)
- LoadConstantToReg (FixedPcdGet32(PcdSystemMemorySize), r2)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemoryBase), r1)
+ LoadConstantToReg (FixedPcdGet64 (PcdSystemMemorySize), r2)
sub r2, r2, #1
add r1, r1, r2 // r1 = SystemMemoryTop = PcdSystemMemoryBase + PcdSystemMemorySize
@@ -85,47 +85,47 @@ _SetupStack
// Because the 'push' instruction is equivalent to 'stmdb' (decrement before), we need to increment
// one to the top of the stack. We check if incrementing one does not overflow (case of DRAM at the
// top of the memory space)
- adds r7, r1, #1
+ adds r9, r1, #1
bcs _SetupOverflowStack
_SetupAlignedStack
- mov r1, r7
+ mov r1, r9
b _GetBaseUefiMemory
_SetupOverflowStack
// Case memory at the top of the address space. Ensure the top of the stack is EFI_PAGE_SIZE
// aligned (4KB)
- LoadConstantToReg (EFI_PAGE_MASK, r7)
- and r7, r7, r1
- sub r1, r1, r7
+ LoadConstantToReg (EFI_PAGE_MASK, r9)
+ and r9, r9, r1
+ sub r1, r1, r9
_GetBaseUefiMemory
// Calculate the Base of the UEFI Memory
- sub r7, r1, r4
+ sub r9, r1, r4
_GetStackBase
// r1 = The top of the Mpcore Stacks
// Stack for the primary core = PrimaryCoreStack
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
- sub r8, r1, r2
+ sub r10, r1, r2
// Stack for the secondary core = Number of Cores - 1
LoadConstantToReg (FixedPcdGet32(PcdCoreCount), r0)
sub r0, r0, #1
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r1)
mul r1, r1, r0
- sub r8, r8, r1
+ sub r10, r10, r1
- // r8 = The base of the MpCore Stacks (primary stack & secondary stacks)
- mov r0, r8
- mov r1, r6
+ // r10 = The base of the MpCore Stacks (primary stack & secondary stacks)
+ mov r0, r10
+ mov r1, r8
//ArmPlatformStackSet(StackBase, MpId, PrimaryStackSize, SecondaryStackSize)
LoadConstantToReg (FixedPcdGet32(PcdCPUCorePrimaryStackSize), r2)
LoadConstantToReg (FixedPcdGet32(PcdCPUCoreSecondaryStackSize), r3)
bl ArmPlatformStackSet
// Is it the Primary Core ?
- mov r0, r6
+ mov r0, r8
bl ArmPlatformIsPrimaryCore
cmp r0, #1
bne _PrepareArguments
@@ -136,9 +136,9 @@ _ReserveGlobalVariable
InitializePrimaryStack r0, r1
_PrepareArguments
- mov r0, r6
- mov r1, r7
- mov r2, r8
+ mov r0, r8
+ mov r1, r9
+ mov r2, r10
mov r3, sp
// Move sec startup address into a data register
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 7ef88c0e3..d54ebf933 100755
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -30,8 +30,8 @@
#include "PrePi.h"
#include "LzmaDecompress.h"
-#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > (UINT32)(FixedPcdGet32 (PcdSystemMemoryBase) + FixedPcdGet32 (PcdSystemMemorySize))) || \
- ((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet32 (PcdSystemMemoryBase)))
+#define IS_XIP() (((UINT32)FixedPcdGet32 (PcdFdBaseAddress) > (UINT32)(FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet32 (PcdSystemMemorySize))) || \
+ ((FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) < FixedPcdGet64 (PcdSystemMemoryBase)))
// Not used when PrePi in run in XIP mode
UINTN mGlobalVariableBase = 0;
@@ -108,8 +108,8 @@ PrePiMain (
// If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)
ASSERT (IS_XIP() ||
- ((FixedPcdGet32 (PcdFdBaseAddress) >= FixedPcdGet32 (PcdSystemMemoryBase)) &&
- ((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)(FixedPcdGet32 (PcdSystemMemoryBase) + FixedPcdGet32 (PcdSystemMemorySize)))));
+ ((FixedPcdGet32 (PcdFdBaseAddress) >= FixedPcdGet64 (PcdSystemMemoryBase)) &&
+ ((UINT32)(FixedPcdGet32 (PcdFdBaseAddress) + FixedPcdGet32 (PcdFdSize)) <= (UINT32)(FixedPcdGet64 (PcdSystemMemoryBase) + FixedPcdGet64 (PcdSystemMemorySize)))));
// Initialize the architecture specific bits
ArchInitialize ();
diff --git a/BaseTools/Bin/Win32/BPDG.exe b/BaseTools/Bin/Win32/BPDG.exe
index d81803a80..76186cadd 100644
--- a/BaseTools/Bin/Win32/BPDG.exe
+++ b/BaseTools/Bin/Win32/BPDG.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/BootSectImage.exe b/BaseTools/Bin/Win32/BootSectImage.exe
index 4ba8c50e8..7e4bd4dd1 100755
--- a/BaseTools/Bin/Win32/BootSectImage.exe
+++ b/BaseTools/Bin/Win32/BootSectImage.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/EfiLdrImage.exe b/BaseTools/Bin/Win32/EfiLdrImage.exe
index a06534db8..45219e3c3 100755
--- a/BaseTools/Bin/Win32/EfiLdrImage.exe
+++ b/BaseTools/Bin/Win32/EfiLdrImage.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/EfiRom.exe b/BaseTools/Bin/Win32/EfiRom.exe
index 1baf7a99d..bec9d9bcc 100755
--- a/BaseTools/Bin/Win32/EfiRom.exe
+++ b/BaseTools/Bin/Win32/EfiRom.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenBootSector.exe b/BaseTools/Bin/Win32/GenBootSector.exe
index df8f019d2..ac0abfb5b 100755
--- a/BaseTools/Bin/Win32/GenBootSector.exe
+++ b/BaseTools/Bin/Win32/GenBootSector.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenCrc32.exe b/BaseTools/Bin/Win32/GenCrc32.exe
index 4a440145e..3f4c4d8ab 100755
--- a/BaseTools/Bin/Win32/GenCrc32.exe
+++ b/BaseTools/Bin/Win32/GenCrc32.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenDepex.exe b/BaseTools/Bin/Win32/GenDepex.exe
index ca008dbc3..3f7452a38 100755
--- a/BaseTools/Bin/Win32/GenDepex.exe
+++ b/BaseTools/Bin/Win32/GenDepex.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFds.exe b/BaseTools/Bin/Win32/GenFds.exe
index 529d29152..2c7783bc3 100755
--- a/BaseTools/Bin/Win32/GenFds.exe
+++ b/BaseTools/Bin/Win32/GenFds.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFfs.exe b/BaseTools/Bin/Win32/GenFfs.exe
index 3a57ec90f..ad788da19 100755
--- a/BaseTools/Bin/Win32/GenFfs.exe
+++ b/BaseTools/Bin/Win32/GenFfs.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFv.exe b/BaseTools/Bin/Win32/GenFv.exe
index 31b49654b..c99b15c2b 100755
--- a/BaseTools/Bin/Win32/GenFv.exe
+++ b/BaseTools/Bin/Win32/GenFv.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenFw.exe b/BaseTools/Bin/Win32/GenFw.exe
index 7d53501b8..df4199eca 100755
--- a/BaseTools/Bin/Win32/GenFw.exe
+++ b/BaseTools/Bin/Win32/GenFw.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenPage.exe b/BaseTools/Bin/Win32/GenPage.exe
index 3ccbb5b33..a1d26dde3 100755
--- a/BaseTools/Bin/Win32/GenPage.exe
+++ b/BaseTools/Bin/Win32/GenPage.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenPatchPcdTable.exe b/BaseTools/Bin/Win32/GenPatchPcdTable.exe
index a978e64b9..b551b21f7 100755
--- a/BaseTools/Bin/Win32/GenPatchPcdTable.exe
+++ b/BaseTools/Bin/Win32/GenPatchPcdTable.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenSec.exe b/BaseTools/Bin/Win32/GenSec.exe
index 277d62338..804369130 100755
--- a/BaseTools/Bin/Win32/GenSec.exe
+++ b/BaseTools/Bin/Win32/GenSec.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/GenVtf.exe b/BaseTools/Bin/Win32/GenVtf.exe
index fd936b071..3a0324cd4 100755
--- a/BaseTools/Bin/Win32/GenVtf.exe
+++ b/BaseTools/Bin/Win32/GenVtf.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/LzmaCompress.exe b/BaseTools/Bin/Win32/LzmaCompress.exe
index 1984cc73e..b4915d657 100755
--- a/BaseTools/Bin/Win32/LzmaCompress.exe
+++ b/BaseTools/Bin/Win32/LzmaCompress.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/PatchPcdValue.exe b/BaseTools/Bin/Win32/PatchPcdValue.exe
index aa0e088f7..dc145cdef 100755
--- a/BaseTools/Bin/Win32/PatchPcdValue.exe
+++ b/BaseTools/Bin/Win32/PatchPcdValue.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/Split.exe b/BaseTools/Bin/Win32/Split.exe
index 30451d4bc..9ea959224 100755
--- a/BaseTools/Bin/Win32/Split.exe
+++ b/BaseTools/Bin/Win32/Split.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/TargetTool.exe b/BaseTools/Bin/Win32/TargetTool.exe
index c8b1006ed..6cda989ca 100755
--- a/BaseTools/Bin/Win32/TargetTool.exe
+++ b/BaseTools/Bin/Win32/TargetTool.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/TianoCompress.exe b/BaseTools/Bin/Win32/TianoCompress.exe
index a574d075d..0c756484b 100755
--- a/BaseTools/Bin/Win32/TianoCompress.exe
+++ b/BaseTools/Bin/Win32/TianoCompress.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/Trim.exe b/BaseTools/Bin/Win32/Trim.exe
index 8a8384159..feb0b1d95 100755
--- a/BaseTools/Bin/Win32/Trim.exe
+++ b/BaseTools/Bin/Win32/Trim.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/UPT.exe b/BaseTools/Bin/Win32/UPT.exe
index 5bb1d9e2c..bea44d9e0 100644
--- a/BaseTools/Bin/Win32/UPT.exe
+++ b/BaseTools/Bin/Win32/UPT.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/VfrCompile.exe b/BaseTools/Bin/Win32/VfrCompile.exe
index 34df8a2dc..a35a4893e 100755
--- a/BaseTools/Bin/Win32/VfrCompile.exe
+++ b/BaseTools/Bin/Win32/VfrCompile.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/VolInfo.exe b/BaseTools/Bin/Win32/VolInfo.exe
index f7a7591cf..0ef74aa94 100755
--- a/BaseTools/Bin/Win32/VolInfo.exe
+++ b/BaseTools/Bin/Win32/VolInfo.exe
Binary files differ
diff --git a/BaseTools/Bin/Win32/build.exe b/BaseTools/Bin/Win32/build.exe
index ee3f7eb9d..c7aaa98db 100755
--- a/BaseTools/Bin/Win32/build.exe
+++ b/BaseTools/Bin/Win32/build.exe
Binary files differ
diff --git a/BaseTools/Conf/XMLSchema/DistributionPackage.xsd b/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
index 5ae85f2bc..c1f2184ca 100644
--- a/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
+++ b/BaseTools/Conf/XMLSchema/DistributionPackage.xsd
@@ -1613,7 +1613,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</xs:restriction>
</xs:simpleType>
</xs:element>
- <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
+ <xs:element minOccurs="1" maxOccurs="1" name="DatumType"
type="PcdDatumTypes"/>
<xs:element minOccurs="0" maxOccurs="1" name="MaxDatumSize">
<xs:annotation>
@@ -1653,6 +1653,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</xs:annotation>
<xs:complexType>
<xs:sequence>
+ <xs:choice>
+ <xs:element minOccurs="0" maxOccurs="1" name="ValidValueList">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:normalizedString">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" maxOccurs="1" name="ValidValueRange" type="xs:normalizedString"/>
+ <xs:element minOccurs="0" maxOccurs="1" name="Expression" type="xs:normalizedString"/>
+ </xs:choice>
<xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
<xs:annotation>
<xs:documentation xml:lang="en-us"> The minLength of 3 is
@@ -1731,6 +1744,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</xs:annotation>
<xs:complexType>
<xs:sequence>
+ <xs:choice>
+ <xs:element minOccurs="0" maxOccurs="1" name="ValidValueList">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:normalizedString">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+ <xs:element minOccurs="0" maxOccurs="1" name="ValidValueRange" type="xs:normalizedString"/>
+ <xs:element minOccurs="0" maxOccurs="1" name="Expression" type="xs:normalizedString"/>
+ </xs:choice>
<xs:element minOccurs="1" maxOccurs="1" name="ErrorNumber">
<xs:annotation>
<xs:documentation xml:lang="en-us"> The minLength of 3 is
@@ -1877,6 +1903,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+ <xs:element minOccurs="0" maxOccurs="1" name="GUID" type="RegistryFormatGuid"/>
<xs:element minOccurs="0" maxOccurs="1" name="VariableName"
type="xs:normalizedString">
<xs:annotation>
@@ -1948,6 +1975,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+ <xs:element minOccurs="0" maxOccurs="1" name="GUID" type="RegistryFormatGuid"/>
<xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Usage" use="required">
@@ -1985,6 +2013,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="CName" type="xs:NCName"/>
+ <xs:element minOccurs="0" maxOccurs="1" name="GUID" type="RegistryFormatGuid"/>
<xs:element ref="HelpText" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="Usage" use="required">
@@ -2272,17 +2301,32 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
different from the Distribution Package license. </xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Abstract" type="xs:normalizedString">
+ <xs:element minOccurs="0" maxOccurs="1" name="Abstract">
<xs:annotation>
<xs:documentation xml:lang="en-us"> This is only required if the Abstract is
different from the Distribution Package Abstract. </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:normalizedString">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
</xs:element>
- <xs:element minOccurs="0" maxOccurs="1" name="Description" type="xs:string">
+ <xs:element minOccurs="0" maxOccurs="1" name="Description">
<xs:annotation>
<xs:documentation xml:lang="en-us"> This is only required if the Description is
different from the Distribution Package Description. </xs:documentation>
</xs:annotation>
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="Lang" type="xs:language" default="en-us" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+
</xs:element>
</xs:sequence>
</xs:complexType>
@@ -2474,6 +2518,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<xs:enumeration value="File"/>
<xs:enumeration value="FV"/>
<xs:enumeration value="GUID"/>
+ <xs:enumeration value="HII"/>
<xs:enumeration value="Hii"/>
<xs:enumeration value="HOB"/>
<xs:enumeration value="SystemTable"/>
@@ -2694,10 +2739,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
+ <xs:enumeration value="RedHat32"/>
+ <xs:enumeration value="RedHat64"/>
+ <xs:enumeration value="SuSE32"/>
+ <xs:enumeration value="SuSE64"/>
<xs:enumeration value="Linux32"/>
<xs:enumeration value="Linux64"/>
<xs:enumeration value="OS/X32"/>
<xs:enumeration value="OS/X64"/>
+ <xs:enumeration value="Generic"/>
<xs:enumeration value="GenericWin">
<xs:annotation>
<xs:documentation xml:lang="en-us"> Typically, this is used for Windows Batch files.
diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template
index 4a21aba85..6537108ca 100644
--- a/BaseTools/Conf/build_rule.template
+++ b/BaseTools/Conf/build_rule.template
@@ -166,7 +166,7 @@
<Command.GCC, Command.RVCT>
"$(PP)" $(PP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i
- Trim --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
+ Trim --trim-long --source-code -o ${d_path}(+)${s_base}.iii ${d_path}(+)${s_base}.i
# For RVCTCYGWIN ASM_FLAGS must be first to work around pathing issues
"$(ASM)" $(ASM_FLAGS) -o ${dst} $(INC) ${d_path}(+)${s_base}.iii
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index ecfb55777..aa169d10f 100644
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -159,6 +159,9 @@ DEFINE GCC46_X64_PREFIX = /usr/bin/
DEFINE GCC47_IA32_PREFIX = /usr/bin/
DEFINE GCC47_X64_PREFIX = /usr/bin/
+DEFINE GCC48_IA32_PREFIX = /usr/bin/
+DEFINE GCC48_X64_PREFIX = /usr/bin/
+
DEFINE UNIX_IASL_BIN = /usr/bin/iasl
#DEFINE UNIX_IASL_BIN = $(HOME)/programs/iasl
DEFINE WIN_ASL_BIN_DIR = C:\ASL
@@ -304,6 +307,12 @@ DEFINE CLANG_BIN = /usr/bin/
# Required to build platforms or ACPI tables:
# Intel(r) ACPI Compiler v20101013 from
# http://www.acpica.org/downloads/previous_releases.php
+# GCC48 -Linux- Requires:
+# GCC 4.8
+# Optional:
+# Required to build platforms or ACPI tables:
+# Intel(r) ACPI Compiler v20101013 from
+# http://www.acpica.org/downloads/previous_releases.php
# ELFGCC -Linux- Requires:
# GCC(this tool chain uses whatever version of gcc and binutils that is installed in /usr/bin)
# Optional:
@@ -3127,12 +3136,13 @@ DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-strict-aliasing -
DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe
DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe
DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency
-DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address
+DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mfloat-abi=soft
DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
DEFINE GCC_ARM_AARCH64_DLINK_COMMON= -Ttext=0x0 --emit-relocs -nostdlib -u $(IMAGE_ENTRY_POINT) -e $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_IA32_X64_ASLDLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
+DEFINE GCC_ARM_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --entry ReferenceAcpiTable -u $(IMAGE_ENTRY_POINT)
DEFINE GCC_IA32_X64_DLINK_FLAGS = DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_IPF_DLINK_FLAGS = -nostdlib -O2 --gc-sections --dll -static --entry $(IMAGE_ENTRY_POINT) --undefined $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map
DEFINE GCC_IPF_OBJCOPY_FLAGS = -I elf64-ia64-little -O efi-bsdrv-ia64
@@ -3176,6 +3186,7 @@ DEFINE GCC46_ASM_FLAGS = DEF(GCC45_ASM_FLAGS)
DEFINE GCC46_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_ASM_FLAGS) -mlittle-endian
DEFINE GCC46_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mword-relocations -mlittle-endian -mabi=aapcs -mapcs -fno-short-enums -save-temps -fsigned-char -mno-unaligned-access -Wno-address -fomit-frame-pointer
DEFINE GCC46_ARM_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON) --oformat=elf32-littlearm
+DEFINE GCC46_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS) --oformat=elf32-littlearm
DEFINE GCC47_IA32_CC_FLAGS = DEF(GCC46_IA32_CC_FLAGS)
DEFINE GCC47_X64_CC_FLAGS = DEF(GCC46_X64_CC_FLAGS)
@@ -3190,6 +3201,24 @@ DEFINE GCC47_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS)
DEFINE GCC47_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC44_ALL_CC_FLAGS) -mcmodel=large -mlittle-endian -fno-short-enums -save-temps -fverbose-asm -fsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-builtin -Wno-address
DEFINE GCC47_ARM_DLINK_FLAGS = DEF(GCC46_ARM_DLINK_FLAGS)
DEFINE GCC47_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
+DEFINE GCC47_ARM_ASLDLINK_FLAGS = DEF(GCC46_ARM_ASLDLINK_FLAGS)
+DEFINE GCC47_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
+
+DEFINE GCC48_IA32_CC_FLAGS = DEF(GCC47_IA32_CC_FLAGS)
+DEFINE GCC48_X64_CC_FLAGS = DEF(GCC47_X64_CC_FLAGS)
+DEFINE GCC48_IA32_X64_DLINK_COMMON = DEF(GCC47_IA32_X64_DLINK_COMMON)
+DEFINE GCC48_IA32_X64_ASLDLINK_FLAGS = DEF(GCC47_IA32_X64_ASLDLINK_FLAGS)
+DEFINE GCC48_IA32_X64_DLINK_FLAGS = DEF(GCC47_IA32_X64_DLINK_FLAGS)
+DEFINE GCC48_X64_DLINK_FLAGS = DEF(GCC47_X64_DLINK_FLAGS)
+DEFINE GCC48_ASM_FLAGS = DEF(GCC47_ASM_FLAGS)
+DEFINE GCC48_ARM_ASM_FLAGS = DEF(GCC47_ARM_ASM_FLAGS)
+DEFINE GCC48_AARCH64_ASM_FLAGS = DEF(GCC47_AARCH64_ASM_FLAGS)
+DEFINE GCC48_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS)
+DEFINE GCC48_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS)
+DEFINE GCC48_ARM_DLINK_FLAGS = DEF(GCC47_ARM_DLINK_FLAGS)
+DEFINE GCC48_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
+DEFINE GCC48_ARM_ASLDLINK_FLAGS = DEF(GCC47_ARM_ASLDLINK_FLAGS)
+DEFINE GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC_ARM_AARCH64_ASLDLINK_FLAGS)
####################################################################################
#
@@ -3292,7 +3321,7 @@ DEFINE GCC47_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
*_GCC44_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
*_GCC44_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
*_GCC44_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
-*_GCC44_*_APP_FLAGS =
+*_GCC44_*_APP_FLAGS = DEF(GCC_PP_FLAGS)
*_GCC44_*_ASL_FLAGS = DEF(IASL_FLAGS)
*_GCC44_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
@@ -3490,6 +3519,8 @@ DEFINE GCC47_AARCH64_DLINK_FLAGS = DEF(GCC_ARM_AARCH64_DLINK_COMMON)
*_GCC46_ARM_ARCHCC_FLAGS = -mthumb
*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
+*_GCC46_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC46_ARM_ASLDLINK_FLAGS = DEF(GCC46_ARM_ASLDLINK_FLAGS)
*_GCC46_ARM_ASM_FLAGS = DEF(GCC46_ARM_ASM_FLAGS)
*_GCC46_ARM_DLINK_FLAGS = DEF(GCC46_ARM_DLINK_FLAGS)
*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
@@ -3579,9 +3610,11 @@ RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-v
*_GCC47_ARM_ASLPP_PATH = ENV(GCC47_ARM_PREFIX)gcc
*_GCC47_ARM_RC_PATH = ENV(GCC47_ARM_PREFIX)objcopy
-*_GCC46_ARM_ARCHCC_FLAGS = -mthumb
-*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a
+*_GCC47_ARM_ARCHCC_FLAGS = -mthumb
+*_GCC47_ARM_PLATFORM_FLAGS = -march=armv7-a
+*_GCC47_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC47_ARM_ASLDLINK_FLAGS = DEF(GCC47_ARM_ASLDLINK_FLAGS)
*_GCC47_ARM_ASM_FLAGS = DEF(GCC47_ARM_ASM_FLAGS)
*_GCC47_ARM_DLINK_FLAGS = DEF(GCC47_ARM_DLINK_FLAGS)
*_GCC47_ARM_PLATFORM_FLAGS = -march=armv7-a
@@ -3606,6 +3639,8 @@ RELEASE_GCC47_ARM_CC_FLAGS = DEF(GCC47_ARM_CC_FLAGS) -Wno-unused-but-set-v
*_GCC47_AARCH64_ASLPP_PATH = ENV(GCC47_AARCH64_PREFIX)gcc
*_GCC47_AARCH64_RC_PATH = ENV(GCC47_AARCH64_PREFIX)objcopy
+*_GCC47_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC47_AARCH64_ASLDLINK_FLAGS = DEF(GCC47_AARCH64_ASLDLINK_FLAGS)
*_GCC47_AARCH64_ASM_FLAGS = DEF(GCC47_AARCH64_ASM_FLAGS)
*_GCC47_AARCH64_DLINK_FLAGS = DEF(GCC47_AARCH64_DLINK_FLAGS)
*_GCC47_AARCH64_PLATFORM_FLAGS =
@@ -3618,6 +3653,126 @@ RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s
####################################################################################
#
+# GCC 4.8 - This configuration is used to compile under Linux to produce
+# PE/COFF binaries using GCC 4.8.
+#
+####################################################################################
+*_GCC48_*_*_FAMILY = GCC
+
+*_GCC48_*_MAKE_PATH = make
+*_GCC48_*_ASL_PATH = DEF(UNIX_IASL_BIN)
+
+*_GCC48_*_PP_FLAGS = DEF(GCC_PP_FLAGS)
+*_GCC48_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS)
+*_GCC48_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC48_*_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS)
+*_GCC48_*_APP_FLAGS =
+*_GCC48_*_ASL_FLAGS = DEF(IASL_FLAGS)
+*_GCC48_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
+
+##################
+# GCC48 IA32 definitions
+##################
+*_GCC48_IA32_OBJCOPY_PATH = DEF(GCC48_IA32_PREFIX)objcopy
+*_GCC48_IA32_CC_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_SLINK_PATH = DEF(GCC48_IA32_PREFIX)ar
+*_GCC48_IA32_DLINK_PATH = DEF(GCC48_IA32_PREFIX)ld
+*_GCC48_IA32_ASLDLINK_PATH = DEF(GCC48_IA32_PREFIX)ld
+*_GCC48_IA32_ASM_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_PP_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_VFRPP_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_ASLCC_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_ASLPP_PATH = DEF(GCC48_IA32_PREFIX)gcc
+*_GCC48_IA32_RC_PATH = DEF(GCC48_IA32_PREFIX)objcopy
+
+*_GCC48_IA32_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m32
+*_GCC48_IA32_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_ASLDLINK_FLAGS) -m elf_i386
+*_GCC48_IA32_ASM_FLAGS = DEF(GCC48_ASM_FLAGS) -m32 -march=i386
+*_GCC48_IA32_CC_FLAGS = DEF(GCC48_IA32_CC_FLAGS) -Os
+*_GCC48_IA32_DLINK_FLAGS = DEF(GCC48_IA32_X64_DLINK_FLAGS) -m elf_i386 --oformat=elf32-i386
+*_GCC48_IA32_RC_FLAGS = DEF(GCC_IA32_RC_FLAGS)
+*_GCC48_IA32_OBJCOPY_FLAGS =
+
+##################
+# GCC48 X64 definitions
+##################
+*_GCC48_X64_OBJCOPY_PATH = DEF(GCC48_X64_PREFIX)objcopy
+*_GCC48_X64_CC_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_SLINK_PATH = DEF(GCC48_X64_PREFIX)ar
+*_GCC48_X64_DLINK_PATH = DEF(GCC48_X64_PREFIX)ld
+*_GCC48_X64_ASLDLINK_PATH = DEF(GCC48_X64_PREFIX)ld
+*_GCC48_X64_ASM_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_PP_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_VFRPP_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_ASLCC_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_ASLPP_PATH = DEF(GCC48_X64_PREFIX)gcc
+*_GCC48_X64_RC_PATH = DEF(GCC48_X64_PREFIX)objcopy
+
+*_GCC48_X64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -m64
+*_GCC48_X64_ASLDLINK_FLAGS = DEF(GCC48_IA32_X64_ASLDLINK_FLAGS) -m elf_x86_64
+*_GCC48_X64_ASM_FLAGS = DEF(GCC48_ASM_FLAGS) -m64
+*_GCC48_X64_CC_FLAGS = DEF(GCC48_X64_CC_FLAGS)
+*_GCC48_X64_DLINK_FLAGS = DEF(GCC48_X64_DLINK_FLAGS)
+*_GCC48_X64_RC_FLAGS = DEF(GCC_X64_RC_FLAGS)
+*_GCC48_X64_OBJCOPY_FLAGS =
+
+##################
+# GCC48 ARM definitions
+##################
+*_GCC48_ARM_CC_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_SLINK_PATH = ENV(GCC48_ARM_PREFIX)ar
+*_GCC48_ARM_DLINK_PATH = ENV(GCC48_ARM_PREFIX)ld
+*_GCC48_ARM_ASLDLINK_PATH = ENV(GCC48_ARM_PREFIX)ld
+*_GCC48_ARM_ASM_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_PP_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_VFRPP_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_ASLCC_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_ASLPP_PATH = ENV(GCC48_ARM_PREFIX)gcc
+*_GCC48_ARM_RC_PATH = ENV(GCC48_ARM_PREFIX)objcopy
+
+*_GCC48_ARM_ARCHCC_FLAGS = -mthumb
+*_GCC48_ARM_PLATFORM_FLAGS = -march=armv7-a
+
+*_GCC48_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC48_ARM_ASLDLINK_FLAGS = DEF(GCC48_ARM_ASLDLINK_FLAGS)
+*_GCC48_ARM_ASM_FLAGS = DEF(GCC48_ARM_ASM_FLAGS)
+*_GCC48_ARM_DLINK_FLAGS = DEF(GCC48_ARM_DLINK_FLAGS)
+*_GCC48_ARM_PLATFORM_FLAGS = -march=armv7-a
+*_GCC48_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_GCC48_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS)
+*_GCC48_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+
+ DEBUG_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -O0
+RELEASE_GCC48_ARM_CC_FLAGS = DEF(GCC48_ARM_CC_FLAGS) -Wno-unused-but-set-variable
+
+##################
+# GCC48 AARCH64 definitions
+##################
+*_GCC48_AARCH64_CC_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_SLINK_PATH = ENV(GCC48_AARCH64_PREFIX)ar
+*_GCC48_AARCH64_DLINK_PATH = ENV(GCC48_AARCH64_PREFIX)ld
+*_GCC48_AARCH64_ASLDLINK_PATH = ENV(GCC48_AARCH64_PREFIX)ld
+*_GCC48_AARCH64_ASM_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_PP_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_VFRPP_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_ASLCC_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_ASLPP_PATH = ENV(GCC48_AARCH64_PREFIX)gcc
+*_GCC48_AARCH64_RC_PATH = ENV(GCC48_AARCH64_PREFIX)objcopy
+
+*_GCC48_AARCH64_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS)
+*_GCC48_AARCH64_ASLDLINK_FLAGS = DEF(GCC48_AARCH64_ASLDLINK_FLAGS)
+*_GCC48_AARCH64_ASM_FLAGS = DEF(GCC48_AARCH64_ASM_FLAGS)
+*_GCC48_AARCH64_DLINK_FLAGS = DEF(GCC48_AARCH64_DLINK_FLAGS)
+*_GCC48_AARCH64_PLATFORM_FLAGS =
+*_GCC48_AARCH64_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS)
+*_GCC48_AARCH64_RC_FLAGS = DEF(GCC_AARCH64_RC_FLAGS)
+*_GCC48_AARCH64_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS)
+
+ DEBUG_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -O0
+RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-set-variable
+
+####################################################################################
+#
# Cygwin GCC And Intel ACPI Compiler
#
####################################################################################
@@ -5395,7 +5550,7 @@ DEFINE RVCT_ALL_DLINK_FLAGS = --ro-base 0 --no_scanlib --reloc --no_exceptions
#
# Use default values, or override in DSC file
#
-*_RVCT_ARM_ARCHCC_FLAGS = --thumb
+*_RVCT_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp
*_RVCT_ARM_ARCHASM_FLAGS =
*_RVCT_ARM_ARCHDLINK_FLAGS =
*_RVCT_ARM_PLATFORM_FLAGS = --cpu 7-A
@@ -5437,7 +5592,7 @@ RELEASE_RVCT_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppress=5
#
# Use default values, or override in DSC file
#
-*_RVCTLINUX_ARM_ARCHCC_FLAGS = --thumb
+*_RVCTLINUX_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp
*_RVCTLINUX_ARM_ARCHASM_FLAGS =
*_RVCTLINUX_ARM_ARCHDLINK_FLAGS =
*_RVCTLINUX_ARM_PLATFORM_FLAGS = --cpu 7-A
@@ -5484,7 +5639,7 @@ RELEASE_RVCTLINUX_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) --diag_suppr
#
# Use default values, or override in DSC file
#
-*_RVCTCYGWIN_ARM_ARCHCC_FLAGS = --thumb
+*_RVCTCYGWIN_ARM_ARCHCC_FLAGS = --thumb --fpu=softvfp
*_RVCTCYGWIN_ARM_ARCHASM_FLAGS =
*_RVCTCYGWIN_ARM_ARCHDLINK_FLAGS =
*_RVCTCYGWIN_ARM_PLATFORM_FLAGS = --cpu 7-A
@@ -5532,7 +5687,7 @@ RELEASE_RVCTCYGWIN_ARM_CC_FLAGS = "$(CCPATH_FLAG)" $(ARCHCC_FLAGS) $(PLATFORM_F
*_ARMGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
*_ARMGCC_*_ASLPP_FLAGS = -x c -E -P
*_ARMGCC_*_ASLCC_FLAGS = -x c
-*_ARMGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry _ReferenceAcpiTable
+*_ARMGCC_*_ASLDLINK_FLAGS = DEF(GCC_DLINK_FLAGS_COMMON) --entry ReferenceAcpiTable
##################
# ARM definitions
@@ -5625,8 +5780,8 @@ RELEASE_ARMGCC_AARCH64_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_AARC
*_ARMLINUXGCC_*_ASL_FLAGS = DEF(IASL_FLAGS)
*_ARMLINUXGCC_*_ASL_OUTFLAGS = DEF(IASL_OUTFLAGS)
*_ARMLINUXGCC_*_ASLPP_FLAGS = -x c -E -P
-*_ARMLINUXGCC_*_ASLCC_FLAGS = -x c -Dmain=ReferenceAcpiTable
-*_ARMLINUXGCC_*_ASLDLINK_FLAGS = -nostdlib --entry _ReferenceAcpiTable --emit-relocs
+*_ARMLINUXGCC_*_ASLCC_FLAGS = -x c -Dmain=ReferenceAcpiTable
+*_ARMLINUXGCC_*_ASLDLINK_FLAGS = -nostdlib --entry _ReferenceAcpiTable --emit-relocs
##################
# ARM definitions
diff --git a/BaseTools/Source/C/EfiRom/EfiRom.c b/BaseTools/Source/C/EfiRom/EfiRom.c
index 5152f38ba..9f7da8017 100644
--- a/BaseTools/Source/C/EfiRom/EfiRom.c
+++ b/BaseTools/Source/C/EfiRom/EfiRom.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 1999 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -237,6 +237,7 @@ Returns:
PCI_3_0_DATA_STRUCTURE *PciDs30;
UINT32 Index;
UINT8 ByteCheckSum;
+ UINT16 CodeType;
PciDs23 = NULL;
PciDs30 = NULL;
@@ -337,8 +338,10 @@ Returns:
//
if (mOptions.Pci23 == 1) {
PciDs23->ImageLength = (UINT16) (TotalSize / 512);
+ CodeType = PciDs23->CodeType;
} else {
PciDs30->ImageLength = (UINT16) (TotalSize / 512);
+ CodeType = PciDs30->CodeType;
}
//
@@ -359,14 +362,16 @@ Returns:
}
}
- ByteCheckSum = 0;
- for (Index = 0; Index < FileSize - 1; Index++) {
- ByteCheckSum = (UINT8) (ByteCheckSum + Buffer[Index]);
- }
+ if (CodeType != PCI_CODE_TYPE_EFI_IMAGE) {
+ ByteCheckSum = 0;
+ for (Index = 0; Index < FileSize - 1; Index++) {
+ ByteCheckSum = (UINT8) (ByteCheckSum + Buffer[Index]);
+ }
- Buffer[FileSize - 1] = (UINT8) ((~ByteCheckSum) + 1);
- if (mOptions.Verbose) {
- VerboseMsg(" Checksum = %02x\n\n", Buffer[FileSize - 1]);
+ Buffer[FileSize - 1] = (UINT8) ((~ByteCheckSum) + 1);
+ if (mOptions.Verbose) {
+ VerboseMsg(" Checksum = %02x\n\n", Buffer[FileSize - 1]);
+ }
}
//
@@ -449,6 +454,8 @@ Returns:
UINT16 MachineType;
UINT16 SubSystem;
UINT32 HeaderPadBytes;
+ UINT32 PadBytesBeforeImage;
+ UINT32 PadBytesAfterImage;
//
// Try to open the input file
@@ -559,6 +566,18 @@ Returns:
TotalSize = (TotalSize + 0x200) &~0x1ff;
}
//
+ // Workaround:
+ // If compressed, put the pad bytes after the image,
+ // else put the pad bytes before the image.
+ //
+ if ((InFile->FileFlags & FILE_FLAG_COMPRESS) != 0) {
+ PadBytesBeforeImage = 0;
+ PadBytesAfterImage = TotalSize - (FileSize + HeaderSize);
+ } else {
+ PadBytesBeforeImage = TotalSize - (FileSize + HeaderSize);
+ PadBytesAfterImage = 0;
+ }
+ //
// Check size
//
if (TotalSize > MAX_OPTION_ROM_SIZE) {
@@ -581,7 +600,7 @@ Returns:
RomHdr.EfiSignature = EFI_PCI_EXPANSION_ROM_HEADER_EFISIGNATURE;
RomHdr.EfiSubsystem = SubSystem;
RomHdr.EfiMachineType = MachineType;
- RomHdr.EfiImageHeaderOffset = (UINT16) HeaderSize;
+ RomHdr.EfiImageHeaderOffset = (UINT16) (HeaderSize + PadBytesBeforeImage);
RomHdr.PcirOffset = (UINT16) (sizeof (RomHdr) + HeaderPadBytes);
//
// Set image as compressed or not
@@ -686,11 +705,18 @@ Returns:
goto BailOut;
}
}
+
//
- // Keep track of how many bytes left to write
+ // Pad head to make it a multiple of 512 bytes
//
- TotalSize -= HeaderSize;
-
+ while (PadBytesBeforeImage > 0) {
+ if (putc (~0, OutFptr) == EOF) {
+ Error (NULL, 0, 2000, "Failed to write trailing pad bytes output file!", NULL);
+ Status = STATUS_ERROR;
+ goto BailOut;
+ }
+ PadBytesBeforeImage--;
+ }
//
// Now dump the input file's contents to the output file
//
@@ -700,18 +726,17 @@ Returns:
goto BailOut;
}
- TotalSize -= FileSize;
//
// Pad the rest of the image to make it a multiple of 512 bytes
//
- while (TotalSize > 0) {
+ while (PadBytesAfterImage > 0) {
if (putc (~0, OutFptr) == EOF) {
Error (NULL, 0, 2000, "Failed to write trailing pad bytes output file!", NULL);
Status = STATUS_ERROR;
goto BailOut;
}
- TotalSize--;
+ PadBytesAfterImage--;
}
BailOut:
@@ -1205,7 +1230,7 @@ Returns:
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index d0df4ac13..0522cf425 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -458,9 +458,9 @@ Returns:
case 0:
//
- // 8 byte alignment, mini alignment requirement for FFS file.
+ // 1 byte alignment
//
- *Alignment = 3;
+ *Alignment = 0;
break;
case 1:
@@ -2212,7 +2212,8 @@ Returns:
mFvDataInfo.FvNameGuid.Data4[7]);
}
- if (CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0) {
+ if (CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem2Guid) == 0 ||
+ CompareGuid (&mFvDataInfo.FvFileSystemGuid, &mEfiFirmwareFileSystem3Guid) == 0) {
mFvDataInfo.IsPiFvImage = TRUE;
}
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.h b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
index 21993b5e7..a9a00ec02 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.h
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
@@ -168,7 +168,7 @@ Abstract:
// VTF (Firmware Volume Top File) signatures
//
#define IA32_X64_VTF_SIGNATURE_OFFSET 0x14
-#define IA32_X64_VTF0_SIGNATURE EFI_SIGNATURE_32('V','T','F',0)
+#define IA32_X64_VTF0_SIGNATURE SIGNATURE_32('V','T','F',0)
//
// Defines to calculate the offset for PEI CORE entry points
diff --git a/BaseTools/Source/C/Include/Common/BuildVersion.h b/BaseTools/Source/C/Include/Common/BuildVersion.h
index b84bd0571..dd9852bad 100644
--- a/BaseTools/Source/C/Include/Common/BuildVersion.h
+++ b/BaseTools/Source/C/Include/Common/BuildVersion.h
@@ -14,4 +14,4 @@
**/
-#define __BUILD_VERSION "Build 2610"
+#define __BUILD_VERSION "Build 2640"
diff --git a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
index ea06eee69..9d62a9bc3 100644
--- a/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
+++ b/BaseTools/Source/C/Include/Common/PiFirmwareVolume.h
@@ -111,7 +111,7 @@ typedef struct {
EFI_FV_BLOCK_MAP_ENTRY BlockMap[1];
} EFI_FIRMWARE_VOLUME_HEADER;
-#define EFI_FVH_SIGNATURE EFI_SIGNATURE_32 ('_', 'F', 'V', 'H')
+#define EFI_FVH_SIGNATURE SIGNATURE_32 ('_', 'F', 'V', 'H')
///
/// Firmware Volume Header Revision definition
diff --git a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
index 43f585491..8f27ed7bc 100644
--- a/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
+++ b/BaseTools/Source/C/Include/Common/UefiBaseTypes.h
@@ -1,7 +1,7 @@
/** @file
Defines data types and constants introduced in UEFI.
- Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -146,10 +146,10 @@ typedef union {
//
// Define macros to build data structure signatures from characters.
//
-#define EFI_SIGNATURE_16(A, B) ((A) | (B << 8))
-#define EFI_SIGNATURE_32(A, B, C, D) (EFI_SIGNATURE_16 (A, B) | (EFI_SIGNATURE_16 (C, D) << 16))
-#define EFI_SIGNATURE_64(A, B, C, D, E, F, G, H) \
- (EFI_SIGNATURE_32 (A, B, C, D) | ((UINT64) (EFI_SIGNATURE_32 (E, F, G, H)) << 32))
+#define SIGNATURE_16(A, B) ((A) | (B << 8))
+#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))
+#define SIGNATURE_64(A, B, C, D, E, F, G, H) \
+ (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))
//
diff --git a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
index 7e7c0ea46..5d55f4d66 100644
--- a/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
+++ b/BaseTools/Source/C/Include/IndustryStandard/PeImage.h
@@ -4,7 +4,7 @@
@bug Fix text - doc as defined in MSFT EFI specification.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Portions copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
@@ -648,7 +648,7 @@ typedef struct {
///
/// Debug Data Structure defined by Apple Mach-O to Coff utility
///
-#define CODEVIEW_SIGNATURE_MTOC EFI_SIGNATURE_32('M', 'T', 'O', 'C')
+#define CODEVIEW_SIGNATURE_MTOC SIGNATURE_32('M', 'T', 'O', 'C')
typedef struct {
UINT32 Signature; ///< "MTOC"
EFI_GUID MachOUuid;
diff --git a/BaseTools/Source/C/Include/IndustryStandard/pci22.h b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
index e1d347afb..e07aa88ca 100644
--- a/BaseTools/Source/C/Include/IndustryStandard/pci22.h
+++ b/BaseTools/Source/C/Include/IndustryStandard/pci22.h
@@ -1,7 +1,7 @@
/** @file
Support for PCI 2.2 standard.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -335,7 +335,7 @@ typedef union {
#pragma pack()
#define PCI_EXPANSION_ROM_HEADER_SIGNATURE 0xaa55
-#define PCI_DATA_STRUCTURE_SIGNATURE EFI_SIGNATURE_32 ('P', 'C', 'I', 'R')
+#define PCI_DATA_STRUCTURE_SIGNATURE SIGNATURE_32 ('P', 'C', 'I', 'R')
#define PCI_CODE_TYPE_PCAT_IMAGE 0x00
#define PCI_CODE_TYPE_EFI_IMAGE 0x03
#define EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED 0x0001
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
index da8c52989..dd34a1b53 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
@@ -2,7 +2,7 @@
VfrCompiler main class and main function.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -406,8 +406,8 @@ CVfrCompiler::Usage (
UINT32 Index;
CONST CHAR8 *Help[] = {
" ",
- "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION VFR_COMPILER_UPDATE_TIME,
- "Copyright (c) 2004-2011 Intel Corporation. All rights reserved.",
+ "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION,
+ "Copyright (c) 2004-2013 Intel Corporation. All rights reserved.",
" ",
"Usage: VfrCompile [options] VfrFile",
" ",
diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.h b/BaseTools/Source/C/VfrCompile/VfrCompiler.h
index fe29f7e3a..ea20bbc5d 100644
--- a/BaseTools/Source/C/VfrCompile/VfrCompiler.h
+++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.h
@@ -23,8 +23,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "ParseInf.h"
#define PROGRAM_NAME "VfrCompile"
-#define VFR_COMPILER_VERSION " 2.00 (UEFI 2.3.1)"
-#define VFR_COMPILER_UPDATE_TIME " updated on 2011/07/15"
+#define VFR_COMPILER_VERSION " 2.00 (UEFI 2.4) "
//
// This is how we invoke the C preprocessor on the VFR source file
// to resolve #defines, #includes, etc. To make C source files
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
index 363ca82a2..addff24cf 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
@@ -855,17 +855,6 @@ CFormPkg::DeclarePendingQuestion (
// Get VarStoreType
//
ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId);
- if (ReturnCode == VFR_RETURN_UNDEFINED) {
- lCVfrDataStorage.DeclareBufferVarStore (
- FName,
- LocalFormSetGuid,
- &lCVfrVarDataTypeDB,
- FName,
- EFI_VARSTORE_ID_INVALID,
- FALSE
- );
- ReturnCode = lCVfrDataStorage.GetVarStoreId (FName, &Info.mVarStoreId, LocalFormSetGuid);
- }
if (ReturnCode != VFR_RETURN_SUCCESS) {
gCVfrErrorHandle.PrintMsg (pNode->mLineNo, FName, "Error", "Var Store Type is not defined");
return ReturnCode;
diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 71d0d757d..11cf8b2f1 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -1,7 +1,7 @@
## @file
# Generate AutoGen.h, AutoGen.c and *.depex files
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -334,6 +334,7 @@ class WorkspaceAutoGen(AutoGen):
# Explicitly collect platform's dynamic PCDs
#
Pa.CollectPlatformDynamicPcds()
+ Pa.CollectFixedAtBuildPcds()
self.AutoGenObjectList.append(Pa)
#
@@ -785,6 +786,7 @@ class PlatformAutoGen(AutoGen):
self._PcdTokenNumber = None # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber
self._DynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
self._NonDynamicPcdList = None # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
+ self._NonDynamicPcdDict = {}
self._ToolDefinitions = None
self._ToolDefFile = None # toolcode : tool path
@@ -851,6 +853,32 @@ class PlatformAutoGen(AutoGen):
(self.MetaFile, self.Arch))
self.IsMakeFileCreated = True
+ ## Deal with Shared FixedAtBuild Pcds
+ #
+ def CollectFixedAtBuildPcds(self):
+ for LibAuto in self.LibraryAutoGenList:
+ FixedAtBuildPcds = {}
+ ShareFixedAtBuildPcdsSameValue = {}
+ for Module in LibAuto._ReferenceModules:
+ for Pcd in Module.FixedAtBuildPcds + LibAuto.FixedAtBuildPcds:
+ key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
+ if key not in FixedAtBuildPcds:
+ ShareFixedAtBuildPcdsSameValue[key] = True
+ FixedAtBuildPcds[key] = Pcd.DefaultValue
+ else:
+ if FixedAtBuildPcds[key] != Pcd.DefaultValue:
+ ShareFixedAtBuildPcdsSameValue[key] = False
+ for Pcd in LibAuto.FixedAtBuildPcds:
+ key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
+ if (Pcd.TokenCName,Pcd.TokenSpaceGuidCName) not in self.NonDynamicPcdDict:
+ continue
+ else:
+ DscPcd = self.NonDynamicPcdDict[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)]
+ if DscPcd.Type != "FixedAtBuild":
+ continue
+ if key in ShareFixedAtBuildPcdsSameValue and ShareFixedAtBuildPcdsSameValue[key]:
+ LibAuto.ConstPcd[key] = Pcd.DefaultValue
+
## Collect dynamic PCDs
#
# Gather dynamic PCDs list from each module and their settings from platform
@@ -1296,6 +1324,13 @@ class PlatformAutoGen(AutoGen):
self._PackageList = list(self._PackageList)
return self._PackageList
+ def _GetNonDynamicPcdDict(self):
+ if self._NonDynamicPcdDict:
+ return self._NonDynamicPcdDict
+ for Pcd in self.NonDynamicPcdList:
+ self._NonDynamicPcdDict[(Pcd.TokenCName,Pcd.TokenSpaceGuidCName)] = Pcd
+ return self._NonDynamicPcdDict
+
## Get list of non-dynamic PCDs
def _GetNonDynamicPcdList(self):
if self._NonDynamicPcdList == None:
@@ -1373,6 +1408,8 @@ class PlatformAutoGen(AutoGen):
for La in Ma.LibraryAutoGenList:
if La not in self._LibraryAutoGenList:
self._LibraryAutoGenList.append(La)
+ if Ma not in La._ReferenceModules:
+ La._ReferenceModules.append(Ma)
## Summarize ModuleAutoGen objects of all modules to be built for this platform
def _GetModuleAutoGenList(self):
@@ -1911,6 +1948,7 @@ class PlatformAutoGen(AutoGen):
PcdTokenNumber = property(_GetPcdTokenNumbers) # (TokenCName, TokenSpaceGuidCName) : GeneratedTokenNumber
DynamicPcdList = property(_GetDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
NonDynamicPcdList = property(_GetNonDynamicPcdList) # [(TokenCName1, TokenSpaceGuidCName1), (TokenCName2, TokenSpaceGuidCName2), ...]
+ NonDynamicPcdDict = property(_GetNonDynamicPcdDict)
PackageList = property(_GetPackageList)
ToolDefinition = property(_GetToolDefinition) # toolcode : tool path
@@ -2027,12 +2065,35 @@ class ModuleAutoGen(AutoGen):
self._FinalBuildTargetList = None
self._FileTypes = None
self._BuildRules = None
-
+
+ ## The Modules referenced to this Library
+ # Only Library has this attribute
+ self._ReferenceModules = []
+
+ ## Store the FixedAtBuild Pcds
+ #
+ self._FixedAtBuildPcds = []
+ self.ConstPcd = {}
return True
def __repr__(self):
return "%s [%s]" % (self.MetaFile, self.Arch)
+ # Get FixedAtBuild Pcds of this Module
+ def _GetFixedAtBuildPcds(self):
+ if self._FixedAtBuildPcds:
+ return self._FixedAtBuildPcds
+ for Pcd in self.ModulePcdList:
+ if self.IsLibrary:
+ if not (Pcd.Pending == False and Pcd.Type == "FixedAtBuild"):
+ continue
+ elif Pcd.Type != "FixedAtBuild":
+ continue
+ if Pcd not in self._FixedAtBuildPcds:
+ self._FixedAtBuildPcds.append(Pcd)
+
+ return self._FixedAtBuildPcds
+
# Macros could be used in build_rule.txt (also Makefile)
def _GetMacros(self):
if self._Macro == None:
@@ -3102,6 +3163,8 @@ class ModuleAutoGen(AutoGen):
BuildOption = property(_GetModuleBuildOption)
BuildOptionIncPathList = property(_GetBuildOptionIncPathList)
BuildCommand = property(_GetBuildCommand)
+
+ FixedAtBuildPcds = property(_GetFixedAtBuildPcds)
# This acts like the main() function for the script, unless it is 'import'ed into another script.
if __name__ == '__main__':
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 63ba2b241..621b57282 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -1069,10 +1069,15 @@ def CreateLibraryPcdCode(Info, AutoGenC, AutoGenH, Pcd):
AutoGenH.Append('#define %s %s_gPcd_BinaryPatch_%s\n' %(GetModeName, Type, TokenCName))
AutoGenH.Append('#define %s(Value) (%s = (Value))\n' % (SetModeName, PcdVariableName))
if PcdItemType == TAB_PCDS_FIXED_AT_BUILD or PcdItemType == TAB_PCDS_FEATURE_FLAG:
+ key = ".".join((Pcd.TokenSpaceGuidCName,Pcd.TokenCName))
+
AutoGenH.Append('extern const %s _gPcd_FixedAtBuild_%s%s;\n' %(DatumType, TokenCName, Array))
AutoGenH.Append('#define %s %s_gPcd_FixedAtBuild_%s\n' %(GetModeName, Type, TokenCName))
AutoGenH.Append('//#define %s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\n' % SetModeName)
-
+
+ if PcdItemType == TAB_PCDS_FIXED_AT_BUILD and key in Info.ConstPcd:
+ AutoGenH.Append('#define _PCD_VALUE_%s %s\n' %(TokenCName, Pcd.DefaultValue))
+
## Create code for library constructor
diff --git a/BaseTools/Source/Python/AutoGen/GenPcdDb.py b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
index 08719fa73..289a6ff84 100644
--- a/BaseTools/Source/Python/AutoGen/GenPcdDb.py
+++ b/BaseTools/Source/Python/AutoGen/GenPcdDb.py
@@ -528,13 +528,20 @@ class DbSizeTableItemList (DbItemList):
if RawDataList is None:
RawDataList = []
DbItemList.__init__(self, ItemSize, DataList, RawDataList)
+ def GetListSize(self):
+ length = 0
+ for Data in self.RawDataList:
+ length += (1 + len(Data[1]))
+ return length * self.ItemSize
def PackData(self):
- PackStr = "=HH"
+ PackStr = "=H"
Buffer = ''
for Data in self.RawDataList:
Buffer += pack(PackStr,
- GetIntegerValue(Data[0]),
- GetIntegerValue(Data[1]))
+ GetIntegerValue(Data[0]))
+ for subData in Data[1]:
+ Buffer += pack(PackStr,
+ GetIntegerValue(subData))
return Buffer
## DbStringItemList
@@ -732,7 +739,7 @@ def BuildExDataBase(Dict):
DbPcdNameOffsetTable = DbItemList(4,RawDataList = PcdNameOffsetTable)
SizeTableValue = zip(Dict['SIZE_TABLE_MAXIMUM_LENGTH'], Dict['SIZE_TABLE_CURRENT_LENGTH'])
- DbSizeTableValue = DbSizeTableItemList(4, RawDataList = SizeTableValue)
+ DbSizeTableValue = DbSizeTableItemList(2, RawDataList = SizeTableValue)
InitValueUint16 = Dict['INIT_DB_VALUE_UINT16']
DbInitValueUint16 = DbComItemList(2, RawDataList = InitValueUint16)
VardefValueUint16 = Dict['VARDEF_DB_VALUE_UINT16']
@@ -812,7 +819,7 @@ def BuildExDataBase(Dict):
SkuIndexIndexTable = [(0) for i in xrange(len(Dict['SKU_INDEX_VALUE']))]
SkuIndexIndexTable[0] = 0 #Dict['SKU_INDEX_VALUE'][0][0]
for i in range(1,len(Dict['SKU_INDEX_VALUE'])):
- SkuIndexIndexTable[i] = SkuIndexIndexTable[i-1]+Dict['SKU_INDEX_VALUE'][i-1][0]
+ SkuIndexIndexTable[i] = SkuIndexIndexTable[i-1]+Dict['SKU_INDEX_VALUE'][i-1][0] + 1
for (LocalTokenNumberTableIndex, (Offset, Table)) in enumerate(LocalTokenNumberTable):
DbIndex = 0
DbOffset = FixedHeaderLen
@@ -829,7 +836,7 @@ def BuildExDataBase(Dict):
LocalTokenNumberTable[LocalTokenNumberTableIndex] = DbOffset|int(TokenTypeValue)
# if PCD_TYPE_SKU_ENABLED, then we need to fix up the SkuTable
- SkuIndexTabalOffset = SkuIdTableOffset + Dict['SKUID_VALUE'][0]
+ SkuIndexTabalOffset = SkuIdTableOffset + Dict['SKUID_VALUE'][0] + 1
if (TokenTypeValue & (0x2 << 28)):
SkuTable[SkuHeaderIndex] = (DbOffset|int(TokenTypeValue & ~(0x2<<28)), SkuIndexTabalOffset + SkuIndexIndexTable[SkuHeaderIndex])
LocalTokenNumberTable[LocalTokenNumberTableIndex] = (SkuTableOffset + SkuHeaderIndex * 8) | int(TokenTypeValue)
@@ -842,6 +849,7 @@ def BuildExDataBase(Dict):
# resolve variable table offset
for VariableEntries in VariableTable:
+ skuindex = 0
for VariableEntryPerSku in VariableEntries:
(VariableHeadGuidIndex, VariableHeadStringIndex, SKUVariableOffset, VariableOffset, VariableRefTable) = VariableEntryPerSku[:]
DbIndex = 0
@@ -853,7 +861,9 @@ def BuildExDataBase(Dict):
DbOffset += DbItemTotal[DbIndex].GetListSize()
else:
assert(False)
-
+ if isinstance(VariableRefTable[0],list):
+ DbOffset += skuindex * 4
+ skuindex += 1
if DbIndex >= InitTableNum:
assert(False)
@@ -995,10 +1005,6 @@ def CreatePcdDatabaseCode (Info, AutoGenC, AutoGenH):
DbFile.write(PcdDbBuffer)
Changed = SaveFileOnChange(DbFileName, DbFile.getvalue(), True)
-
-def CArrayToArray(carray):
- return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in carray])
-
## Create PCD database in DXE or PEI phase
#
# @param Platform The platform object
@@ -1094,6 +1100,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
Dict['PCD_TOKENSPACE_MAP'] = []
Dict['PCD_NAME_OFFSET'] = []
+ PCD_STRING_INDEX_MAP = {}
+
StringTableIndex = 0
StringTableSize = 0
NumberOfLocalTokens = 0
@@ -1105,6 +1113,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
GuidList = []
i = 0
for Pcd in Platform.DynamicPcdList:
+ VoidStarTypeCurrSize = []
i += 1
CName = Pcd.TokenCName
TokenSpaceGuidCName = Pcd.TokenSpaceGuidCName
@@ -1156,6 +1165,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
SkuIndexTableTmp = []
SkuIndexTableTmp.append(0)
SkuIdIndex = 1
+ VariableHeadList = []
for SkuName in Pcd.SkuInfoList:
Sku = Pcd.SkuInfoList[SkuName]
SkuId = Sku.SkuId
@@ -1171,27 +1181,36 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
if len(Sku.VariableName) > 0:
Pcd.TokenTypeList += ['PCD_TYPE_HII']
Pcd.InitString = 'INIT'
- # store VariableName to stringTable and calculate the VariableHeadStringIndex
- if Sku.VariableName.startswith('{'):
- VariableNameStructure = CArrayToArray(Sku.VariableName)
- else:
- VariableNameStructure = StringToArray(Sku.VariableName)
- if VariableNameStructure not in Dict['STRING_TABLE_VALUE']:
- Dict['STRING_TABLE_CNAME'].append(CName)
- Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
- if StringTableIndex == 0:
- Dict['STRING_TABLE_INDEX'].append('')
- else:
- Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
-
- Dict['STRING_TABLE_LENGTH'].append((len(Sku.VariableName) - 3 + 1) * 2 )
- Dict['STRING_TABLE_VALUE'].append(VariableNameStructure)
- StringTableIndex += 1
- StringTableSize += (len(Sku.VariableName) - 3 + 1) * 2
- VariableHeadStringIndex = 0
- for Index in range(Dict['STRING_TABLE_VALUE'].index(VariableNameStructure)):
- VariableHeadStringIndex += Dict['STRING_TABLE_LENGTH'][Index]
-
+ # Store all variable names of one HII PCD under different SKU to stringTable
+ # and calculate the VariableHeadStringIndex
+ if SkuIdIndex - 2 == 0:
+ for SkuName in Pcd.SkuInfoList:
+ SkuInfo = Pcd.SkuInfoList[SkuName]
+ if SkuInfo.SkuId == None or SkuInfo.SkuId == '':
+ continue
+ VariableNameStructure = StringToArray(SkuInfo.VariableName)
+ if VariableNameStructure not in Dict['STRING_TABLE_VALUE']:
+ Dict['STRING_TABLE_CNAME'].append(CName)
+ Dict['STRING_TABLE_GUID'].append(TokenSpaceGuid)
+ if StringTableIndex == 0:
+ Dict['STRING_TABLE_INDEX'].append('')
+ else:
+ Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
+ VarNameSize = len(VariableNameStructure.replace(',',' ').split())
+ Dict['STRING_TABLE_LENGTH'].append(VarNameSize )
+ Dict['STRING_TABLE_VALUE'].append(VariableNameStructure)
+ StringHeadOffsetList.append(str(StringTableSize) + 'U')
+ VarStringDbOffsetList = []
+ VarStringDbOffsetList.append(StringTableSize)
+ Dict['STRING_DB_VALUE'].append(VarStringDbOffsetList)
+ StringTableIndex += 1
+ StringTableSize += len(VariableNameStructure.replace(',',' ').split())
+ VariableHeadStringIndex = 0
+ for Index in range(Dict['STRING_TABLE_VALUE'].index(VariableNameStructure)):
+ VariableHeadStringIndex += Dict['STRING_TABLE_LENGTH'][Index]
+ VariableHeadList.append(VariableHeadStringIndex)
+
+ VariableHeadStringIndex = VariableHeadList[SkuIdIndex - 2]
# store VariableGuid to GuidTable and get the VariableHeadGuidIndex
VariableGuidStructure = Sku.VariableGuidValue
VariableGuid = GuidStructureStringToGuidValueName(VariableGuidStructure)
@@ -1246,7 +1265,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
# the Pcd default value was filled before
VariableOffset = len(Dict['VARDEF_DB_VALUE_' + Pcd.DatumType]) - 1
VariableRefTable = Dict['VARDEF_DB_VALUE_' + Pcd.DatumType]
- VariableDbValueList.append([VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset, VariableOffset, VariableRefTable])
+ VariableDbValueList.append([VariableHeadGuidIndex, VariableHeadStringIndex, Sku.VariableOffset, VariableOffset, VariableRefTable])
elif Sku.VpdOffset != '':
Pcd.TokenTypeList += ['PCD_TYPE_VPD']
@@ -1256,11 +1275,8 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
# Also add the VOID* string of VPD PCD to SizeTable
if Pcd.DatumType == 'VOID*':
NumberOfSizeItems += 1
- Dict['SIZE_TABLE_CNAME'].append(CName)
- Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
# For VPD type of PCD, its current size is equal to its MAX size.
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
+ VoidStarTypeCurrSize = [str(Pcd.MaxDatumSize) + 'U']
continue
if Pcd.DatumType == 'VOID*':
@@ -1278,29 +1294,36 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
else:
Dict['STRING_TABLE_INDEX'].append('_%d' % StringTableIndex)
if Sku.DefaultValue[0] == 'L':
- Size = (len(Sku.DefaultValue) - 3 + 1) * 2
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
+ DefaultValueBinStructure = StringToArray(Sku.DefaultValue)
+ Size = len(DefaultValueBinStructure.replace(',',' ').split())
+ Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure)
elif Sku.DefaultValue[0] == '"':
- Size = len(Sku.DefaultValue) - 2 + 1
- Dict['STRING_TABLE_VALUE'].append(StringToArray(Sku.DefaultValue))
+ DefaultValueBinStructure = StringToArray(Sku.DefaultValue)
+ Size = len(Sku.DefaultValue) -2 + 1
+ Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure)
elif Sku.DefaultValue[0] == '{':
- Size = len(Sku.DefaultValue.replace(',',' ').split())
- Dict['STRING_TABLE_VALUE'].append(Sku.DefaultValue)
+ DefaultValueBinStructure = StringToArray(Sku.DefaultValue)
+ Size = len(Sku.DefaultValue.split(","))
+ Dict['STRING_TABLE_VALUE'].append(DefaultValueBinStructure)
StringHeadOffsetList.append(str(StringTableSize) + 'U')
StringDbOffsetList.append(StringTableSize)
- Dict['SIZE_TABLE_CNAME'].append(CName)
- Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append(str(Size) + 'U')
- Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
if Pcd.MaxDatumSize != '':
MaxDatumSize = int(Pcd.MaxDatumSize, 0)
if MaxDatumSize < Size:
- MaxDatumSize = Size
- Size = MaxDatumSize
- Dict['STRING_TABLE_LENGTH'].append(Size)
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Platform))
+ else:
+ MaxDatumSize = Size
+ StringTabLen = MaxDatumSize
+ if StringTabLen % 2:
+ StringTabLen += 1
+ if Sku.VpdOffset == '':
+ VoidStarTypeCurrSize.append(str(Size) + 'U')
+ Dict['STRING_TABLE_LENGTH'].append(StringTabLen)
StringTableIndex += 1
- StringTableSize += (Size)
+ StringTableSize += (StringTabLen)
else:
if "PCD_TYPE_HII" not in Pcd.TokenTypeList:
Pcd.TokenTypeList += ['PCD_TYPE_DATA']
@@ -1326,8 +1349,14 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
DbValueList.append(Sku.DefaultValue)
Pcd.TokenTypeList = list(set(Pcd.TokenTypeList))
+ if Pcd.DatumType == 'VOID*':
+ Dict['SIZE_TABLE_CNAME'].append(CName)
+ Dict['SIZE_TABLE_GUID'].append(TokenSpaceGuid)
+ Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(str(Pcd.MaxDatumSize) + 'U')
+ Dict['SIZE_TABLE_CURRENT_LENGTH'].append(VoidStarTypeCurrSize)
- SkuIndexTableTmp[0] = len(SkuIndexTableTmp)
+
+ SkuIndexTableTmp[0] = len(SkuIndexTableTmp) - 1
if len(Pcd.SkuInfoList) > 1:
Dict['SKU_INDEX_VALUE'].append(SkuIndexTableTmp)
@@ -1352,6 +1381,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
Dict['STRING_HEAD_NUMSKUS_DECL'].append(len(Pcd.SkuInfoList))
Dict['STRING_HEAD_VALUE'].append(', '.join(StringHeadOffsetList))
Dict['STRING_DB_VALUE'].append(StringDbOffsetList)
+ PCD_STRING_INDEX_MAP[len(Dict['STRING_HEAD_CNAME_DECL']) -1 ] = len(Dict['STRING_DB_VALUE']) -1
if 'PCD_TYPE_DATA' in Pcd.TokenTypeList:
Dict[Pcd.InitString+'_CNAME_DECL_'+Pcd.DatumType].append(CName)
Dict[Pcd.InitString+'_GUID_DECL_'+Pcd.DatumType].append(TokenSpaceGuid)
@@ -1405,11 +1435,12 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
TokenSpaceGuidCNameArray = StringToArray('"' + TokenSpaceGuidCName + '"' )
if TokenSpaceGuidCNameArray not in Dict['PCD_TOKENSPACE']:
Dict['PCD_TOKENSPACE'].append(TokenSpaceGuidCNameArray)
- Dict['PCD_TOKENSPACE_LENGTH'].append( len(TokenSpaceGuidCName) + 1 )
+ Dict['PCD_TOKENSPACE_LENGTH'].append( len(TokenSpaceGuidCNameArray.split(",")) )
Dict['PCD_TOKENSPACE_MAP'][GeneratedTokenNumber] = Dict['PCD_TOKENSPACE'].index(TokenSpaceGuidCNameArray)
- Dict['PCD_CNAME'][GeneratedTokenNumber] = StringToArray('"' + CName + '"' )
+ CNameBinArray = StringToArray('"' + CName + '"' )
+ Dict['PCD_CNAME'][GeneratedTokenNumber] = CNameBinArray
- Dict['PCD_CNAME_LENGTH'][GeneratedTokenNumber] = len(CName) + 1
+ Dict['PCD_CNAME_LENGTH'][GeneratedTokenNumber] = len(CNameBinArray.split(","))
Pcd.TokenTypeList = list(set(Pcd.TokenTypeList))
@@ -1427,6 +1458,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
if 'PCD_TYPE_STRING' in Pcd.TokenTypeList and 'PCD_TYPE_HII' not in Pcd.TokenTypeList:
# Find index by CName, TokenSpaceGuid
Offset = GetMatchedIndex(CName, Dict['STRING_HEAD_CNAME_DECL'], TokenSpaceGuid, Dict['STRING_HEAD_GUID_DECL'])
+ Offset = PCD_STRING_INDEX_MAP[Offset]
assert(Offset != -1)
Table = Dict['STRING_DB_VALUE']
if 'PCD_TYPE_DATA' in Pcd.TokenTypeList:
@@ -1475,13 +1507,13 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
Dict['PCD_TOKENSPACE_OFFSET'].append(TokenSpaceIndex)
for index in range(len(Dict['PCD_TOKENSPACE'])):
StringTableSize += Dict['PCD_TOKENSPACE_LENGTH'][index]
-
+ StringTableIndex += 1
for index in range(len(Dict['PCD_CNAME'])):
Dict['PCD_CNAME_OFFSET'].append(StringTableSize)
Dict['PCD_NAME_OFFSET'].append(Dict['PCD_TOKENSPACE_OFFSET'][index])
Dict['PCD_NAME_OFFSET'].append(StringTableSize)
StringTableSize += Dict['PCD_CNAME_LENGTH'][index]
-
+ StringTableIndex += 1
if GuidList != []:
Dict['GUID_TABLE_EMPTY'] = 'FALSE'
Dict['GUID_TABLE_SIZE'] = str(len(GuidList)) + 'U'
@@ -1501,7 +1533,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
if Dict['SIZE_TABLE_CNAME'] == []:
Dict['SIZE_TABLE_CNAME'].append('')
Dict['SIZE_TABLE_GUID'].append('')
- Dict['SIZE_TABLE_CURRENT_LENGTH'].append('0U')
+ Dict['SIZE_TABLE_CURRENT_LENGTH'].append(['0U'])
Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append('0U')
if NumberOfLocalTokens != 0:
@@ -1524,7 +1556,7 @@ def CreatePcdDatabasePhaseSpecificAutoGen (Platform, Phase):
if NumberOfSkuEnabledPcd != 0:
Dict['SKU_HEAD_SIZE'] = str(NumberOfSkuEnabledPcd) + 'U'
- Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE'])
+ Dict['SKUID_VALUE'][0] = len(Dict['SKUID_VALUE']) - 1
AutoGenH.Append(gPcdDatabaseAutoGenH.Replace(Dict))
if NumberOfLocalTokens == 0:
diff --git a/BaseTools/Source/Python/Common/BuildVersion.py b/BaseTools/Source/Python/Common/BuildVersion.py
index 2a3b0aa68..4decd82c7 100644
--- a/BaseTools/Source/Python/Common/BuildVersion.py
+++ b/BaseTools/Source/Python/Common/BuildVersion.py
@@ -13,4 +13,4 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
-gBUILD_VERSION = "Build 2610"
+gBUILD_VERSION = "Build 2640"
diff --git a/BaseTools/Source/Python/Common/DataType.py b/BaseTools/Source/Python/Common/DataType.py
index dbe7215f4..cd420d168 100644
--- a/BaseTools/Source/Python/Common/DataType.py
+++ b/BaseTools/Source/Python/Common/DataType.py
@@ -486,6 +486,8 @@ PCDS_DYNAMICEX_DEFAULT = "PcdsDynamicExDefault"
PCDS_DYNAMICEX_VPD = "PcdsDynamicExVpd"
PCDS_DYNAMICEX_HII = "PcdsDynamicExHii"
+SECTIONS_HAVE_ITEM_PCD = [PCDS_DYNAMIC_DEFAULT.upper(),PCDS_DYNAMIC_VPD.upper(),PCDS_DYNAMIC_HII.upper(), \
+ PCDS_DYNAMICEX_DEFAULT.upper(),PCDS_DYNAMICEX_VPD.upper(),PCDS_DYNAMICEX_HII.upper()]
# Section allowed to have items after arch
SECTIONS_HAVE_ITEM_AFTER_ARCH = [TAB_LIBRARY_CLASSES.upper(), TAB_DEPEX.upper(), TAB_USER_EXTENSIONS.upper(),
PCDS_DYNAMIC_DEFAULT.upper(),
diff --git a/BaseTools/Source/Python/Common/Misc.py b/BaseTools/Source/Python/Common/Misc.py
index 960581581..fafd84a0e 100644
--- a/BaseTools/Source/Python/Common/Misc.py
+++ b/BaseTools/Source/Python/Common/Misc.py
@@ -1238,9 +1238,16 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
Value = FieldList[0]
Size = ''
if len(FieldList) > 1:
- Size = FieldList[1]
+ Type = FieldList[1]
+ # Fix the PCD type when no DataType input
+ if Type == 'VOID*':
+ DataType = 'VOID*'
+ else:
+ Size = FieldList[1]
+ if len(FieldList) > 2:
+ Size = FieldList[2]
if DataType == 'VOID*':
- IsValid = (len(FieldList) <= 2)
+ IsValid = (len(FieldList) <= 3)
else:
IsValid = (len(FieldList) <= 1)
return [Value, '', Size], IsValid, 0
@@ -1255,7 +1262,12 @@ def AnalyzeDscPcd(Setting, PcdType, DataType=''):
Size = FieldList[2]
else:
if Type == 'VOID*':
- Size = str(len(Value))
+ if Value.startswith("L"):
+ Size = str((len(Value)- 3 + 1) * 2)
+ elif Value.startswith("{"):
+ Size = str(len(Value.split(",")))
+ else:
+ Size = str(len(Value) -2 + 1 )
if DataType == 'VOID*':
IsValid = (len(FieldList) <= 3)
else:
diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Python/Common/String.py
index c28232667..04b45a0b8 100644
--- a/BaseTools/Source/Python/Common/String.py
+++ b/BaseTools/Source/Python/Common/String.py
@@ -401,16 +401,6 @@ def CleanString2(Line, CommentCharacter=DataType.TAB_COMMENT_SPLIT, AllowCppStyl
Comment = Line[Index:].strip()
Line = Line[0:Index].strip()
break
- if Comment:
- # Remove prefixed and trailing comment characters
- Start = 0
- End = len(Comment)
- while Start < End and Comment.startswith(CommentCharacter, Start, End):
- Start += 1
- while End >= 0 and Comment.endswith(CommentCharacter, Start, End):
- End -= 1
- Comment = Comment[Start:End]
- Comment = Comment.strip()
return Line, Comment
@@ -811,11 +801,25 @@ def StringToArray(String):
return "{%s, 0x00, 0x00}" % ", ".join(["0x%02x, 0x00" % ord(C) for C in String[2:-1]])
elif String.startswith('"'):
if String == "\"\"":
- return "{0x00}";
+ return "{0x00,0x00}"
else:
- return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ StringLen = len(String[1:-1])
+ if StringLen % 2:
+ return "{%s, 0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ else:
+ return "{%s, 0x00,0x00}" % ", ".join(["0x%02x" % ord(C) for C in String[1:-1]])
+ elif String.startswith('{'):
+ StringLen = len(String.split(","))
+ if StringLen % 2:
+ return "{%s, 0x00}" % ", ".join([ C for C in String[1:-1].split(',')])
+ else:
+ return "{%s}" % ", ".join([ C for C in String[1:-1].split(',')])
+
else:
- return '{%s, 0}' % ', '.join(String.split())
+ if len(String.split()) % 2:
+ return '{%s, 0}' % ', '.join(String.split())
+ else:
+ return '{%s, 0,0}' % ', '.join(String.split())
def StringArrayLength(String):
if isinstance(String, unicode):
diff --git a/BaseTools/Source/Python/CommonDataClass/DataClass.py b/BaseTools/Source/Python/CommonDataClass/DataClass.py
index c69152b9b..2cc09ff33 100644
--- a/BaseTools/Source/Python/CommonDataClass/DataClass.py
+++ b/BaseTools/Source/Python/CommonDataClass/DataClass.py
@@ -97,6 +97,7 @@ MODEL_META_DATA_COMMENT = 5016
MODEL_META_DATA_GLOBAL_DEFINE = 5017
MODEL_META_DATA_SECTION_HEADER = 5100
MODEL_META_DATA_SUBSECTION_HEADER = 5200
+MODEL_META_DATA_TAIL_COMMENT = 5300
MODEL_EXTERNAL_DEPENDENCY = 10000
diff --git a/BaseTools/Source/Python/GenFds/CapsuleData.py b/BaseTools/Source/Python/GenFds/CapsuleData.py
index aef8df0e1..2d532bea0 100644
--- a/BaseTools/Source/Python/GenFds/CapsuleData.py
+++ b/BaseTools/Source/Python/GenFds/CapsuleData.py
@@ -1,7 +1,7 @@
## @file
# generate capsule
#
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007-2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -134,4 +134,24 @@ class CapsuleAnyFile (CapsuleData):
# @retval string Generated file name
#
def GenCapsuleSubItem(self):
+ return self.FileName
+
+## Afile class for capsule data
+#
+#
+class CapsuleAfile (CapsuleData):
+ ## The constructor
+ #
+ # @param self The object pointer
+ #
+ def __init__(self) :
+ self.Ffs = None
+ self.FileName = None
+
+ ## generate Afile capsule data
+ #
+ # @param self The object pointer
+ # @retval string Generated file name
+ #
+ def GenCapsuleSubItem(self):
return self.FileName \ No newline at end of file
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py
index 661e16ae4..f1e03f4c3 100644
--- a/BaseTools/Source/Python/GenFds/FdfParser.py
+++ b/BaseTools/Source/Python/GenFds/FdfParser.py
@@ -1,7 +1,7 @@
## @file
# parse FDF file
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -77,6 +77,7 @@ SEPERATOR_TUPLE = ('=', '|', ',', '{', '}')
RegionSizePattern = re.compile("\s*(?P<base>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<size>(?:0x|0X)?[a-fA-F0-9]+)\s*")
RegionSizeGuidPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*\|\s*(?P<size>\w+\.\w+)\s*")
+RegionOffsetPcdPattern = re.compile("\s*(?P<base>\w+\.\w+)\s*$")
ShortcutPcdPattern = re.compile("\s*\w+\s*=\s*(?P<value>(?:0x|0X)?[a-fA-F0-9]+)\s*\|\s*(?P<name>\w+\.\w+)\s*")
IncludeFileList = []
@@ -1732,8 +1733,7 @@ class FdfParser:
try:
return long(
ValueExpression(Expr,
- dict(['%s.%s' % (Pcd[1], Pcd[0]), Val]
- for Pcd, Val in self.Profile.PcdDict.iteritems())
+ self.__CollectMacroPcd()
)(True),0)
except Exception:
self.SetFileBufferPos(StartPos)
@@ -1769,16 +1769,26 @@ class FdfParser:
return True
if not self.__Token in ("SET", "FV", "FILE", "DATA", "CAPSULE"):
+ #
+ # If next token is a word which is not a valid FV type, it might be part of [PcdOffset[|PcdSize]]
+ # Or it might be next region's offset described by an expression which starts with a PCD.
+ # PcdOffset[|PcdSize] or OffsetPcdExpression|Size
+ #
self.__UndoToken()
- RegionObj.PcdOffset = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(Fd.BaseAddress, 0))
- FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple
- if self.__IsToken( "|"):
- RegionObj.PcdSize = self.__GetNextPcdName()
- self.Profile.PcdDict[RegionObj.PcdSize] = "0x%08X" % RegionObj.Size
+ IsRegionPcd = (RegionSizeGuidPattern.match(self.__CurrentLine()[self.CurrentOffsetWithinLine:]) or
+ RegionOffsetPcdPattern.match(self.__CurrentLine()[self.CurrentOffsetWithinLine:]))
+ if IsRegionPcd:
+ RegionObj.PcdOffset = self.__GetNextPcdName()
+ self.Profile.PcdDict[RegionObj.PcdOffset] = "0x%08X" % (RegionObj.Offset + long(Fd.BaseAddress, 0))
+ self.__PcdDict['%s.%s' % (RegionObj.PcdOffset[1], RegionObj.PcdOffset[0])] = "0x%x" % RegionObj.Offset
FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
- self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple
+ self.Profile.PcdFileLineDict[RegionObj.PcdOffset] = FileLineTuple
+ if self.__IsToken( "|"):
+ RegionObj.PcdSize = self.__GetNextPcdName()
+ self.Profile.PcdDict[RegionObj.PcdSize] = "0x%08X" % RegionObj.Size
+ self.__PcdDict['%s.%s' % (RegionObj.PcdSize[1], RegionObj.PcdSize[0])] = "0x%x" % RegionObj.Size
+ FileLineTuple = GetRealFileLine(self.FileName, self.CurrentLineNumber)
+ self.Profile.PcdFileLineDict[RegionObj.PcdSize] = FileLineTuple
if not self.__GetNextWord():
return True
@@ -1805,6 +1815,9 @@ class FdfParser:
self.__UndoToken()
self.__GetRegionDataType( RegionObj)
else:
+ self.__UndoToken()
+ if self.__GetRegionLayout(Fd):
+ return True
raise Warning("A valid region type was not found. "
"Valid types are [SET, FV, CAPSULE, FILE, DATA]. This error occurred",
self.FileName, self.CurrentLineNumber)
@@ -2158,8 +2171,9 @@ class FdfParser:
# @retval None
#
def __GetFvAttributes(self, FvObj):
-
+ IsWordToken = False
while self.__GetNextWord():
+ IsWordToken = True
name = self.__Token
if name not in ("ERASE_POLARITY", "MEMORY_MAPPED", \
"STICKY_WRITE", "LOCK_CAP", "LOCK_STATUS", "WRITE_ENABLED_CAP", \
@@ -2178,7 +2192,7 @@ class FdfParser:
FvObj.FvAttributeDict[name] = self.__Token
- return True
+ return IsWordToken
## __GetFvNameGuid() method
#
@@ -2562,22 +2576,7 @@ class FdfParser:
FfsFileObj.CurrentLineNum = self.CurrentLineNumber
FfsFileObj.CurrentLineContent = self.__CurrentLine()
FfsFileObj.FileName = self.__Token
- if FfsFileObj.FileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #
- # For file in OUTPUT_DIRECTORY will not check whether it exist or not at AutoGen phase.
- #
- if not GlobalData.gAutoGenPhase:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
- else:
- if not self.__GetMacroValue("OUTPUT_DIRECTORY") in FfsFileObj.FileName:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(FfsFileObj.FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
-
+ self.__VerifyFile(FfsFileObj.FileName)
if not self.__IsToken( "}"):
raise Warning("expected '}'", self.FileName, self.CurrentLineNumber)
@@ -2823,11 +2822,7 @@ class FdfParser:
if not self.__GetNextToken():
raise Warning("expected section file path", self.FileName, self.CurrentLineNumber)
DataSectionObj.SectFileName = self.__Token
- if DataSectionObj.SectFileName.replace('$(WORKSPACE)', '').find('$') == -1:
- #do case sensitive check for file path
- ErrorCode, ErrorInfo = PathClass(NormPath(DataSectionObj.SectFileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
- if ErrorCode != 0:
- EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
+ self.__VerifyFile(DataSectionObj.SectFileName)
else:
if not self.__GetCglSection(DataSectionObj):
return False
@@ -2836,6 +2831,21 @@ class FdfParser:
return True
+ ## __VerifyFile
+ #
+ # Check if file exists or not:
+ # If current phase if GenFds, the file must exist;
+ # If current phase is AutoGen and the file is not in $(OUTPUT_DIRECTORY), the file must exist
+ # @param FileName: File path to be verified.
+ #
+ def __VerifyFile(self, FileName):
+ if FileName.replace('$(WORKSPACE)', '').find('$') != -1:
+ return
+ if not GlobalData.gAutoGenPhase or not self.__GetMacroValue("OUTPUT_DIRECTORY") in FileName:
+ ErrorCode, ErrorInfo = PathClass(NormPath(FileName), GenFdsGlobalVariable.WorkSpaceDir).Validate()
+ if ErrorCode != 0:
+ EdkLogger.error("GenFds", ErrorCode, ExtraData=ErrorInfo)
+
## __GetCglSection() method
#
# Get compressed or GUIDed section for Obj
@@ -3066,12 +3076,14 @@ class FdfParser:
Value += self.__Token.strip()
elif Name == 'OEM_CAPSULE_FLAGS':
Value = self.__Token.strip()
+ if not Value.upper().startswith('0X'):
+ raise Warning("expected hex value between 0x0000 and 0xFFFF", self.FileName, self.CurrentLineNumber)
try:
Value = int(Value, 0)
except ValueError:
- raise Warning("expected integer value between 0x0000 and 0xFFFF", self.FileName, self.CurrentLineNumber)
+ raise Warning("expected hex value between 0x0000 and 0xFFFF", self.FileName, self.CurrentLineNumber)
if not 0x0000 <= Value <= 0xFFFF:
- raise Warning("expected integer value between 0x0000 and 0xFFFF", self.FileName, self.CurrentLineNumber)
+ raise Warning("expected hex value between 0x0000 and 0xFFFF", self.FileName, self.CurrentLineNumber)
Value = self.__Token.strip()
else:
Value = self.__Token.strip()
@@ -3095,7 +3107,8 @@ class FdfParser:
IsFv = self.__GetFvStatement(Obj)
IsFd = self.__GetFdStatement(Obj)
IsAnyFile = self.__GetAnyFileStatement(Obj)
- if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile):
+ IsAfile = self.__GetAfileStatement(Obj)
+ if not (IsInf or IsFile or IsFv or IsFd or IsAnyFile or IsAfile):
break
## __GetFvStatement() method
@@ -3187,6 +3200,47 @@ class FdfParser:
CapsuleAnyFile.FileName = AnyFileName
CapsuleObj.CapsuleDataList.append(CapsuleAnyFile)
return True
+
+ ## __GetAfileStatement() method
+ #
+ # Get Afile for capsule
+ #
+ # @param self The object pointer
+ # @param CapsuleObj for whom Afile is got
+ # @retval True Successfully find a Afile statement
+ # @retval False Not able to find a Afile statement
+ #
+ def __GetAfileStatement(self, CapsuleObj):
+
+ if not self.__IsKeyword("APPEND"):
+ return False
+
+ if not self.__IsToken("="):
+ raise Warning("expected '='", self.FileName, self.CurrentLineNumber)
+
+ if not self.__GetNextToken():
+ raise Warning("expected Afile name", self.FileName, self.CurrentLineNumber)
+
+ AfileName = self.__Token
+ AfileBaseName = os.path.basename(AfileName)
+
+ if os.path.splitext(AfileBaseName)[1] not in [".bin",".BIN",".Bin",".dat",".DAT",".Dat",".data",".DATA",".Data"]:
+ raise Warning('invalid binary file type, should be one of "bin","BIN","Bin","dat","DAT","Dat","data","DATA","Data"', \
+ self.FileName, self.CurrentLineNumber)
+
+ if not os.path.isabs(AfileName):
+ AfileName = GenFdsGlobalVariable.ReplaceWorkspaceMacro(AfileName)
+ self.__VerifyFile(AfileName)
+ else:
+ if not os.path.exists(AfileName):
+ raise Warning('%s does not exist' % AfileName, self.FileName, self.CurrentLineNumber)
+ else:
+ pass
+
+ CapsuleAfile = CapsuleData.CapsuleAfile()
+ CapsuleAfile.FileName = AfileName
+ CapsuleObj.CapsuleDataList.append(CapsuleAfile)
+ return True
## __GetRule() method
#
diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
index 3d16398c3..feab8c84a 100644
--- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py
@@ -43,6 +43,8 @@ from PatchPcdValue.PatchPcdValue import PatchBinaryFile
#
#
class FfsInfStatement(FfsInfStatementClassObject):
+ ## The mapping dictionary from datum type to its maximum number.
+ _MAX_SIZE_TYPE = {"BOOLEAN":0x01, "UINT8":0xFF, "UINT16":0xFFFF, "UINT32":0xFFFFFFFF, "UINT64":0xFFFFFFFFFFFFFFFF}
## The constructor
#
# @param self The object pointer
@@ -204,10 +206,15 @@ class FfsInfStatement(FfsInfStatementClassObject):
if Inf._Defs != None and len(Inf._Defs) > 0:
self.OptRomDefs.update(Inf._Defs)
+
self.PatchPcds = []
InfPcds = Inf.Pcds
Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, self.CurrentArch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
FdfPcdDict = GenFdsGlobalVariable.FdfParser.Profile.PcdDict
+
+ # Workaround here: both build and GenFds tool convert the workspace path to lower case
+ # But INF file path in FDF and DSC file may have real case characters.
+ # Try to convert the path to lower case to see if PCDs value are override by DSC.
DscModules = {}
for DscModule in Platform.Modules:
DscModules[str(DscModule).lower()] = Platform.Modules[DscModule]
@@ -217,6 +224,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
continue
if Pcd.Type != 'PatchableInModule':
continue
+ # Override Patchable PCD value by the value from DSC
PatchPcd = None
InfLowerPath = str(PathClassObj).lower()
if InfLowerPath in DscModules and PcdKey in DscModules[InfLowerPath].Pcds:
@@ -227,16 +235,22 @@ class FfsInfStatement(FfsInfStatementClassObject):
if PatchPcd and Pcd.Type == PatchPcd.Type:
DefaultValue = PatchPcd.DefaultValue
DscOverride = True
+
+ # Override Patchable PCD value by the value from FDF
FdfOverride = False
if PcdKey in FdfPcdDict:
DefaultValue = FdfPcdDict[PcdKey]
FdfOverride = True
+
if not DscOverride and not FdfOverride:
continue
+ # Check value, if value are equal, no need to patch
if Pcd.DatumType == "VOID*":
if Pcd.DefaultValue == DefaultValue or DefaultValue in [None, '']:
continue
+ # Get the string size from FDF or DSC
if DefaultValue[0] == 'L':
+ # Remove L"", but the '\0' must be appended
MaxDatumSize = str((len(DefaultValue) - 2) * 2)
elif DefaultValue[0] == '{':
MaxDatumSize = str(len(DefaultValue.split(',')))
@@ -244,6 +258,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
MaxDatumSize = str(len(DefaultValue) - 1)
if DscOverride:
Pcd.MaxDatumSize = PatchPcd.MaxDatumSize
+ # If no defined the maximum size in DSC, try to get current size from INF
if Pcd.MaxDatumSize in ['', None]:
Pcd.MaxDatumSize = str(len(Pcd.DefaultValue.split(',')))
else:
@@ -259,6 +274,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
continue
except:
continue
+ # Check the Pcd size and data type
if Pcd.DatumType == "VOID*":
if int(MaxDatumSize) > int(Pcd.MaxDatumSize):
EdkLogger.error("GenFds", GENFDS_ERROR, "The size of VOID* type PCD '%s.%s' exceeds its maximum size %d bytes." \
@@ -306,7 +322,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
return EfiFile
Basename = os.path.basename(EfiFile)
Output = os.path.join(self.OutputPath, Basename)
- CopyLongFilePath(EfiFile, Output)
+ shutil.copy(EfiFile, Output)
for Pcd in self.PatchPcds:
RetVal, RetStr = PatchBinaryFile(Output, int(Pcd.Offset, 0), Pcd.DatumType, Pcd.DefaultValue, Pcd.MaxDatumSize)
if RetVal:
diff --git a/BaseTools/Source/Python/GenFds/Fv.py b/BaseTools/Source/Python/GenFds/Fv.py
index 6c7a0503c..d79bed2b2 100644
--- a/BaseTools/Source/Python/GenFds/Fv.py
+++ b/BaseTools/Source/Python/GenFds/Fv.py
@@ -86,6 +86,8 @@ class FV (FvClassObject):
GenFdsGlobalVariable.ErrorLogger("Capsule %s in FD region can't contain a FV %s in FD region." % (self.CapsuleName, self.UiFvName.upper()))
GenFdsGlobalVariable.InfLogger( "\nGenerating %s FV" %self.UiFvName)
+ GenFdsGlobalVariable.LargeFileInFvFlags.append(False)
+ FFSGuid = None
if self.FvBaseAddress != None:
BaseAddress = self.FvBaseAddress
@@ -130,12 +132,15 @@ class FV (FvClassObject):
OrigFvInfo = None
if os.path.exists (FvInfoFileName):
OrigFvInfo = open(FvInfoFileName, 'r').read()
+ if GenFdsGlobalVariable.LargeFileInFvFlags[-1]:
+ FFSGuid = GenFdsGlobalVariable.EFI_FIRMWARE_FILE_SYSTEM3_GUID;
GenFdsGlobalVariable.GenerateFirmwareVolume(
FvOutputFile,
[self.InfFileName],
AddressFile=FvInfoFileName,
FfsList=FfsFileList,
- ForceRebase=self.FvForceRebase
+ ForceRebase=self.FvForceRebase,
+ FileSystemGuid=FFSGuid
)
NewFvInfo = None
@@ -159,13 +164,16 @@ class FV (FvClassObject):
for FfsFile in self.FfsList :
FileName = FfsFile.GenFfs(MacroDict, FvChildAddr, BaseAddress)
+ if GenFdsGlobalVariable.LargeFileInFvFlags[-1]:
+ FFSGuid = GenFdsGlobalVariable.EFI_FIRMWARE_FILE_SYSTEM3_GUID;
#Update GenFv again
GenFdsGlobalVariable.GenerateFirmwareVolume(
FvOutputFile,
[self.InfFileName],
AddressFile=FvInfoFileName,
FfsList=FfsFileList,
- ForceRebase=self.FvForceRebase
+ ForceRebase=self.FvForceRebase,
+ FileSystemGuid=FFSGuid
)
#
@@ -194,6 +202,7 @@ class FV (FvClassObject):
self.FvAlignment = str (FvAlignmentValue)
FvFileObj.close()
GenFds.ImageBinDict[self.UiFvName.upper() + 'fv'] = FvOutputFile
+ GenFdsGlobalVariable.LargeFileInFvFlags.pop()
return FvOutputFile
## __InitializeInf__()
diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py
index 400008e81..eca21642c 100644
--- a/BaseTools/Source/Python/GenFds/GenFds.py
+++ b/BaseTools/Source/Python/GenFds/GenFds.py
@@ -1,7 +1,7 @@
## @file
# generate flash image
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -41,7 +41,7 @@ from Common.BuildVersion import gBUILD_VERSION
## Version and Copyright
versionNumber = "1.0" + ' ' + gBUILD_VERSION
__version__ = "%prog Version " + versionNumber
-__copyright__ = "Copyright (c) 2007 - 2010, Intel Corporation All rights reserved."
+__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation All rights reserved."
## Tool entrance method
#
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
index 2fa4cb8c0..1cd31bccc 100644
--- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
+++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
@@ -65,6 +65,19 @@ class GenFdsGlobalVariable:
BuildRuleFamily = "MSFT"
ToolChainFamily = "MSFT"
__BuildRuleDatabase = None
+
+ #
+ # The list whose element are flags to indicate if large FFS or SECTION files exist in FV.
+ # At the beginning of each generation of FV, false flag is appended to the list,
+ # after the call to GenerateSection returns, check the size of the output file,
+ # if it is greater than 0xFFFFFF, the tail flag in list is set to true,
+ # and EFI_FIRMWARE_FILE_SYSTEM3_GUID is passed to C GenFv.
+ # At the end of generation of FV, pop the flag.
+ # List is used as a stack to handle nested FV generation.
+ #
+ LargeFileInFvFlags = []
+ EFI_FIRMWARE_FILE_SYSTEM3_GUID = '5473C07A-3DCB-4dca-BD6F-1E9689E7349A'
+ LARGE_FILE_SIZE = 0x1000000
SectionHeader = struct.Struct("3B 1B")
@@ -390,11 +403,13 @@ class GenFdsGlobalVariable:
Cmd += Input
SaveFileOnChange(CommandFile, ' '.join(Cmd), False)
- if not GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
- return
- GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
+ if GenFdsGlobalVariable.NeedsUpdate(Output, list(Input) + [CommandFile]):
+ GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
+ GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
- GenFdsGlobalVariable.CallExternalTool(Cmd, "Failed to generate section")
+ if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and
+ GenFdsGlobalVariable.LargeFileInFvFlags):
+ GenFdsGlobalVariable.LargeFileInFvFlags[-1] = True
@staticmethod
def GetAlignment (AlignString):
@@ -432,7 +447,7 @@ class GenFdsGlobalVariable:
@staticmethod
def GenerateFirmwareVolume(Output, Input, BaseAddress=None, ForceRebase=None, Capsule=False, Dump=False,
- AddressFile=None, MapFile=None, FfsList=[]):
+ AddressFile=None, MapFile=None, FfsList=[], FileSystemGuid=None):
if not GenFdsGlobalVariable.NeedsUpdate(Output, Input+FfsList):
return
GenFdsGlobalVariable.DebugLogger(EdkLogger.DEBUG_5, "%s needs update because of newer %s" % (Output, Input))
@@ -454,6 +469,8 @@ class GenFdsGlobalVariable:
Cmd += ["-a", AddressFile]
if MapFile not in [None, '']:
Cmd += ["-m", MapFile]
+ if FileSystemGuid:
+ Cmd += ["-g", FileSystemGuid]
Cmd += ["-o", Output]
for I in Input:
Cmd += ["-i", I]
diff --git a/BaseTools/Source/Python/UPT/BuildVersion.py b/BaseTools/Source/Python/UPT/BuildVersion.py
index 2858e32c0..1ce93dbe8 100644
--- a/BaseTools/Source/Python/UPT/BuildVersion.py
+++ b/BaseTools/Source/Python/UPT/BuildVersion.py
@@ -17,4 +17,4 @@
Build version information
'''
-gBUILD_VERSION = "Build 2610"
+gBUILD_VERSION = "Build 2640"
diff --git a/BaseTools/Source/Python/UPT/Library/DataType.py b/BaseTools/Source/Python/UPT/Library/DataType.py
index de3c7092a..4b30f3343 100644
--- a/BaseTools/Source/Python/UPT/Library/DataType.py
+++ b/BaseTools/Source/Python/UPT/Library/DataType.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define class for data type structure
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -340,6 +340,7 @@ TAB_SLASH = '\\'
TAB_BACK_SLASH = '/'
TAB_SPECIAL_COMMENT = '##'
TAB_HEADER_COMMENT = '@file'
+TAB_BINARY_HEADER_COMMENT = '@BinaryHeader'
TAB_STAR = "*"
TAB_EDK_SOURCE = '$(EDK_SOURCE)'
@@ -735,7 +736,12 @@ TAB_INF_PATCH_PCD = 'PatchPcd'
TAB_INF_PCD = 'Pcd'
TAB_INF_PCD_EX = 'PcdEx'
TAB_INF_GUIDTYPE_VAR = 'Variable'
-
+TAB_INF_ABSTRACT = 'STR_MODULE_ABSTRACT'
+TAB_INF_DESCRIPTION = 'STR_MODULE_DESCRIPTION'
+TAB_INF_LICENSE = 'STR_MODULE_LICENSE'
+TAB_INF_BINARY_ABSTRACT = 'STR_MODULE_BINARY_ABSTRACT'
+TAB_INF_BINARY_DESCRIPTION = 'STR_MODULE_BINARY_DESCRIPTION'
+TAB_INF_BINARY_LICENSE = 'STR_MODULE_BINARY_LICENSE'
#
# Dec Definitions
#
@@ -745,7 +751,12 @@ TAB_DEC_DEFINES_PACKAGE_NAME = 'PACKAGE_NAME'
TAB_DEC_DEFINES_PACKAGE_GUID = 'PACKAGE_GUID'
TAB_DEC_DEFINES_PACKAGE_VERSION = 'PACKAGE_VERSION'
TAB_DEC_DEFINES_PKG_UNI_FILE = 'PKG_UNI_FILE'
-
+TAB_DEC_PACKAGE_ABSTRACT = 'STR_PACKAGE_ABSTRACT'
+TAB_DEC_PACKAGE_DESCRIPTION = 'STR_PACKAGE_DESCRIPTION'
+TAB_DEC_PACKAGE_LICENSE = 'STR_PACKAGE_LICENSE'
+TAB_DEC_BINARY_ABSTRACT = 'STR_PACKAGE_BINARY_ABSTRACT'
+TAB_DEC_BINARY_DESCRIPTION = 'STR_PACKAGE_BINARY_DESCRIPTION'
+TAB_DEC_BINARY_LICENSE = 'STR_PACKAGE_ASBUILT_LICENSE'
#
# Dsc Definitions
#
@@ -814,6 +825,8 @@ TAB_HEADER_ABSTRACT = 'Abstract'
TAB_HEADER_DESCRIPTION = 'Description'
TAB_HEADER_COPYRIGHT = 'Copyright'
TAB_HEADER_LICENSE = 'License'
+TAB_BINARY_HEADER_IDENTIFIER = 'BinaryHeader'
+TAB_BINARY_HEADER_USERID = 'TianoCore'
#
# Build database path
#
diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/Source/Python/UPT/Logger/StringTable.py
index 8a94d7104..6275a3ef5 100644
--- a/BaseTools/Source/Python/UPT/Logger/StringTable.py
+++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py
@@ -1,7 +1,7 @@
## @file
# This file is used to define strings used in the UPT tool
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -42,7 +42,7 @@ MSG_USAGE_STRING = _("\n"
MSG_VERSION_NUMBER = _("1.0")
MSG_VERSION = _("Intel(r) UEFI Packaging Tool (Intel(r) UEFIPT) - Revision " + \
MSG_VERSION_NUMBER)
-MSG_COPYRIGHT = _("Copyright (c) 2011 Intel Corporation All Rights Reserved.")
+MSG_COPYRIGHT = _("Copyright (c) 2011 - 2013 Intel Corporation All Rights Reserved.")
MSG_VERSION_COPYRIGHT = _("\n %s\n %s" % (MSG_VERSION, MSG_COPYRIGHT))
MSG_USAGE = _("%s [options]\n%s" % ("upt.exe", MSG_VERSION_COPYRIGHT))
MSG_DESCRIPTION = _("The Intel(r) UEFIUPT is used to create, " + \
@@ -530,6 +530,10 @@ ERR_COPYRIGHT_MISSING = \
_("Header comment section must have copyright information")
ERR_LICENSE_MISSING = \
_("Header comment section must have license information")
+ERR_INVALID_BINARYHEADER_FORMAT = \
+_("Binary Header comment section must have abstract,description,copyright,license information")
+ERR_MULTIPLE_BINARYHEADER_EXIST = \
+_("the inf file at most support one BinaryHeader at the fileheader section.")
ERR_INVALID_COMMENT_FORMAT = _("Comment must start with #")
ERR_USER_ABORT = _("User has stopped the application")
ERR_DIST_EXT_ERROR = \
@@ -547,6 +551,8 @@ ERR_INSTALL_FILE_DEC_FILE_ERROR = _("Could not obtain the TokenSpaceGuidCName an
ERR_NOT_SUPPORTED_SA_MODULE = _("Stand-alone module distribution does not allow EDK 1 INF")
ERR_INSTALL_DIST_NOT_FOUND = \
_("Distribution file to be installed is not found in current working directory or workspace: %s")
+ERR_BINARY_HEADER_ORDER = _("Binary header must follow the file header.")
+ERR_NO_SOURCE_HEADER = _("File header statement \"## @file\" must exist at the first place.")
#
# Expression error message
diff --git a/BaseTools/Source/Python/UPT/Parser/DecParser.py b/BaseTools/Source/Python/UPT/Parser/DecParser.py
index 823cf71e5..060b9274f 100644
--- a/BaseTools/Source/Python/UPT/Parser/DecParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/DecParser.py
@@ -1,7 +1,7 @@
## @file
# This file is used to parse DEC file. It will consumed by DecParser
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -19,6 +19,7 @@ import Logger.Log as Logger
from Logger.ToolError import FILE_PARSE_FAILURE
from Logger.ToolError import FILE_OPEN_FAILURE
from Logger import StringTable as ST
+from Logger.ToolError import FORMAT_INVALID
import Library.DataType as DT
from Library.ParserValidate import IsValidToken
@@ -735,6 +736,7 @@ class Dec(_DecBase, _DecComments):
_DecComments.__init__(self)
_DecBase.__init__(self, RawData)
+ self.BinaryHeadComment = []
self._Define = _DecDefine(RawData)
self._Include = _DecInclude(RawData)
self._Guid = _DecGuid(RawData)
@@ -778,8 +780,13 @@ class Dec(_DecBase, _DecComments):
# Parse DEC file
#
def ParseDecComment(self):
+ IsFileHeader = False
+ IsBinaryHeader = False
+ FileHeaderLineIndex = -1
+ BinaryHeaderLineIndex = -1
while not self._RawData.IsEndOfFile():
Line, Comment = CleanString(self._RawData.GetNextLine())
+
#
# Header must be pure comment
#
@@ -787,14 +794,55 @@ class Dec(_DecBase, _DecComments):
self._RawData.UndoNextLine()
break
- if Comment:
+ if Comment and Comment.startswith(DT.TAB_SPECIAL_COMMENT) and Comment.find(DT.TAB_HEADER_COMMENT) > 0 \
+ and not Comment[2:Comment.find(DT.TAB_HEADER_COMMENT)].strip():
+ IsFileHeader = True
+ IsBinaryHeader = False
+ FileHeaderLineIndex = self._RawData.LineIndex
+
+ #
+ # Get license information before '@file'
+ #
+ if not IsFileHeader and not IsBinaryHeader and Comment and Comment.startswith(DT.TAB_COMMENT_SPLIT) and \
+ DT.TAB_BINARY_HEADER_COMMENT not in Comment:
self._HeadComment.append((Comment, self._RawData.LineIndex))
+
+ if Comment and IsFileHeader and \
+ not(Comment.startswith(DT.TAB_SPECIAL_COMMENT) \
+ and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0):
+ self._HeadComment.append((Comment, self._RawData.LineIndex))
+ #
+ # Double '#' indicates end of header comments
+ #
+ if (not Comment or Comment == DT.TAB_SPECIAL_COMMENT) and IsFileHeader:
+ IsFileHeader = False
+ continue
+
+ if Comment and Comment.startswith(DT.TAB_SPECIAL_COMMENT) \
+ and Comment.find(DT.TAB_BINARY_HEADER_COMMENT) > 0:
+ IsBinaryHeader = True
+ IsFileHeader = False
+ BinaryHeaderLineIndex = self._RawData.LineIndex
+
+ if Comment and IsBinaryHeader:
+ self.BinaryHeadComment.append((Comment, self._RawData.LineIndex))
#
# Double '#' indicates end of header comments
#
- if not Comment or Comment == DT.TAB_SPECIAL_COMMENT:
+ if (not Comment or Comment == DT.TAB_SPECIAL_COMMENT) and IsBinaryHeader:
+ IsBinaryHeader = False
break
-
+
+ if FileHeaderLineIndex > -1 and not IsFileHeader and not IsBinaryHeader:
+ break
+
+ if FileHeaderLineIndex > BinaryHeaderLineIndex and FileHeaderLineIndex > -1 and BinaryHeaderLineIndex > -1:
+ self._LoggerError(ST.ERR_BINARY_HEADER_ORDER)
+
+ if FileHeaderLineIndex == -1:
+ Logger.Error(TOOL_NAME, FORMAT_INVALID,
+ ST.ERR_NO_SOURCE_HEADER,
+ File=self._RawData.Filename)
return
def _StopCurrentParsing(self, Line):
diff --git a/BaseTools/Source/Python/UPT/Parser/InfParser.py b/BaseTools/Source/Python/UPT/Parser/InfParser.py
index fb90c396f..8a41eca0a 100644
--- a/BaseTools/Source/Python/UPT/Parser/InfParser.py
+++ b/BaseTools/Source/Python/UPT/Parser/InfParser.py
@@ -1,7 +1,7 @@
## @file
# This file contained the parser for INF file
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -128,6 +128,10 @@ class InfParser(InfSectionParser):
#
HeaderCommentStart = False
HeaderCommentEnd = False
+ HeaderStarLineNo = -1
+ BinaryHeaderCommentStart = False
+ BinaryHeaderCommentEnd = False
+ BinaryHeaderStarLineNo = -1
#
# While Section ends. parse whole section contents.
@@ -196,22 +200,16 @@ class InfParser(InfSectionParser):
#
if Line.startswith(DT.TAB_SPECIAL_COMMENT) and \
(Line.find(DT.TAB_HEADER_COMMENT) > -1) and \
- not HeaderCommentStart:
- if CurrentSection != DT.MODEL_UNKNOWN:
- Logger.Error("Parser",
- PARSER_ERROR,
- ST.ERR_INF_PARSER_HEADER_FILE,
- File=Filename,
- Line=LineNo,
- RaiseError = Logger.IS_RAISE_ERROR)
- else:
- CurrentSection = DT.MODEL_META_DATA_FILE_HEADER
- #
- # Append the first line to section lines.
- #
- SectionLines.append((Line, LineNo))
- HeaderCommentStart = True
- continue
+ not HeaderCommentStart and not HeaderCommentEnd:
+
+ CurrentSection = DT.MODEL_META_DATA_FILE_HEADER
+ #
+ # Append the first line to section lines.
+ #
+ HeaderStarLineNo = LineNo
+ SectionLines.append((Line, LineNo))
+ HeaderCommentStart = True
+ continue
#
# Collect Header content.
@@ -226,17 +224,72 @@ class InfParser(InfSectionParser):
#
if (Line.startswith(DT.TAB_SPECIAL_COMMENT) or not Line.strip().startswith("#")) and HeaderCommentStart \
and not HeaderCommentEnd:
- SectionLines.append((Line, LineNo))
+ HeaderCommentEnd = True
+ BinaryHeaderCommentStart = False
+ BinaryHeaderCommentEnd = False
HeaderCommentStart = False
+ if Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1:
+ self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
+ SectionLines = []
+ else:
+ SectionLines.append((Line, LineNo))
#
# Call Header comment parser.
#
self.InfHeaderParser(SectionLines, self.InfHeader, self.FileName)
SectionLines = []
+ continue
+
+ #
+ # check whether binary header comment section started
+ #
+ if Line.startswith(DT.TAB_SPECIAL_COMMENT) and \
+ (Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1) and \
+ not BinaryHeaderCommentStart:
+ SectionLines = []
+ CurrentSection = DT.MODEL_META_DATA_FILE_HEADER
+ #
+ # Append the first line to section lines.
+ #
+ BinaryHeaderStarLineNo = LineNo
+ SectionLines.append((Line, LineNo))
+ BinaryHeaderCommentStart = True
HeaderCommentEnd = True
continue
#
+ # check whether there are more than one binary header exist
+ #
+ if Line.startswith(DT.TAB_SPECIAL_COMMENT) and BinaryHeaderCommentStart and \
+ not BinaryHeaderCommentEnd and (Line.find(DT.TAB_BINARY_HEADER_COMMENT) > -1):
+ Logger.Error('Parser',
+ FORMAT_INVALID,
+ ST.ERR_MULTIPLE_BINARYHEADER_EXIST,
+ File=Filename)
+
+ #
+ # Collect Binary Header content.
+ #
+ if (Line.startswith(DT.TAB_COMMENT_SPLIT) and CurrentSection == DT.MODEL_META_DATA_FILE_HEADER) and\
+ BinaryHeaderCommentStart and not Line.startswith(DT.TAB_SPECIAL_COMMENT) and not\
+ BinaryHeaderCommentEnd and NextLine != '':
+ SectionLines.append((Line, LineNo))
+ continue
+ #
+ # Binary Header content end
+ #
+ if (Line.startswith(DT.TAB_SPECIAL_COMMENT) or not Line.strip().startswith(DT.TAB_COMMENT_SPLIT)) and \
+ BinaryHeaderCommentStart and not BinaryHeaderCommentEnd:
+ SectionLines.append((Line, LineNo))
+ BinaryHeaderCommentStart = False
+ #
+ # Call Binary Header comment parser.
+ #
+ self.InfHeaderParser(SectionLines, self.InfBinaryHeader, self.FileName, True)
+ SectionLines = []
+ BinaryHeaderCommentEnd = True
+ continue
+ #
# Find a new section tab
# Or at the last line of INF file,
# need to process the last section.
@@ -255,6 +308,10 @@ class InfParser(InfSectionParser):
#
if (Line.startswith(DT.TAB_SECTION_START) and \
Line.find(DT.TAB_SECTION_END) > -1) or LastSectionFalg:
+
+ HeaderCommentEnd = True
+ BinaryHeaderCommentEnd = True
+
if not LastSectionFalg:
#
# check to prevent '#' inside section header
@@ -333,18 +390,17 @@ class InfParser(InfSectionParser):
# Clear section lines
#
SectionLines = []
- #
- # End of for
- #
- #
- # Found the first section, No file header.
- #
- if DefineSectionParsedFlag and not HeaderCommentEnd:
+
+ if HeaderStarLineNo == -1:
Logger.Error("InfParser",
FORMAT_INVALID,
- ST.ERR_INF_PARSER_HEADER_MISSGING,
+ ST.ERR_NO_SOURCE_HEADER,
File=self.FullPath)
-
+ if BinaryHeaderStarLineNo > -1 and HeaderStarLineNo > -1 and HeaderStarLineNo > BinaryHeaderStarLineNo:
+ Logger.Error("InfParser",
+ FORMAT_INVALID,
+ ST.ERR_BINARY_HEADER_ORDER,
+ File=self.FullPath)
#
# EDKII INF should not have EDKI style comment
#
@@ -627,4 +683,4 @@ def _ConvertSecNameToType(SectionName):
SectionType = gINF_SECTION_DEF[SectionName.upper()]
return SectionType
- \ No newline at end of file
+
diff --git a/BaseTools/Source/Python/UPT/Xml/CommonXml.py b/BaseTools/Source/Python/UPT/Xml/CommonXml.py
index fff6e6772..0369bfba4 100644
--- a/BaseTools/Source/Python/UPT/Xml/CommonXml.py
+++ b/BaseTools/Source/Python/UPT/Xml/CommonXml.py
@@ -1,7 +1,7 @@
## @file
# This file is used to parse a PCD file of .PKG file
#
-# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -357,8 +357,10 @@ class MiscellaneousFileXml(object):
Executable = XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'Executable')
if Executable.upper() == "TRUE":
Executable = True
- else:
+ elif Executable.upper() == "FALSE":
Executable = False
+ else:
+ Executable = ''
self.Files.append([Filename, Executable])
MiscFile = MiscFileObject()
@@ -392,8 +394,10 @@ class MiscellaneousFileXml(object):
OsType = XmlAttribute(XmlNode(SubItem, '%s/Filename' % Key), 'OS')
if Executable.upper() == "TRUE":
Executable = True
- else:
+ elif Executable.upper() == "FALSE":
Executable = False
+ else:
+ Executable = ''
self.Files.append([Filename, Executable, OsType])
MiscFile = MiscFileObject()
diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 2419d270a..7a6b1be46 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -278,7 +278,7 @@ class MetaFileParser(object):
for Item in GetSplitValueList(self._CurrentLine[1:-1], TAB_COMMA_SPLIT):
if Item == '':
continue
- ItemList = GetSplitValueList(Item, TAB_SPLIT)
+ ItemList = GetSplitValueList(Item, TAB_SPLIT,2)
# different section should not mix in one section
if self._SectionName != '' and self._SectionName != ItemList[0].upper():
EdkLogger.error('Parser', FORMAT_INVALID, "Different section names in the same section",
@@ -305,7 +305,10 @@ class MetaFileParser(object):
# S2 may be Platform or ModuleType
if len(ItemList) > 2:
- S2 = ItemList[2].upper()
+ if self._SectionName.upper() in SECTIONS_HAVE_ITEM_PCD:
+ S2 = ItemList[2]
+ else:
+ S2 = ItemList[2].upper()
else:
S2 = 'COMMON'
self._Scope.append([S1, S2])
@@ -496,6 +499,8 @@ class InfParser(MetaFileParser):
# parse the file line by line
IsFindBlockComment = False
GetHeaderComment = False
+ TailComments = []
+ SectionComments = []
Comments = []
for Index in range(0, len(Content)):
@@ -507,6 +512,9 @@ class InfParser(MetaFileParser):
if Line == '':
if Comment:
Comments.append((Comment, Index + 1))
+ elif GetHeaderComment:
+ SectionComments.extend(Comments)
+ Comments = []
continue
if Line.find(DataType.TAB_COMMENT_EDK_START) > -1:
IsFindBlockComment = True
@@ -527,6 +535,8 @@ class InfParser(MetaFileParser):
self._Store(MODEL_META_DATA_HEADER_COMMENT, Cmt, '', '', 'COMMON',
'COMMON', self._Owner[-1], LNo, -1, LNo, -1, 0)
GetHeaderComment = True
+ else:
+ TailComments.extend(SectionComments + Comments)
Comments = []
self._SectionHeaderParser()
# Check invalid sections
@@ -602,9 +612,16 @@ class InfParser(MetaFileParser):
self._Store(MODEL_META_DATA_COMMENT, Comment, '', '', Arch, Platform,
LastItem, LineNo, -1, LineNo, -1, 0)
Comments = []
+ SectionComments = []
+ TailComments.extend(SectionComments + Comments)
if IsFindBlockComment:
EdkLogger.error("Parser", FORMAT_INVALID, "Open block comments (starting with /*) are expected to end with */",
File=self.MetaFile)
+
+ # If there are tail comments in INF file, save to database whatever the comments are
+ for Comment in TailComments:
+ self._Store(MODEL_META_DATA_TAIL_COMMENT, Comment[0], '', '', 'COMMON',
+ 'COMMON', self._Owner[-1], -1, -1, -1, -1, 0)
self._Done()
## Data parser for the format in which there's path
diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
index 04e3d14df..262ec65e6 100644
--- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
+++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
@@ -1,7 +1,7 @@
## @file
# This file is used to create a database used by build tool
#
-# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -36,6 +36,7 @@ from MetaFileParser import *
from BuildClassObject import *
from WorkspaceCommon import GetDeclaredPcd
from Common.Misc import AnalyzeDscPcd
+import re
## Platform build information from DSC file
#
@@ -328,6 +329,8 @@ class DscBuildData(PlatformBuildClassObject):
return False
def _GetSkuIdentifier(self):
+ if self._SkuName:
+ return self._SkuName
if self._SkuIdentifier == None:
if self._Header == None:
self._GetHeaderInfo()
@@ -337,16 +340,14 @@ class DscBuildData(PlatformBuildClassObject):
if self._SkuName == None:
if self._Header == None:
self._GetHeaderInfo()
- if self._SkuName == None or self._SkuName not in self.SkuIds:
+ if (self._SkuName == None or self._SkuName not in self.SkuIds):
self._SkuName = 'DEFAULT'
return self._SkuName
## Override SKUID_IDENTIFIER
def _SetSkuName(self, Value):
- if Value in self.SkuIds:
- self._SkuName = Value
- # Needs to re-retrieve the PCD information
- self._Pcds = None
+ self._SkuName = Value
+ self._Pcds = None
def _GetFdfFile(self):
if self._FlashDefinition == None:
@@ -460,7 +461,7 @@ class DscBuildData(PlatformBuildClassObject):
if Record[1] in [None, '']:
EdkLogger.error('build', FORMAT_INVALID, 'No Sku ID name',
File=self.MetaFile, Line=Record[-1])
- self._SkuIds[Record[1].upper()] = Record[0]
+ self._SkuIds[Record[1]] = Record[0]
if 'DEFAULT' not in self._SkuIds:
self._SkuIds['DEFAULT'] = '0'
if 'COMMON' not in self._SkuIds:
@@ -731,7 +732,6 @@ class DscBuildData(PlatformBuildClassObject):
RecordList = self._RawData[Type, self._Arch]
PcdValueDict = sdict()
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- SkuName = SkuName.upper()
if SkuName in (SkuObj.SystemSkuId,'DEFAULT','COMMON'):
PcdSet.add((PcdCName, TokenSpaceGuid, SkuName,Dummy4))
PcdDict[Arch, PcdCName, TokenSpaceGuid,SkuName] = Setting
@@ -798,7 +798,6 @@ class DscBuildData(PlatformBuildClassObject):
AvailableSkuIdSet.update({'DEFAULT':0,'COMMON':0})
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- SkuName = SkuName.upper()
if SkuName not in AvailableSkuIdSet:
continue
@@ -816,6 +815,16 @@ class DscBuildData(PlatformBuildClassObject):
if (PcdCName,TokenSpaceGuid) in Pcds.keys():
pcdObject = Pcds[PcdCName,TokenSpaceGuid]
pcdObject.SkuInfoList[SkuName] = SkuInfo
+ if MaxDatumSize.strip():
+ CurrentMaxSize = int(MaxDatumSize.strip(),0)
+ else:
+ CurrentMaxSize = 0
+ if pcdObject.MaxDatumSize:
+ PcdMaxSize = int(pcdObject.MaxDatumSize,0)
+ else:
+ PcdMaxSize = 0
+ if CurrentMaxSize > PcdMaxSize:
+ pcdObject.MaxDatumSize = str(CurrentMaxSize)
else:
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
PcdCName,
@@ -831,8 +840,8 @@ class DscBuildData(PlatformBuildClassObject):
)
for pcd in Pcds.values():
- if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
- pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
+ pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
+ if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
valuefromDec = pcdDecObject.DefaultValue
SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '', '', '', valuefromDec)
pcd.SkuInfoList['DEFAULT'] = SkuInfo
@@ -845,17 +854,7 @@ class DscBuildData(PlatformBuildClassObject):
if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys():
pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
del(pcd.SkuInfoList['DEFAULT'])
-
- if SkuObj.SkuUsageType == SkuObj.MULTIPLE:
- if pcd.DatumType == "VOID*":
- MaxSize = int(pcd.MaxDatumSize,0)
- for (skuname,skuobj) in pcd.SkuInfoList.items():
- datalen = len(skuobj.DefaultValue)
- if datalen>MaxSize:
- MaxSize = datalen
- pcd.MaxDatumSize = str(MaxSize)
-
-
+
return Pcds
## Retrieve dynamic HII PCD settings
@@ -881,7 +880,6 @@ class DscBuildData(PlatformBuildClassObject):
AvailableSkuIdSet.update({'DEFAULT':0,'COMMON':0})
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- SkuName = SkuName.upper()
if SkuName not in AvailableSkuIdSet:
continue
PcdSet.add((PcdCName, TokenSpaceGuid, SkuName,Dummy4))
@@ -893,6 +891,20 @@ class DscBuildData(PlatformBuildClassObject):
if Setting == None:
continue
VariableName, VariableGuid, VariableOffset, DefaultValue = self._ValidatePcd(PcdCName, TokenSpaceGuid, Setting, Type, Dummy4)
+
+ ExceedMax = False
+ if VariableOffset.isdigit():
+ if int(VariableOffset,10) > 0xFFFF:
+ ExceedMax = True
+ elif re.match(r'[\t\s]*0[xX][a-fA-F0-9]+$',VariableOffset):
+ if int(VariableOffset,16) > 0xFFFF:
+ ExceedMax = True
+ else:
+ EdkLogger.error('Build', FORMAT_INVALID, "Invalid syntax or format of the variable offset value is incorrect for %s." % ".".join((TokenSpaceGuid,PcdCName)))
+
+ if ExceedMax:
+ EdkLogger.error('Build', OPTION_VALUE_INVALID, "The variable offset value must not exceed the maximum value of 0xFFFF (UINT16) for %s." % ".".join((TokenSpaceGuid,PcdCName)))
+
SkuInfo = SkuInfoClass(SkuName, self.SkuIds[SkuName], VariableName, VariableGuid, VariableOffset, DefaultValue)
if (PcdCName,TokenSpaceGuid) in Pcds.keys():
pcdObject = Pcds[PcdCName,TokenSpaceGuid]
@@ -914,8 +926,12 @@ class DscBuildData(PlatformBuildClassObject):
for pcd in Pcds.values():
SkuInfoObj = pcd.SkuInfoList.values()[0]
- if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
- pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
+ pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
+ # Only fix the value while no value provided in DSC file.
+ for sku in pcd.SkuInfoList.values():
+ if (sku.HiiDefaultValue == "" or sku.HiiDefaultValue==None):
+ sku.HiiDefaultValue = pcdDecObject.DefaultValue
+ if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
valuefromDec = pcdDecObject.DefaultValue
SkuInfo = SkuInfoClass('DEFAULT', '0', SkuInfoObj.VariableName, SkuInfoObj.VariableGuid, SkuInfoObj.VariableOffset, valuefromDec)
pcd.SkuInfoList['DEFAULT'] = SkuInfo
@@ -929,6 +945,24 @@ class DscBuildData(PlatformBuildClassObject):
if 'DEFAULT' in pcd.SkuInfoList.keys() and SkuObj.SystemSkuId not in pcd.SkuInfoList.keys():
pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
del(pcd.SkuInfoList['DEFAULT'])
+
+
+ if pcd.MaxDatumSize.strip():
+ MaxSize = int(pcd.MaxDatumSize,0)
+ else:
+ MaxSize = 0
+ if pcdDecObject.DatumType == 'VOID*':
+ for (skuname,skuobj) in pcd.SkuInfoList.items():
+ datalen = 0
+ if skuobj.HiiDefaultValue.startswith("L"):
+ datalen = (len(skuobj.HiiDefaultValue)- 3 + 1) * 2
+ elif skuobj.HiiDefaultValue.startswith("{"):
+ datalen = len(skuobj.HiiDefaultValue.split(","))
+ else:
+ datalen = len(skuobj.HiiDefaultValue) -2 + 1
+ if datalen>MaxSize:
+ MaxSize = datalen
+ pcd.MaxDatumSize = str(MaxSize)
return Pcds
## Retrieve dynamic VPD PCD settings
@@ -954,7 +988,6 @@ class DscBuildData(PlatformBuildClassObject):
AvailableSkuIdSet.update({'DEFAULT':0,'COMMON':0})
for TokenSpaceGuid, PcdCName, Setting, Arch, SkuName, Dummy3, Dummy4 in RecordList:
- SkuName = SkuName.upper()
if SkuName not in AvailableSkuIdSet:
continue
@@ -976,6 +1009,16 @@ class DscBuildData(PlatformBuildClassObject):
if (PcdCName,TokenSpaceGuid) in Pcds.keys():
pcdObject = Pcds[PcdCName,TokenSpaceGuid]
pcdObject.SkuInfoList[SkuName] = SkuInfo
+ if MaxDatumSize.strip():
+ CurrentMaxSize = int(MaxDatumSize.strip(),0)
+ else:
+ CurrentMaxSize = 0
+ if pcdObject.MaxDatumSize:
+ PcdMaxSize = int(pcdObject.MaxDatumSize,0)
+ else:
+ PcdMaxSize = 0
+ if CurrentMaxSize > PcdMaxSize:
+ pcdObject.MaxDatumSize = str(CurrentMaxSize)
else:
Pcds[PcdCName, TokenSpaceGuid] = PcdClassObject(
PcdCName,
@@ -991,8 +1034,8 @@ class DscBuildData(PlatformBuildClassObject):
)
for pcd in Pcds.values():
SkuInfoObj = pcd.SkuInfoList.values()[0]
+ pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
if 'DEFAULT' not in pcd.SkuInfoList.keys() and 'COMMON' not in pcd.SkuInfoList.keys():
- pcdDecObject = self._DecPcds[pcd.TokenCName,pcd.TokenSpaceGuidCName]
valuefromDec = pcdDecObject.DefaultValue
SkuInfo = SkuInfoClass('DEFAULT', '0', '', '', '','',SkuInfoObj.VpdOffset, valuefromDec)
pcd.SkuInfoList['DEFAULT'] = SkuInfo
@@ -1006,14 +1049,6 @@ class DscBuildData(PlatformBuildClassObject):
pcd.SkuInfoList[SkuObj.SystemSkuId] = pcd.SkuInfoList['DEFAULT']
del(pcd.SkuInfoList['DEFAULT'])
- if SkuObj.SkuUsageType == SkuObj.MULTIPLE:
- if pcd.MaxDatumSize.strip():
- MaxSize = int(pcd.MaxDatumSize,0)
- for (skuname,skuobj) in pcd.SkuInfoList.items():
- datalen = len(skuobj.DefaultValue)
- if datalen>MaxSize:
- MaxSize = datalen
- pcd.MaxDatumSize = str(MaxSize)
return Pcds
## Add external modules
@@ -1520,6 +1555,7 @@ class InfBuildData(ModuleBuildClassObject):
## Set all internal used members of InfBuildData to None
def _Clear(self):
self._HeaderComments = None
+ self._TailComments = None
self._Header_ = None
self._AutoGenVersion = None
self._BaseName = None
@@ -1612,7 +1648,13 @@ class InfBuildData(ModuleBuildClassObject):
for Record in RecordList:
self._HeaderComments.append(Record[0])
return self._HeaderComments
-
+ def _GetTailComments(self):
+ if not self._TailComments:
+ self._TailComments = []
+ RecordList = self._RawData[MODEL_META_DATA_TAIL_COMMENT]
+ for Record in RecordList:
+ self._TailComments.append(Record[0])
+ return self._TailComments
## Retrieve all information in [Defines] section
#
# (Retriving all [Defines] information in one-shot is just to save time.)
@@ -1769,7 +1811,7 @@ class InfBuildData(ModuleBuildClassObject):
else:
Tool = ToolList[0]
ToolChain = "*_*_*_%s_FLAGS" % Tool
- ToolChainFamily = 'MSFT' # Edk.x only support MSFT tool chain
+ ToolChainFamily = ''
#ignore not replaced macros in value
ValueList = GetSplitList(' ' + Value, '/D')
Dummy = ValueList[0]
@@ -2447,6 +2489,7 @@ class InfBuildData(ModuleBuildClassObject):
Platform = property(_GetPlatform, _SetPlatform)
HeaderComments = property(_GetHeaderComments)
+ TailComments = property(_GetTailComments)
AutoGenVersion = property(_GetInfVersion)
BaseName = property(_GetBaseName)
ModuleType = property(_GetModuleType)
diff --git a/BaseTools/Source/Python/build/BuildReport.py b/BaseTools/Source/Python/build/BuildReport.py
index 2058a7bae..945ee1b57 100644
--- a/BaseTools/Source/Python/build/BuildReport.py
+++ b/BaseTools/Source/Python/build/BuildReport.py
@@ -259,7 +259,7 @@ class DepexParser(object):
Statement = gOpCodeList[struct.unpack("B", OpCode)[0]]
if Statement in ["BEFORE", "AFTER", "PUSH"]:
GuidValue = "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X" % \
- struct.unpack("LHHBBBBBBBB", DepexFile.read(16))
+ struct.unpack("=LHHBBBBBBBB", DepexFile.read(16))
GuidString = self._GuidDb.get(GuidValue, GuidValue)
Statement = "%s %s" % (Statement, GuidString)
DepexStatement.append(Statement)
diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S
index 1d0b09077..0d50cbd45 100644
--- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S
+++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.S
@@ -18,8 +18,11 @@
.align 2
GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
+GCC_ASM_IMPORT(ArmReadMpidr)
+
//UINTN
//ArmPlatformIsPrimaryCore (
// IN UINTN MpId
@@ -32,4 +35,13 @@ ASM_PFX(ArmPlatformIsPrimaryCore):
ASM_PFX(ArmPlatformPeiBootAction):
bx lr
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
+ // The BeagleBoard is a uniprocessor platform. The MPIDR of primary core is
+ // always the MPIDR of the calling CPU.
+ b ASM_PFX(ArmReadMpidr)
+
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.asm b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.asm
index a05747717..b850d9858 100644
--- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.asm
+++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardHelper.asm
@@ -20,6 +20,9 @@
EXPORT ArmPlatformPeiBootAction
EXPORT ArmPlatformIsPrimaryCore
+ EXPORT ArmPlatformGetPrimaryCoreMpId
+
+ IMPORT ArmReadMpidr
AREA BeagleBoardHelper, CODE, READONLY
@@ -37,4 +40,14 @@ ArmPlatformPeiBootAction FUNCTION
bx lr
ENDFUNC
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ArmPlatformGetPrimaryCoreMpId FUNCTION
+ // The BeagleBoard is a uniprocessor platform. The MPIDR of primary core is
+ // always the MPIDR of the calling CPU.
+ b ArmReadMpidr
+ ENDFUNC
+
END
diff --git a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c
index 5524ddbca..210e850c8 100755
--- a/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c
+++ b/BeagleBoardPkg/Library/BeagleBoardLib/BeagleBoardMem.c
@@ -55,9 +55,9 @@ ArmPlatformGetVirtualMemoryMap (
}
// ReMap (Either NOR Flash or DRAM)
- VirtualMemoryTable[Index].PhysicalBase = PcdGet32(PcdSystemMemoryBase);
- VirtualMemoryTable[Index].VirtualBase = PcdGet32(PcdSystemMemoryBase);
- VirtualMemoryTable[Index].Length = PcdGet32(PcdSystemMemorySize);
+ VirtualMemoryTable[Index].PhysicalBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64 (PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].Length = PcdGet64 (PcdSystemMemorySize);
VirtualMemoryTable[Index].Attributes = CacheAttributes;
// SOC Registers. L3 interconnects
diff --git a/CryptoPkg/CryptoPkg.dec b/CryptoPkg/CryptoPkg.dec
index 05be6bbc1..cb0ae8f2b 100644
--- a/CryptoPkg/CryptoPkg.dec
+++ b/CryptoPkg/CryptoPkg.dec
@@ -4,7 +4,7 @@
# This Package provides cryptographic-related libraries for UEFI
# security modules.
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -19,7 +19,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = CryptoPkg
PACKAGE_GUID = 36470E80-36F2-4ba0-8CC8-937C7D9FF888
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include
diff --git a/CryptoPkg/CryptoPkg.dsc b/CryptoPkg/CryptoPkg.dsc
index 67577e143..046a6cefc 100644
--- a/CryptoPkg/CryptoPkg.dsc
+++ b/CryptoPkg/CryptoPkg.dsc
@@ -1,7 +1,7 @@
## @file
# Cryptographic Library Package for UEFI Security Implementation.
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -20,7 +20,7 @@
[Defines]
PLATFORM_NAME = CryptoPkg
PLATFORM_GUID = E1063286-6C8C-4c25-AEF0-67A9A5B6E6B6
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/CryptoPkg
SUPPORTED_ARCHITECTURES = IA32|X64|IPF|ARM
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Dblk.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Dblk.efi
index 433ecac67..23397a983 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Dblk.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Dblk.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Devices.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Devices.efi
index 312cebdea..cbb20663f 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Devices.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Devices.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Devtree.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Devtree.efi
index 577d2d6c9..03838de3b 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Devtree.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Devtree.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Guid.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Guid.efi
index d73a4f84b..9811c27c2 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Guid.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Guid.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/IfConfig.efi b/EdkShellBinPkg/Bin/Ia32/Apps/IfConfig.efi
index 73aaa3352..850e913e6 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/IfConfig.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/IfConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/IpConfig.efi b/EdkShellBinPkg/Bin/Ia32/Apps/IpConfig.efi
index 3430e0e04..f81c12deb 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/IpConfig.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/IpConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/LoadPciRom.efi b/EdkShellBinPkg/Bin/Ia32/Apps/LoadPciRom.efi
index ede448e42..476561b6c 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/LoadPciRom.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/LoadPciRom.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Mount.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Mount.efi
index 5b1e9fb4c..4be0e8691 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Mount.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Mount.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Openinfo.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Openinfo.efi
index 88de7b332..3299aaa20 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Openinfo.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Openinfo.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/Ping.efi b/EdkShellBinPkg/Bin/Ia32/Apps/Ping.efi
index 3fc3074ad..f1b1241fa 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/Ping.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/Ping.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/SmbiosView.efi b/EdkShellBinPkg/Bin/Ia32/Apps/SmbiosView.efi
index fdbab5b59..9246f9bf9 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/SmbiosView.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/SmbiosView.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/TelnetMgmt.efi b/EdkShellBinPkg/Bin/Ia32/Apps/TelnetMgmt.efi
index 8a0492fcb..0f7f0d8e3 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/TelnetMgmt.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/TelnetMgmt.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/comp.efi b/EdkShellBinPkg/Bin/Ia32/Apps/comp.efi
index 284ce0605..8a7585860 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/comp.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/comp.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/dmem.efi b/EdkShellBinPkg/Bin/Ia32/Apps/dmem.efi
index e52b79c34..93cd87374 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/dmem.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/dmem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/dmpstore.efi b/EdkShellBinPkg/Bin/Ia32/Apps/dmpstore.efi
index abfbd74b1..90c3814b7 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/dmpstore.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/dmpstore.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi b/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi
index babf3acaf..06492d34a 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/edit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/eficompress.efi b/EdkShellBinPkg/Bin/Ia32/Apps/eficompress.efi
index 9cde32dfa..038fd3c6e 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/eficompress.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/eficompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/efidecompress.efi b/EdkShellBinPkg/Bin/Ia32/Apps/efidecompress.efi
index 9e0f1da6b..b719b4270 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/efidecompress.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/efidecompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/err.efi b/EdkShellBinPkg/Bin/Ia32/Apps/err.efi
index b1c8eaf6e..30a0ddfb2 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/err.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/err.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi b/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi
index b7710da83..4c2b2e69b 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/hexedit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/mem.efi b/EdkShellBinPkg/Bin/Ia32/Apps/mem.efi
index 658f43a4d..84432da0f 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/mem.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/mem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/memmap.efi b/EdkShellBinPkg/Bin/Ia32/Apps/memmap.efi
index 725b52658..6966d08b3 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/memmap.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/memmap.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/mm.efi b/EdkShellBinPkg/Bin/Ia32/Apps/mm.efi
index 39c2036d7..a40c47994 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/mm.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/mm.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/mode.efi b/EdkShellBinPkg/Bin/Ia32/Apps/mode.efi
index cff1df0e7..f1904be1e 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/mode.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/mode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/pci.efi b/EdkShellBinPkg/Bin/Ia32/Apps/pci.efi
index 30dd75929..a58d82427 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/pci.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/pci.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/sermode.efi b/EdkShellBinPkg/Bin/Ia32/Apps/sermode.efi
index 058e6c27e..b285e2704 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/sermode.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/sermode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/stall.efi b/EdkShellBinPkg/Bin/Ia32/Apps/stall.efi
index c2fa4589e..204f250d6 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/stall.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/stall.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ia32/Apps/timezone.efi b/EdkShellBinPkg/Bin/Ia32/Apps/timezone.efi
index 2bb559b04..8eefb61e2 100644
--- a/EdkShellBinPkg/Bin/Ia32/Apps/timezone.efi
+++ b/EdkShellBinPkg/Bin/Ia32/Apps/timezone.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Dblk.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Dblk.efi
index 59ccd648c..7d6316c2b 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Dblk.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Dblk.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Devices.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Devices.efi
index c1691a380..d108beb37 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Devices.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Devices.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Devtree.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Devtree.efi
index 6a93793ae..dc4c1881c 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Devtree.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Devtree.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Guid.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Guid.efi
index d04b7d61e..948c76b9c 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Guid.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Guid.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/IfConfig.efi b/EdkShellBinPkg/Bin/Ipf/Apps/IfConfig.efi
index c30d18906..d793d598e 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/IfConfig.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/IfConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/IpConfig.efi b/EdkShellBinPkg/Bin/Ipf/Apps/IpConfig.efi
index 95bfd72ba..7caf1d30d 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/IpConfig.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/IpConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/LoadPciRom.efi b/EdkShellBinPkg/Bin/Ipf/Apps/LoadPciRom.efi
index dc4f652a3..437540cdf 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/LoadPciRom.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/LoadPciRom.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Mount.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Mount.efi
index e86fe15ec..d897e2f8a 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Mount.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Mount.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Openinfo.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Openinfo.efi
index 8f7e1c198..0ec5f808f 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Openinfo.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Openinfo.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/Ping.efi b/EdkShellBinPkg/Bin/Ipf/Apps/Ping.efi
index 9dc09c39b..a36e795fd 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/Ping.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/Ping.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/SmbiosView.efi b/EdkShellBinPkg/Bin/Ipf/Apps/SmbiosView.efi
index 85795dd64..858696208 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/SmbiosView.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/SmbiosView.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/TelnetMgmt.efi b/EdkShellBinPkg/Bin/Ipf/Apps/TelnetMgmt.efi
index 3f1ac5d5b..618f93298 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/TelnetMgmt.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/TelnetMgmt.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/comp.efi b/EdkShellBinPkg/Bin/Ipf/Apps/comp.efi
index 5bc0775ef..a82d70689 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/comp.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/comp.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/dmem.efi b/EdkShellBinPkg/Bin/Ipf/Apps/dmem.efi
index 45176045d..de93c8238 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/dmem.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/dmem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/dmpstore.efi b/EdkShellBinPkg/Bin/Ipf/Apps/dmpstore.efi
index 843f729c7..bd78cc6b6 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/dmpstore.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/dmpstore.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi b/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi
index 48af2a207..11f493634 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/edit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/eficompress.efi b/EdkShellBinPkg/Bin/Ipf/Apps/eficompress.efi
index b4845aa19..c86489070 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/eficompress.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/eficompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/efidecompress.efi b/EdkShellBinPkg/Bin/Ipf/Apps/efidecompress.efi
index 66587b49f..59cee5d6b 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/efidecompress.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/efidecompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/err.efi b/EdkShellBinPkg/Bin/Ipf/Apps/err.efi
index 15b852412..281ce52e5 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/err.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/err.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi b/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi
index f3b270a93..e437e5dbc 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/hexedit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/mem.efi b/EdkShellBinPkg/Bin/Ipf/Apps/mem.efi
index 347cd380a..a2a525685 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/mem.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/mem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/memmap.efi b/EdkShellBinPkg/Bin/Ipf/Apps/memmap.efi
index 268e5485e..2890d036e 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/memmap.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/memmap.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/mm.efi b/EdkShellBinPkg/Bin/Ipf/Apps/mm.efi
index f5a504b96..513bcb01f 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/mm.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/mm.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/mode.efi b/EdkShellBinPkg/Bin/Ipf/Apps/mode.efi
index c8b083f60..95c7545be 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/mode.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/mode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/pci.efi b/EdkShellBinPkg/Bin/Ipf/Apps/pci.efi
index 78661de6c..04b982810 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/pci.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/pci.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/sermode.efi b/EdkShellBinPkg/Bin/Ipf/Apps/sermode.efi
index 04034ce0c..b7fc6efa1 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/sermode.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/sermode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/stall.efi b/EdkShellBinPkg/Bin/Ipf/Apps/stall.efi
index 693d67fa1..f20ed013c 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/stall.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/stall.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/Ipf/Apps/timezone.efi b/EdkShellBinPkg/Bin/Ipf/Apps/timezone.efi
index 7dc4cd8a8..399c17490 100644
--- a/EdkShellBinPkg/Bin/Ipf/Apps/timezone.efi
+++ b/EdkShellBinPkg/Bin/Ipf/Apps/timezone.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Dblk.efi b/EdkShellBinPkg/Bin/X64/Apps/Dblk.efi
index 7be7eb2a8..da1f4d958 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Dblk.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Dblk.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Devices.efi b/EdkShellBinPkg/Bin/X64/Apps/Devices.efi
index 7e8650d70..846f9ec1b 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Devices.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Devices.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Devtree.efi b/EdkShellBinPkg/Bin/X64/Apps/Devtree.efi
index d477c8e19..43e81d24d 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Devtree.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Devtree.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Guid.efi b/EdkShellBinPkg/Bin/X64/Apps/Guid.efi
index d2ec32638..72594ebc0 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Guid.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Guid.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/IfConfig.efi b/EdkShellBinPkg/Bin/X64/Apps/IfConfig.efi
index 71d85776c..d35c138d4 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/IfConfig.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/IfConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/IpConfig.efi b/EdkShellBinPkg/Bin/X64/Apps/IpConfig.efi
index 0979902b3..8e8f18fa5 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/IpConfig.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/IpConfig.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/LoadPciRom.efi b/EdkShellBinPkg/Bin/X64/Apps/LoadPciRom.efi
index 778417fe4..267a23218 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/LoadPciRom.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/LoadPciRom.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Mount.efi b/EdkShellBinPkg/Bin/X64/Apps/Mount.efi
index 218297254..b6b1e84a7 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Mount.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Mount.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Openinfo.efi b/EdkShellBinPkg/Bin/X64/Apps/Openinfo.efi
index c3361df8f..6578def4b 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Openinfo.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Openinfo.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/Ping.efi b/EdkShellBinPkg/Bin/X64/Apps/Ping.efi
index d7a10250c..4a44292c9 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/Ping.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/Ping.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/SmbiosView.efi b/EdkShellBinPkg/Bin/X64/Apps/SmbiosView.efi
index c3f0d23e9..e111ba7a4 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/SmbiosView.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/SmbiosView.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/TelnetMgmt.efi b/EdkShellBinPkg/Bin/X64/Apps/TelnetMgmt.efi
index 277748914..4589710b0 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/TelnetMgmt.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/TelnetMgmt.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/comp.efi b/EdkShellBinPkg/Bin/X64/Apps/comp.efi
index 873f6615b..ae814a9ed 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/comp.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/comp.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/dmem.efi b/EdkShellBinPkg/Bin/X64/Apps/dmem.efi
index 624d6a7c0..9cb8102a6 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/dmem.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/dmem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/dmpstore.efi b/EdkShellBinPkg/Bin/X64/Apps/dmpstore.efi
index e1670ff6a..e1f3a0c56 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/dmpstore.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/dmpstore.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/edit.efi b/EdkShellBinPkg/Bin/X64/Apps/edit.efi
index d0f8d2af8..74b3b37c4 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/edit.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/edit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/eficompress.efi b/EdkShellBinPkg/Bin/X64/Apps/eficompress.efi
index 21bee9a89..5f252c301 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/eficompress.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/eficompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/efidecompress.efi b/EdkShellBinPkg/Bin/X64/Apps/efidecompress.efi
index 340bc06c0..4f1643fe6 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/efidecompress.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/efidecompress.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/err.efi b/EdkShellBinPkg/Bin/X64/Apps/err.efi
index 1eb7b01f1..6b8b933a9 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/err.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/err.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi b/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi
index 2414293bc..a41d3870c 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/hexedit.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/mem.efi b/EdkShellBinPkg/Bin/X64/Apps/mem.efi
index d5d8a4ad4..cd24ee5f9 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/mem.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/mem.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/memmap.efi b/EdkShellBinPkg/Bin/X64/Apps/memmap.efi
index 6a06df94b..dd5818999 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/memmap.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/memmap.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/mm.efi b/EdkShellBinPkg/Bin/X64/Apps/mm.efi
index 493c2eb80..46cebd9fc 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/mm.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/mm.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/mode.efi b/EdkShellBinPkg/Bin/X64/Apps/mode.efi
index 11c2c4a0f..168e39fb3 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/mode.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/mode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/pci.efi b/EdkShellBinPkg/Bin/X64/Apps/pci.efi
index 10c02db80..4b875cf56 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/pci.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/pci.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/sermode.efi b/EdkShellBinPkg/Bin/X64/Apps/sermode.efi
index a4ab6d659..98762505f 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/sermode.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/sermode.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/stall.efi b/EdkShellBinPkg/Bin/X64/Apps/stall.efi
index 552b1aeba..8399de5a5 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/stall.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/stall.efi
Binary files differ
diff --git a/EdkShellBinPkg/Bin/X64/Apps/timezone.efi b/EdkShellBinPkg/Bin/X64/Apps/timezone.efi
index 0d7e5a424..a61e2ae08 100644
--- a/EdkShellBinPkg/Bin/X64/Apps/timezone.efi
+++ b/EdkShellBinPkg/Bin/X64/Apps/timezone.efi
Binary files differ
diff --git a/EdkShellBinPkg/EdkShellBinPkg.dec b/EdkShellBinPkg/EdkShellBinPkg.dec
index 8988a334e..a00dfeb44 100644
--- a/EdkShellBinPkg/EdkShellBinPkg.dec
+++ b/EdkShellBinPkg/EdkShellBinPkg.dec
@@ -2,7 +2,7 @@
# Reference package showing multiple binaries
#
# This package contains multiple binary shell applications that follow UEFI specification. Now there are three binary shell modules, which are for bin (original module), normal shell and full shell.
-# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this distribution.
@@ -16,5 +16,5 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = EdkShellBinPkg
PACKAGE_GUID = d4266a1b-1d38-4116-93ae-60dc3e2012a6
- PACKAGE_VERSION = 0.4
+ PACKAGE_VERSION = 0.5
diff --git a/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi b/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi
index 4f411f602..cf0bbab17 100644
--- a/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi
+++ b/EdkShellBinPkg/FullShell/Ia32/Shell_Full.efi
Binary files differ
diff --git a/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi b/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi
index 58225be57..395a9a3ad 100644
--- a/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi
+++ b/EdkShellBinPkg/FullShell/Ipf/Shell_Full.efi
Binary files differ
diff --git a/EdkShellBinPkg/FullShell/X64/Shell_Full.efi b/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
index f954bff97..9344bb99e 100644
--- a/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
+++ b/EdkShellBinPkg/FullShell/X64/Shell_Full.efi
Binary files differ
diff --git a/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi b/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi
index a7b94d29a..ad722f6cb 100644
--- a/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi
+++ b/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi
Binary files differ
diff --git a/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi b/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi
index cd0c34b60..663031b74 100644
--- a/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi
+++ b/EdkShellBinPkg/MinimumShell/Ipf/Shell.efi
Binary files differ
diff --git a/EdkShellBinPkg/MinimumShell/X64/Shell.efi b/EdkShellBinPkg/MinimumShell/X64/Shell.efi
index 7cc112b8f..824056177 100644
--- a/EdkShellBinPkg/MinimumShell/X64/Shell.efi
+++ b/EdkShellBinPkg/MinimumShell/X64/Shell.efi
Binary files differ
diff --git a/EdkShellBinPkg/ReadMe.txt b/EdkShellBinPkg/ReadMe.txt
index 41424dd59..72bb81b3e 100644
--- a/EdkShellBinPkg/ReadMe.txt
+++ b/EdkShellBinPkg/ReadMe.txt
@@ -1,9 +1,9 @@
-The Ia32/Ipf/X64 binaries of EdkShellBinPkg are generated with EFI shell project (svn r63) and build with Edk Compatibility & BaseTools Package (r12898). The binaries are built with no debug information by building with "RELEASE" target.
+The Ia32/Ipf/X64 binaries of EdkShellBinPkg are generated with EFI shell project (svn r64) and build with Edk Compatibility & BaseTools Package (r12898). The binaries are built with no debug information by building with "RELEASE" target.
The following steps can help to re-generate these binaries for customization:
1. Check out EdkCompatibilityPkg (r12898) to $(WORKSPACE)\EdkCompatibilityPkg (svn https://svn.code.sf.net/p/edk2/code/trunk/edk2/EdkCompatibilityPkg).
2. Check out EdkShellPkg (r12898) to $(WORKSPACE)\EdkShellPkg (svn https://svn.code.sf.net/p/edk2/code/trunk/edk2/EdkShellPkg).
-3. Check out Edk Shell project source (r63) to $(WORKSPACE)\Shell (svn https://svn.code.sf.net/p/efi-shell/code/trunk/Shell).
+3. Check out Edk Shell project source (r64) to $(WORKSPACE)\Shell (svn https://svn.code.sf.net/p/efi-shell/code/trunk/Shell).
4. Check out BaseTools (r12898) to $(WORKSPACE)\BaseTools (svn https://svn.code.sf.net/p/edk2/code/trunk/edk2/BaseTools).
5. Under $(WORKSPACE) directory (i.e. c:\EdkII),
To generate Minimum Shell, execute: "build -a IA32 -a X64 -a IPF -p EdkShellPkg\EdkShellPkg.dsc -m Shell\Shell.inf -b RELEASE".
@@ -13,4 +13,4 @@ The following steps can help to re-generate these binaries for customization:
The Arm binaries of EdkShellBinPkg are generated with EFI shell project (svn r64) and build with Edk Compatibility & BaseTools Package (r14706).
-Build Instructions are available on this page http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPkg/Binaries. \ No newline at end of file
+Build Instructions are available on this page http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=ArmPkg/Binaries.
diff --git a/EdkShellPkg/ShellR64.patch b/EdkShellPkg/ShellR64.patch
index 066444ae4..477125e36 100644
--- a/EdkShellPkg/ShellR64.patch
+++ b/EdkShellPkg/ShellR64.patch
@@ -1,19 +1,383 @@
-Index: EfiCompress/Compress.h
-===================================================================
---- EfiCompress/Compress.h (revision 64)
-+++ EfiCompress/Compress.h (working copy)
-@@ -57,4 +57,4 @@
+From 6451e0daf7f733a27e1afb3c7ac662a620d8b93b Mon Sep 17 00:00:00 2001
+From: Olivier Martin <olivier.martin@arm.com>
+Date: Tue, 14 Jan 2014 14:43:50 +0000
+Subject: [PATCH] EDK Shell patch to support GCC
+
+---
+ DeviceTree/devicetree.c | 4 +-
+ DeviceTree/devicetree.h | 1 +
+ DeviceTree/devicetree.inf | 28 +--
+ EfiCompress/Compress.h | 2 +-
+ EfiCompress/CompressMain.c | 2 +-
+ EfiCompress/compress.c | 2 +-
+ EfiCompress/compress.inf | 32 +--
+ EfiDecompress/Decompress.c | 8 +-
+ EfiDecompress/Decompress.h | 2 +-
+ EfiDecompress/Decompress.inf | 33 +--
+ IfConfig/IfConfig.c | 6 +-
+ IfConfig/IfConfig.h | 1 +
+ IfConfig/IfConfig.inf | 34 +--
+ IfConfig/ShellNetHelper.h | 1 +
+ IpConfig/IpConfig.c | 4 +-
+ IpConfig/IpConfig.h | 2 +-
+ IpConfig/IpConfig.inf | 29 +--
+ Library/Aarch64/efilibplat.h | 38 ++++
+ Library/Arm/efilibplat.h | 39 ++++
+ Library/CRC.c | 2 +-
+ Library/CRC.h | 4 +-
+ Library/ConsistMapping.c | 2 +-
+ Library/ConsistMapping.h | 4 +-
+ Library/DPath.c | 6 +-
+ Library/DPath.h | 3 +-
+ Library/Data.c | 2 +-
+ Library/Ebc/EfiLibPlat.h | 1 +
+ Library/EfiPart.h | 1 +
+ Library/EfiShellLib.h | 11 +-
+ Library/EfiShellLib.inf | 51 +++--
+ Library/Event.c | 2 +-
+ Library/Event.h | 4 +-
+ Library/FileIO.c | 6 +-
+ Library/FileIO.h | 4 +-
+ Library/Handle.c | 9 +-
+ Library/Handle.h | 1 +
+ Library/HiiSupport.c | 6 +-
+ Library/HiiSupport.h | 1 +
+ Library/IA32/efilibplat.h | 2 +-
+ Library/IO.c | 13 +-
+ Library/IO.h | 4 +-
+ Library/IPF/efilibplat.h | 1 +
+ Library/IPF/libsalpal.h | 2 +-
+ Library/IPF/palproc.h | 1 +
+ Library/Init.c | 2 +-
+ Library/LinkedList.h | 4 +-
+ Library/Lock.c | 2 +-
+ Library/Lock.h | 4 +-
+ Library/Mem.c | 2 +-
+ Library/Mem.h | 4 +-
+ Library/Misc.c | 15 +-
+ Library/Misc.h | 1 +
+ Library/Perf.c | 2 +-
+ Library/RtData.c | 2 +-
+ Library/ShellDebug.c | 2 +-
+ Library/ShellDebug.h | 1 +
+ Library/ShellEnvInt.c | 2 +-
+ Library/ShellEnvInt.h | 4 +-
+ Library/Str.c | 6 +-
+ Library/Str.h | 1 +
+ Library/VarCheck.c | 2 +-
+ Library/VarCheck.h | 3 +-
+ Library/X64/efilibplat.h | 1 +
+ LoadPciRom/LoadPciRom.c | 8 +-
+ LoadPciRom/LoadPciRom.h | 1 +
+ LoadPciRom/LoadPciRom.inf | 28 +--
+ Ping/Ping.c | 27 ++-
+ Ping/Ping.h | 1 +
+ Ping/Ping.inf | 34 +--
+ Shell.inf | 305 +++++++++++++-------------
+ ShellFull.inf | 494 ++++++++++++++++++++++---------------------
+ SmbiosView/EventLogInfo.c | 2 +-
+ SmbiosView/EventLogInfo.h | 1 +
+ SmbiosView/LibSmbios.h | 1 +
+ SmbiosView/LibSmbiosView.c | 10 +-
+ SmbiosView/LibSmbiosView.h | 3 +-
+ SmbiosView/PrintInfo.c | 2 +-
+ SmbiosView/PrintInfo.h | 1 +
+ SmbiosView/QueryTable.c | 2 +-
+ SmbiosView/QueryTable.h | 1 +
+ SmbiosView/Smbios.h | 1 +
+ SmbiosView/Smbiosview.inf | 33 +--
+ SmbiosView/smbiosview.c | 4 +-
+ SmbiosView/smbiosview.h | 1 +
+ TelnetMgmt/TelnetMgmt.c | 4 +-
+ TelnetMgmt/TelnetMgmt.h | 2 +-
+ TelnetMgmt/TelnetMgmt.inf | 29 +--
+ TelnetMgmt/TelnetServer.h | 1 +
+ attrib/attrib.c | 6 +-
+ attrib/attrib.h | 3 +-
+ attrib/attrib.inf | 28 +--
+ cls/cls.c | 4 +-
+ cls/cls.h | 1 +
+ cls/cls.inf | 29 +--
+ comp/comp.c | 2 +-
+ comp/comp.h | 2 +-
+ comp/comp.inf | 31 +--
+ cp/cp.c | 10 +-
+ cp/cp.h | 3 +-
+ cp/cp.inf | 29 +--
+ date/date.c | 10 +-
+ date/date.h | 1 +
+ date/date.inf | 29 +--
+ dblk/dblk.c | 2 +-
+ dblk/dblk.h | 1 +
+ dblk/dblk.inf | 31 +--
+ dblk/efidump.c | 18 +-
+ devices/devices.c | 4 +-
+ devices/devices.h | 1 +
+ devices/devices.inf | 28 +--
+ dmem/MemCommonPart.c | 14 +-
+ dmem/MemCommonPart.h | 2 +-
+ dmem/debug.h | 1 +
+ dmem/dmem.inf | 30 +--
+ dmem/efidump.c | 20 +-
+ dmpstore/dmpstore.c | 4 +-
+ dmpstore/dmpstore.h | 1 +
+ dmpstore/dmpstore.inf | 31 +--
+ drivers/drivers.c | 6 +-
+ drivers/drivers.h | 1 +
+ drivers/drivers.inf | 28 +--
+ drvcfg/drvcfg.c | 4 +-
+ drvcfg/drvcfg.h | 1 +
+ drvcfg/drvcfg.inf | 28 +--
+ drvdiag/drvdiag.c | 4 +-
+ drvdiag/drvdiag.h | 1 +
+ drvdiag/drvdiag.inf | 28 +--
+ edit/edit.inf | 32 +--
+ edit/editor.h | 5 +-
+ edit/editortype.h | 7 +-
+ edit/libEditor.c | 24 +--
+ edit/libFileBuffer.c | 24 ++-
+ edit/libInputBar.c | 26 +--
+ edit/libMenuBar.c | 9 +-
+ edit/libMisc.h | 1 +
+ edit/libStatusBar.c | 11 +-
+ edit/libTitleBar.c | 17 +-
+ edit/libeditor.h | 1 +
+ edit/libfilebuffer.h | 1 +
+ edit/libinputbar.h | 1 +
+ edit/libmenubar.h | 1 +
+ edit/libstatusbar.h | 1 +
+ edit/libtitlebar.h | 1 +
+ edit/main.c | 30 +--
+ err/DebugMask.h | 1 +
+ err/err.c | 12 +-
+ err/err.h | 2 +-
+ err/err.inf | 31 +--
+ guid/guid.c | 4 +-
+ guid/guid.h | 2 +-
+ guid/guid.inf | 33 +--
+ hexedit/heditor.h | 5 +-
+ hexedit/heditortype.h | 7 +-
+ hexedit/hexedit.inf | 31 +--
+ hexedit/libBufferImage.c | 37 ++--
+ hexedit/libEditor.c | 33 +--
+ hexedit/libInputBar.c | 11 +-
+ hexedit/libMemImage.c | 8 +-
+ hexedit/libMenuBar.c | 13 +-
+ hexedit/libMisc.h | 3 +-
+ hexedit/libStatusBar.c | 1 +
+ hexedit/libTitleBar.c | 24 ++-
+ hexedit/libbufferimage.h | 1 +
+ hexedit/libclipboard.h | 1 +
+ hexedit/libdiskimage.c | 17 +-
+ hexedit/libdiskimage.h | 1 +
+ hexedit/libeditor.h | 1 +
+ hexedit/libfileimage.h | 1 +
+ hexedit/libinputbar.h | 1 +
+ hexedit/libmemimage.h | 1 +
+ hexedit/libmenubar.h | 3 +-
+ hexedit/libstatusbar.h | 1 +
+ hexedit/libtitlebar.h | 1 +
+ hexedit/main.c | 78 +++----
+ inc/shellenv.h | 1 +
+ inc/shelltypes.h | 3 +-
+ load/load.c | 2 +-
+ load/load.h | 1 +
+ load/load.inf | 29 +--
+ ls/ls.c | 11 +-
+ ls/ls.h | 3 +-
+ ls/ls.inf | 28 +--
+ mem/MemCommonPart.c | 14 +-
+ mem/MemCommonPart.h | 2 +-
+ mem/debug.h | 1 +
+ mem/efidump.c | 20 +-
+ mem/mem.inf | 30 +--
+ memmap/memmap.c | 6 +-
+ memmap/memmap.h | 1 +
+ memmap/memmap.inf | 28 +--
+ mkdir/mkdir.c | 4 +-
+ mkdir/mkdir.h | 3 +-
+ mkdir/mkdir.inf | 28 +--
+ mm/mm.c | 72 +++----
+ mm/mm.h | 1 +
+ mm/mm.inf | 28 +--
+ mode/mode.c | 2 +-
+ mode/mode.h | 1 +
+ mode/mode.inf | 28 +--
+ mount/mount.c | 4 +-
+ mount/mount.h | 1 +
+ mount/mount.inf | 28 +--
+ mv/mv.c | 4 +-
+ mv/mv.h | 2 +-
+ mv/mv.inf | 28 +--
+ newshell/FakeHii.c | 6 +-
+ newshell/FakeHii.h | 1 +
+ newshell/init.c | 18 +-
+ newshell/nshell.h | 3 +-
+ newshell/nshell.inf | 34 +--
+ openinfo/openinfo.c | 4 +-
+ openinfo/openinfo.h | 1 +
+ openinfo/openinfo.inf | 28 +--
+ pci/pci.c | 19 +-
+ pci/pci.h | 3 +-
+ pci/pci.inf | 28 +--
+ pci/pci_class.c | 2 +-
+ pci/pci_class.h | 3 +-
+ reset/reset.c | 2 +-
+ reset/reset.h | 1 +
+ reset/reset.inf | 28 +--
+ rm/rm.c | 2 +-
+ rm/rm.h | 1 +
+ rm/rm.inf | 28 +--
+ sermode/sermode.c | 8 +-
+ sermode/sermode.h | 1 +
+ sermode/sermode.inf | 28 +--
+ shellenv/Connect.c | 20 +-
+ shellenv/ConsoleProxy.c | 6 +-
+ shellenv/batch.c | 15 +-
+ shellenv/conio.c | 2 +-
+ shellenv/dprot.c | 8 +-
+ shellenv/echo.c | 2 +-
+ shellenv/exec.c | 18 +-
+ shellenv/for.c | 7 +-
+ shellenv/help.c | 2 +-
+ shellenv/if.c | 3 -
+ shellenv/init.c | 2 +-
+ shellenv/map.c | 16 +-
+ shellenv/parsecmd.h | 3 +-
+ shellenv/pause.c | 2 +-
+ shellenv/protid.c | 22 +-
+ shellenv/shelle.h | 1 +
+ shellenv/shellenvguid.h | 1 +
+ shellenv/var.c | 6 +-
+ stall/stall.c | 2 +-
+ stall/stall.h | 1 +
+ stall/stall.inf | 28 +--
+ time/time.c | 10 +-
+ time/time.h | 1 +
+ time/time.inf | 28 +--
+ touch/touch.c | 2 +-
+ touch/touch.h | 2 +-
+ touch/touch.inf | 29 +--
+ type/type.c | 4 +-
+ type/type.h | 1 +
+ type/type.inf | 28 +--
+ tzone/timezone.inf | 32 +--
+ tzone/tzone.c | 4 +-
+ tzone/tzone.h | 1 +
+ unload/unload.c | 18 +-
+ unload/unload.h | 1 +
+ unload/unload.inf | 29 +--
+ ver/Ebc/verEbc.c | 2 +-
+ ver/Ver.inf | 36 ++--
+ ver/ver.c | 2 +-
+ ver/ver.h | 1 +
+ vol/Vol.inf | 28 +--
+ vol/vol.c | 4 +-
+ vol/vol.h | 1 +
+ 270 files changed, 1985 insertions(+), 1610 deletions(-)
+ create mode 100644 Library/Aarch64/efilibplat.h
+ create mode 100644 Library/Arm/efilibplat.h
+
+diff --git a/DeviceTree/devicetree.c b/DeviceTree/devicetree.c
+index 147e2cb..77e3cf4 100644
+--- a/DeviceTree/devicetree.c
++++ b/DeviceTree/devicetree.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiDevicetreeGuid = EFI_DEVICETREE_GUID;
+ SHELL_VAR_CHECK_ITEM DevicetreeCheckList[] = {
+ {
+@@ -67,7 +67,7 @@ SHELL_VAR_CHECK_ITEM DevicetreeCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/DeviceTree/devicetree.h b/DeviceTree/devicetree.h
+index c452fc7..07bb939 100644
+--- a/DeviceTree/devicetree.h
++++ b/DeviceTree/devicetree.h
+@@ -32,3 +32,4 @@ Revision History
+ 0xf21044af, 0xeef6, 0x4d58, 0xb4, 0x56, 0x32, 0x86, 0xa0, 0x2b, 0x7c, 0x49 \
+ }
+ #endif
++
+diff --git a/DeviceTree/devicetree.inf b/DeviceTree/devicetree.inf
+index a86a1a0..7adc097 100644
+--- a/DeviceTree/devicetree.inf
++++ b/DeviceTree/devicetree.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
+
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ DevicetreeStrings.uni
+ devicetree.c
+ devicetree.h
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DevicetreeMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/EfiCompress/Compress.h b/EfiCompress/Compress.h
+index 6ce2bfc..4e8313f 100644
+--- a/EfiCompress/Compress.h
++++ b/EfiCompress/Compress.h
+@@ -57,4 +57,4 @@ Returns:
--*/
-#endif
\ No newline at end of file
+#endif
-Index: EfiCompress/CompressMain.c
-===================================================================
---- EfiCompress/CompressMain.c (revision 64)
-+++ EfiCompress/CompressMain.c (working copy)
-@@ -50,7 +50,7 @@
+diff --git a/EfiCompress/CompressMain.c b/EfiCompress/CompressMain.c
+index 3edb17e..082046e 100644
+--- a/EfiCompress/CompressMain.c
++++ b/EfiCompress/CompressMain.c
+@@ -50,7 +50,7 @@ SHELL_VAR_CHECK_ITEM CompressCheckList[] = {
NULL,
0,
0,
@@ -22,11 +386,24 @@ Index: EfiCompress/CompressMain.c
}
};
-Index: EfiCompress/compress.inf
-===================================================================
---- EfiCompress/compress.inf (revision 64)
-+++ EfiCompress/compress.inf (working copy)
-@@ -25,7 +25,7 @@
+diff --git a/EfiCompress/compress.c b/EfiCompress/compress.c
+index e21c1f6..012bbef 100644
+--- a/EfiCompress/compress.c
++++ b/EfiCompress/compress.c
+@@ -262,7 +262,7 @@ STATIC UINT32 mBufSiz = 0, mOutputPos, mOutputMask, mSubBitBuf, mCrc;
+ STATIC UINT32 mCompSize, mOrigSize;
+
+ STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1],
+- mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1], mCTable[4096], mCCode[NC],
++ mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1], mCCode[NC],
+ mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1];
+
+ STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL;
+diff --git a/EfiCompress/compress.inf b/EfiCompress/compress.inf
+index 2e62fbf..f3194b5 100644
+--- a/EfiCompress/compress.inf
++++ b/EfiCompress/compress.inf
+@@ -25,7 +25,7 @@ FILE_GUID = A6A236DB-F3FB-4f7f-93BC-0AF7DAA583B9
COMPONENT_TYPE = APPLICATION
[sources.common]
@@ -35,7 +412,7 @@ Index: EfiCompress/compress.inf
CompressStrings.uni
compressMain.c
compress.c
-@@ -34,17 +34,17 @@
+@@ -34,17 +34,17 @@ compress.h
[includes.common]
.
@@ -64,24 +441,47 @@ Index: EfiCompress/compress.inf
[libraries.common]
EfiShellLib
-Index: EfiCompress/compress.c
-===================================================================
---- EfiCompress/compress.c (revision 64)
-+++ EfiCompress/compress.c (working copy)
-@@ -262,7 +262,7 @@
- STATIC UINT32 mCompSize, mOrigSize;
+@@ -64,11 +64,13 @@ compress.h
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeCompress
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
- STATIC UINT16 *mFreq, *mSortPtr, mLenCnt[17], mLeft[2 * NC - 1], mRight[2 * NC - 1],
-- mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1], mCTable[4096], mCCode[NC],
-+ mCrcTable[UINT8_MAX + 1], mCFreq[2 * NC - 1], mCCode[NC],
- mPFreq[2 * NP - 1], mPTCode[NPT], mTFreq[2 * NT - 1];
+-
+-
+\ No newline at end of file
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/EfiDecompress/Decompress.c b/EfiDecompress/Decompress.c
+index 918f673..2ee0404 100644
+--- a/EfiDecompress/Decompress.c
++++ b/EfiDecompress/Decompress.c
+@@ -22,7 +22,7 @@ Revision History
+ --*/
- STATIC NODE mPos, mMatchPos, mAvail, *mPosition, *mParent, *mPrev, *mNext = NULL;
-Index: load/load.c
-===================================================================
---- load/load.c (revision 64)
-+++ load/load.c (working copy)
-@@ -60,7 +60,7 @@
+ #include "EfiShellLib.h"
+-#include "decompress.h"
++#include "Decompress.h"
+
+ extern UINT8 STRING_ARRAY_NAME[];
+
+@@ -31,7 +31,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ #include STRING_DEFINES_FILE
+
+-#include EFI_PROTOCOL_DEFINITION (decompress)
++#include EFI_PROTOCOL_DEFINITION (Decompress)
+
+ EFI_HII_HANDLE HiiDecompressHandle;
+ EFI_GUID EfiDecompressGuid = EFI_DECOMPRESS_GUID;
+@@ -52,7 +52,7 @@ SHELL_VAR_CHECK_ITEM DecompressCheckList[] = {
NULL,
0,
0,
@@ -90,28 +490,244 @@ Index: load/load.c
}
};
-Index: load/load.h
-===================================================================
---- load/load.h (revision 64)
-+++ load/load.h (working copy)
-@@ -33,3 +33,4 @@
+@@ -192,7 +192,7 @@ Returns:
+ //
+ //
+ //
+- Status = LibLocateProtocol (&gEfiDecompressProtocolGuid, &Decompress);
++ Status = LibLocateProtocol (&gEfiDecompressProtocolGuid, (VOID**)&Decompress);
+ if (EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_DECOMPRESS_PROTOCOL_NOT_FOUND), HiiDecompressHandle, L"efidecompress");
+ Status = EFI_UNSUPPORTED;
+diff --git a/EfiDecompress/Decompress.h b/EfiDecompress/Decompress.h
+index abfae65..3d4520c 100644
+--- a/EfiDecompress/Decompress.h
++++ b/EfiDecompress/Decompress.h
+@@ -29,4 +29,4 @@ Revision History
+ 0xe15963a9, 0xa05a, 0x480e, 0x91, 0x49, 0x32, 0xe9, 0x24, 0x5d, 0x98, 0xcb \
}
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/EfiDecompress/Decompress.inf b/EfiDecompress/Decompress.inf
+index f955220..7b2ff3d 100644
+--- a/EfiDecompress/Decompress.inf
++++ b/EfiDecompress/Decompress.inf
+@@ -25,7 +25,7 @@ FILE_GUID = D9D42564-071C-4d73-8DB0-43C55C62DC4C
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+-..\ShCommonStrings.uni
++../ShCommonStrings.uni
+ DecompressStrings.uni
+ decompress.c
+ decompress.h
+@@ -33,17 +33,17 @@ decompress.h
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -63,11 +63,14 @@ decompress.h
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeDecompress
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
+-
+-
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+\ No newline at end of file
+diff --git a/IfConfig/IfConfig.c b/IfConfig/IfConfig.c
+index 07cedc2..52e1add 100644
+--- a/IfConfig/IfConfig.c
++++ b/IfConfig/IfConfig.c
+@@ -29,7 +29,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ #define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * 16
+
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+
+ EFI_GUID EfiIfConfigGuid = EFI_IFCONFIG_GUID;
+
+@@ -75,7 +75,7 @@ SHELL_VAR_CHECK_ITEM IfConfigCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+@@ -669,7 +669,7 @@ Returns:
+ Status = BS->LocateProtocol (
+ &gEfiHiiConfigRoutingProtocolGuid,
+ NULL,
+- &mHiiConfigRouting
++ (VOID**)&mHiiConfigRouting
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_NOT_FOUND;
+diff --git a/IfConfig/IfConfig.h b/IfConfig/IfConfig.h
+index 4a9d3c5..b8f044e 100644
+--- a/IfConfig/IfConfig.h
++++ b/IfConfig/IfConfig.h
+@@ -60,3 +60,4 @@ typedef struct {
+ } ARP_REQUEST;
+
#endif
+
-Index: load/load.inf
-===================================================================
---- load/load.inf (revision 64)
-+++ load/load.inf (working copy)
-@@ -39,23 +39,23 @@
+diff --git a/IfConfig/IfConfig.inf b/IfConfig/IfConfig.inf
+index b2e4964..d8c5c23 100644
+--- a/IfConfig/IfConfig.inf
++++ b/IfConfig/IfConfig.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 6394CF3D-D3DC-4f69-926D-AF9FFE59F922
COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- LoadStrings.uni
- load.c
-
+ IfConfigStrings.uni
+ IfConfig.c
+ IfConfig.h
+@@ -33,30 +33,32 @@ COMPONENT_TYPE = APPLICATION
+ ShellNetHelper.h
+
+ [includes.common]
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+ EdkProtocolLib
+ EfiProtocolLib
+ EdkGuidLib
+- EfiDriverLib
+
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS)
+ IMAGE_ENTRY_POINT=IfConfig
+- C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
++ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/IfConfig/ShellNetHelper.h b/IfConfig/ShellNetHelper.h
+index 9a33d3f..87e6886 100644
+--- a/IfConfig/ShellNetHelper.h
++++ b/IfConfig/ShellNetHelper.h
+@@ -87,3 +87,4 @@ ShellDestroyServiceChild (
+ IN EFI_HANDLE ChildHandle
+ );
+ #endif
++
+diff --git a/IpConfig/IpConfig.c b/IpConfig/IpConfig.c
+index 0c3e4c3..474e5f1 100644
+--- a/IpConfig/IpConfig.c
++++ b/IpConfig/IpConfig.c
+@@ -39,7 +39,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiIpConfigGuid = EFI_IPCONFIG_GUID;
+ SHELL_VAR_CHECK_ITEM IpconfigCheckList[] = {
+ {
+@@ -76,7 +76,7 @@ SHELL_VAR_CHECK_ITEM IpconfigCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/IpConfig/IpConfig.h b/IpConfig/IpConfig.h
+index 1806435..5c975a9 100644
+--- a/IpConfig/IpConfig.h
++++ b/IpConfig/IpConfig.h
+@@ -29,4 +29,4 @@ Revision History
+ 0x8252915c, 0xf1e9, 0x435c, 0x81, 0x91, 0xad, 0x2f, 0x82, 0x62, 0x23, 0x73 \
+ }
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/IpConfig/IpConfig.inf b/IpConfig/IpConfig.inf
+index bc8271c..8cb1e0f 100644
+--- a/IpConfig/IpConfig.inf
++++ b/IpConfig/IpConfig.inf
+@@ -25,24 +25,24 @@ FILE_GUID = 1D73AC03-AF05-44b3-B21E-93A174893FA6
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ IpConfigStrings.uni
+ IpConfig.c
+ IpConfig.h
+
[includes.common]
.
- ..\Inc
@@ -139,20 +755,1010 @@ Index: load/load.inf
[libraries.common]
EfiShellLib
-Index: drvdiag/drvdiag.c
-===================================================================
---- drvdiag/drvdiag.c (revision 64)
-+++ drvdiag/drvdiag.c (working copy)
-@@ -41,7 +41,7 @@
+@@ -56,9 +56,12 @@ COMPONENT_TYPE = APPLICATION
+
+
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeIpConfig
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/Library/Aarch64/efilibplat.h b/Library/Aarch64/efilibplat.h
+new file mode 100644
+index 0000000..185c8b7
+--- /dev/null
++++ b/Library/Aarch64/efilibplat.h
+@@ -0,0 +1,38 @@
++/*++
++
++Copyright (c) 2005, 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:
++
++ efilibplat.h
++
++Abstract:
++
++ EFI to compile bindings
++
++
++
++Revision History
++
++--*/
++
++#ifndef _EFI_LIB_PLAT_H
++#define _EFI_LIB_PLAT_H
++
++VOID
++InitializeLibPlatform (
++ IN EFI_HANDLE ImageHandle,
++ IN EFI_SYSTEM_TABLE *SystemTable
++ );
++
++#define MIN_ALIGNMENT_SIZE 8
++
++#endif
++
+diff --git a/Library/Arm/efilibplat.h b/Library/Arm/efilibplat.h
+new file mode 100644
+index 0000000..791018d
+--- /dev/null
++++ b/Library/Arm/efilibplat.h
+@@ -0,0 +1,39 @@
++/*++
++
++Copyright (c) 2005, 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:
++
++ efilibplat.h
++
++Abstract:
++
++ EFI to compile bindings
++
++
++
++
++Revision History
++
++--*/
++#ifndef _EFI_LIB_PLAT_H_
++#define _EFI_LIB_PLAT_H_
++
++VOID
++InitializeLibPlatform (
++ IN EFI_HANDLE ImageHandle,
++ IN EFI_SYSTEM_TABLE *SystemTable
++ );
++
++#define MIN_ALIGNMENT_SIZE 4
++
++#endif
++
++
+diff --git a/Library/CRC.c b/Library/CRC.c
+index ce5387b..ebbdf70 100644
+--- a/Library/CRC.c
++++ b/Library/CRC.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ UINT32 CRCTable[256] = {
+ 0x00000000,
+diff --git a/Library/CRC.h b/Library/CRC.h
+index 326a5e1..db1f765 100644
+--- a/Library/CRC.h
++++ b/Library/CRC.h
+@@ -53,4 +53,6 @@ CalculateCrc (
+ UINTN Size
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/ConsistMapping.c b/Library/ConsistMapping.c
+index b70fa06..61eda8b 100644
+--- a/Library/ConsistMapping.c
++++ b/Library/ConsistMapping.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ MTD_NAME mMTDName[] = {
+ {
+diff --git a/Library/ConsistMapping.h b/Library/ConsistMapping.h
+index bc8d6f0..d520f31 100644
+--- a/Library/ConsistMapping.h
++++ b/Library/ConsistMapping.h
+@@ -79,4 +79,6 @@ DevicePathConsistMappingCompare (
+ IN VOID *Buffer2
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/DPath.c b/Library/DPath.c
+index f0974ac..73086d7 100644
+--- a/Library/DPath.c
++++ b/Library/DPath.c
+@@ -20,7 +20,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
+
+@@ -1468,7 +1468,7 @@ Returns:
+
+ Status = LibLocateProtocol (
+ &gEfiDevicePathToTextProtocolGuid,
+- &DevPathToText
++ (VOID**)&DevPathToText
+ );
+ if (!EFI_ERROR (Status)) {
+ ToText = DevPathToText->ConvertDevicePathToText (
+@@ -1766,7 +1766,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ Device,
+ Protocol,
+- Interface
++ (VOID**)Interface
+ );
+ }
+ }
+diff --git a/Library/DPath.h b/Library/DPath.h
+index 68da82b..0f2a33f 100644
+--- a/Library/DPath.h
++++ b/Library/DPath.h
+@@ -24,7 +24,7 @@ Revision History
+ #ifndef _D_PATH_H
+ #define _D_PATH_H
+
+-#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + strlena (a) + 1))
++#define NextStrA(a) (CHAR8*)((UINT8 *) (((UINT8 *) (a)) + strlena (a) + 1))
+
+ #include EFI_GUID_DEFINITION (PcAnsi)
+
+@@ -153,3 +153,4 @@ GetNameGuidFromFwVolDevicePathNode (
+ );
+
+ #endif
++
+diff --git a/Library/Data.c b/Library/Data.c
+index d2ffe4a..979b3dd 100644
+--- a/Library/Data.c
++++ b/Library/Data.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
//
- // Global Variables
+ // ShellLibInitialized - TRUE once InitializeShellLib() is called for the first time
+diff --git a/Library/Ebc/EfiLibPlat.h b/Library/Ebc/EfiLibPlat.h
+index 922c881..e4a8771 100644
+--- a/Library/Ebc/EfiLibPlat.h
++++ b/Library/Ebc/EfiLibPlat.h
+@@ -44,3 +44,4 @@ Returns:
+ ;
+
+ #define MIN_ALIGNMENT_SIZE 8
++
+diff --git a/Library/EfiPart.h b/Library/EfiPart.h
+index a62cd15..e59ae77 100644
+--- a/Library/EfiPart.h
++++ b/Library/EfiPart.h
+@@ -56,3 +56,4 @@ typedef struct {
+ #pragma pack()
+
+ #endif
++
+diff --git a/Library/EfiShellLib.h b/Library/EfiShellLib.h
+index 6243d1d..e0ffe43 100644
+--- a/Library/EfiShellLib.h
++++ b/Library/EfiShellLib.h
+@@ -25,7 +25,7 @@ Revision History
+ #define _EFI_SHELL_LIB_INCLUDE_
+
+ #include "Tiano.h"
+-#include "ShellEnv.h"
++#include "shellenv.h"
+ #include "pci22.h"
+
+ #include EFI_ARCH_PROTOCOL_DEFINITION (Bds)
+@@ -51,7 +51,7 @@ Revision History
+ #include EFI_GUID_DEFINITION (PrimaryConsoleOutDevice)
+ #include EFI_GUID_DEFINITION (PrimaryStandardErrorDevice)
+ #include EFI_GUID_DEFINITION (SalSystemTable)
+-#include EFI_GUID_DEFINITION (Smbios)
++#include EFI_GUID_DEFINITION (SmBios)
+ #include EFI_GUID_DEFINITION (StandardErrorDevice)
+ #include EFI_GUID_DEFINITION (FrameworkDevicePath)
+ #include EFI_PROTOCOL_DEFINITION (AbsolutePointer)
+@@ -67,7 +67,7 @@ Revision History
+ #include EFI_PROTOCOL_DEFINITION (DebugPort)
+ #include EFI_PROTOCOL_DEFINITION (DebugSupport)
+ #include EFI_PROTOCOL_DEFINITION (Decompress)
+-#include EFI_PROTOCOL_DEFINITION (DeviceIO)
++#include EFI_PROTOCOL_DEFINITION (DeviceIo)
+ #include EFI_PROTOCOL_DEFINITION (DevicePath)
+ #include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
+ #include EFI_PROTOCOL_DEFINITION (DevicePathToText)
+@@ -111,7 +111,7 @@ Revision History
+ #include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
+ #include EFI_PROTOCOL_DEFINITION (PlatformDriverOverride)
+ #include EFI_PROTOCOL_DEFINITION (PxeBaseCode)
+-#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallback)
++#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallBack)
+ #include EFI_PROTOCOL_DEFINITION (ScsiIo)
+ #include EFI_PROTOCOL_DEFINITION (ScsiPassThru)
+ #include EFI_PROTOCOL_DEFINITION (SectionExtraction)
+@@ -152,7 +152,7 @@ Revision History
+ #include EFI_PROTOCOL_DEFINITION (PlatformToDriverConfiguration)
+
+ #include "efilibplat.h"
+-#include "efipart.h"
++#include "EfiPart.h"
+ #include "ShellDebug.h"
+ #include "CRC.h"
+ #include "DPath.h"
+@@ -358,3 +358,4 @@ LibGetControllerName (
+ );
+
+ #endif
++
+diff --git a/Library/EfiShellLib.inf b/Library/EfiShellLib.inf
+index d450f9d..a63406c 100644
+--- a/Library/EfiShellLib.inf
++++ b/Library/EfiShellLib.inf
+@@ -45,34 +45,42 @@ COMPONENT_TYPE = LIBRARY
+ HiiSupport.c
+
+ [sources.ia32]
+- ia32\math.c
+- ia32\initplat.c
++ IA32/math.c
++ IA32/initplat.c
+
+ [sources.ipf]
+- ipf\math.c
+- ipf\initplat.c
+- ipf\palproc.s
+- ipf\salpal.c
++ IPF/math.c
++ IPF/initplat.c
++ IPF/palproc.s
++ IPF/salpal.c
+
+ [sources.EBC]
+- EBC\math.c
+- EBC\initplat.c
+-
++ Ebc/math.c
++ Ebc/initplat.c
++
+ [sources.x64]
+- ipf\math.c
+- ia32\initplat.c
++ IPF/math.c
++ IA32/initplat.c
++
++[sources.ARM]
++ IPF/math.c
++ IA32/initplat.c
++
++[sources.AARCH64]
++ IPF/math.c
++ IA32/initplat.c
+
+ [includes.common]
+ .
+- ..\Inc
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Core\Dxe
++ ../Inc
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Core/Dxe
+
+ [libraries.common]
+ EdkFrameworkProtocolLib
+@@ -81,4 +89,7 @@ COMPONENT_TYPE = LIBRARY
+ EfiGuidLib
+ EdkGuidLib
+
++[libraries.ARM]
++ CompilerIntrinsicsLib, CompilerIntrinsicsLib
++
+ [nmake.common]
+diff --git a/Library/Event.c b/Library/Event.c
+index 4929e4b..a0cbdc2 100644
+--- a/Library/Event.c
++++ b/Library/Event.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ EFI_EVENT
+ LibCreateProtocolNotifyEvent (
+diff --git a/Library/Event.h b/Library/Event.h
+index b8df801..8e0e718 100644
+--- a/Library/Event.h
++++ b/Library/Event.h
+@@ -50,4 +50,6 @@ WaitForEventWithTimeout (
+ OUT EFI_INPUT_KEY *Key
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/FileIO.c b/Library/FileIO.c
+index 40c67d1..8820c52 100644
+--- a/Library/FileIO.c
++++ b/Library/FileIO.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ typedef struct _PATH_COMPONENTS {
+ CHAR16 *Name;
+@@ -719,7 +719,6 @@ LibSplitFsAndPath (
+ IN OUT CHAR16 **Path
+ )
+ {
+- EFI_STATUS Status;
+ CHAR16 *p;
+ UINTN Size;
+
+@@ -728,7 +727,6 @@ LibSplitFsAndPath (
+
+ *Fs = NULL;
+ *Path = NULL;
+- Status = EFI_SUCCESS;
+
+ p = AbPath;
+ while (*p) {
+@@ -1017,13 +1015,11 @@ Return:
+ EFI_LIST_ENTRY SrcList;
+ EFI_LIST_ENTRY DstList;
+ EFI_STATUS Status;
+- EFI_LIST_ENTRY *Link;
+ SHELL_FILE_ARG *SrcArg;
+ SHELL_FILE_ARG *DstArg;
+
+ ASSERT (IsSame != NULL);
+
+- Link = NULL;
+ SrcArg = NULL;
+ DstArg = NULL;
+ InitializeListHead (&SrcList);
+diff --git a/Library/FileIO.h b/Library/FileIO.h
+index bb07d91..e568e17 100644
+--- a/Library/FileIO.h
++++ b/Library/FileIO.h
+@@ -208,4 +208,6 @@ CloseSimpleReadFile (
+ IN SIMPLE_READ_FILE SimpleReadHandle
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/Handle.c b/Library/Handle.c
+index 25da2a1..45e623c 100644
+--- a/Library/Handle.c
++++ b/Library/Handle.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ EFI_STATUS
+ LibLocateHandle (
+@@ -131,7 +131,6 @@ Returns:
+ EFI_HANDLE *BlockIoBuffer;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ UINTN Index;
+- EFI_DEVICE_PATH_PROTOCOL *Start;
+ EFI_DEVICE_PATH_PROTOCOL *Next;
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;
+ HARDDRIVE_DEVICE_PATH *HardDriveDevicePath;
+@@ -204,7 +203,6 @@ Returns:
+ PreviousNodeIsHardDriveDevicePath = FALSE;
+
+ DevPath = DevicePath;
+- Start = DevPath;
+ //
+ // Check for end of device path type
+ //
+@@ -796,14 +794,12 @@ LibScanHandleDatabase (
+ UINTN OpenInfoIndex;
+ UINTN ChildIndex;
+ BOOLEAN DriverBindingHandleIndexValid;
+- BOOLEAN ControllerHandleIndexValid;
+
+ DriverBindingHandleIndexValid = FALSE;
+ if (DriverBindingHandleIndex != NULL) {
+ *DriverBindingHandleIndex = 0xffffffff;
+ }
+
+- ControllerHandleIndexValid = FALSE;
+ if (ControllerHandleIndex != NULL) {
+ *ControllerHandleIndex = 0xffffffff;
+ }
+@@ -847,7 +843,6 @@ LibScanHandleDatabase (
+
+ if (ControllerHandle != NULL && ControllerHandleIndex != NULL && (*HandleBuffer)[HandleIndex] == ControllerHandle) {
+ *ControllerHandleIndex = (UINT32) HandleIndex;
+- ControllerHandleIndexValid = TRUE;
+ }
+
+ }
+@@ -1305,7 +1300,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ Handles[Index],
+ ProtocolGuid,
+- Interface
++ (VOID**)Interface
+ );
+
+ if (!EFI_ERROR (Status)) {
+diff --git a/Library/Handle.h b/Library/Handle.h
+index 40ad40b..010e2cf 100644
+--- a/Library/Handle.h
++++ b/Library/Handle.h
+@@ -161,3 +161,4 @@ ShellGetHandleNum (
+ );
+
+ #endif
++
+diff --git a/Library/HiiSupport.c b/Library/HiiSupport.c
+index bce645b..5f70712 100644
+--- a/Library/HiiSupport.c
++++ b/Library/HiiSupport.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
+
+@@ -56,11 +56,11 @@ Returns:
+ return EFI_SUCCESS;
+ }
+
+- Status = LibLocateProtocol (&gEfiHiiDatabaseProtocolGuid, &gLibHiiDatabase);
++ Status = LibLocateProtocol (&gEfiHiiDatabaseProtocolGuid, (VOID**)&gLibHiiDatabase);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+- Status = LibLocateProtocol (&gEfiHiiStringProtocolGuid, &gLibHiiString);
++ Status = LibLocateProtocol (&gEfiHiiStringProtocolGuid, (VOID**)&gLibHiiString);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+diff --git a/Library/HiiSupport.h b/Library/HiiSupport.h
+index b04c443..bfeb077 100644
+--- a/Library/HiiSupport.h
++++ b/Library/HiiSupport.h
+@@ -142,3 +142,4 @@ LibGetString (
+ ;
+
+ #endif
++
+diff --git a/Library/IA32/efilibplat.h b/Library/IA32/efilibplat.h
+index 4e58f50..a6eb87f 100644
+--- a/Library/IA32/efilibplat.h
++++ b/Library/IA32/efilibplat.h
+@@ -34,4 +34,4 @@ InitializeLibPlatform (
+
+ #define MIN_ALIGNMENT_SIZE 4
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/Library/IO.c b/Library/IO.c
+index 81f26fd..b976e32 100644
+--- a/Library/IO.c
++++ b/Library/IO.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ #define PRINT_STRING_LEN 1024
+ #define PRINT_ITEM_BUFFER_LEN 100
+@@ -86,8 +86,8 @@ typedef struct _pstate {
+ typedef struct {
+ BOOLEAN PageBreak;
+ BOOLEAN AutoWrap;
+- INTN MaxRow;
+- INTN MaxColumn;
++ UINTN MaxRow;
++ UINTN MaxColumn;
+ INTN InitRow;
+ INTN Row;
+ INTN Column;
+@@ -1575,7 +1575,7 @@ Returns:
+ {
+ BOOLEAN Done;
+ UINTN Column;
+- INTN Row;
++ UINTN Row;
+ UINTN StartColumn;
+ UINTN Update;
+ UINTN Delete;
+@@ -1769,7 +1769,7 @@ Returns:
+ //
+ // If we need to update the output do so now
+ //
+- if (Update != -1) {
++ if (Update != (UINTN) -1) {
+ PrintAt (Column, Row, L"%s%.*s", InStr + Update, Delete, L"");
+ Len = StrLen (InStr);
+
+@@ -1928,8 +1928,8 @@ LibGetPageBreak (
+ return mPrintMode.PageBreak;
+ }
+
++#if 0
+ STATIC
+-
+ BOOLEAN
+ GetOutputPause (
+ VOID
+@@ -1937,6 +1937,7 @@ GetOutputPause (
+ {
+ return mPrintMode.OutputPause;
+ }
++#endif
+
+ INTN
+ DbgPrint (
+diff --git a/Library/IO.h b/Library/IO.h
+index 7469c32..6dfc743 100644
+--- a/Library/IO.h
++++ b/Library/IO.h
+@@ -157,4 +157,6 @@ LibGetPageBreak (
+ );
+
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/IPF/efilibplat.h b/Library/IPF/efilibplat.h
+index 90659b4..aad0dd0 100644
+--- a/Library/IPF/efilibplat.h
++++ b/Library/IPF/efilibplat.h
+@@ -35,3 +35,4 @@ InitializeLibPlatform (
+ #define MIN_ALIGNMENT_SIZE 8
+
+ #endif
++
+diff --git a/Library/IPF/libsalpal.h b/Library/IPF/libsalpal.h
+index fc25995..1461669 100644
+--- a/Library/IPF/libsalpal.h
++++ b/Library/IPF/libsalpal.h
+@@ -74,4 +74,4 @@ LibSalProc (
+ IN UINT64 Arg8
+ );
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/Library/IPF/palproc.h b/Library/IPF/palproc.h
+index 6d1edf8..ea426bf 100644
+--- a/Library/IPF/palproc.h
++++ b/Library/IPF/palproc.h
+@@ -58,3 +58,4 @@
+ #define PAL_MC_REGISTER_MEM 0x001b
+
+ #endif // _PALPROC_H
++
+diff --git a/Library/Init.c b/Library/Init.c
+index 3ef0c8e..e791ff1 100644
+--- a/Library/Init.c
++++ b/Library/Init.c
+@@ -20,7 +20,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ extern EFI_UNICODE_COLLATION_PROTOCOL LibStubUnicodeInterface;
+
+diff --git a/Library/LinkedList.h b/Library/LinkedList.h
+index d39e5a3..0c82b61 100644
+--- a/Library/LinkedList.h
++++ b/Library/LinkedList.h
+@@ -77,11 +77,10 @@ typedef struct _EFI_LIST_ENTRY {
+ }
+
+ #define SwapListEntries(Entry1, Entry2) { \
+- EFI_LIST_ENTRY *Entry1Flink, *Entry1Blink; \
++ EFI_LIST_ENTRY *Entry1Blink; \
+ EFI_LIST_ENTRY *Entry2Flink, *Entry2Blink; \
+ Entry2Flink = (Entry2)->Flink; \
+ Entry2Blink = (Entry2)->Blink; \
+- Entry1Flink = (Entry1)->Flink; \
+ Entry1Blink = (Entry1)->Blink; \
+ Entry2Blink->Flink = Entry2Flink; \
+ Entry2Flink->Blink = Entry2Blink; \
+@@ -100,3 +99,4 @@ typedef struct _EFI_LIST_ENTRY {
+ // A lock structure
//
+ #endif
++
+diff --git a/Library/Lock.c b/Library/Lock.c
+index 8a40db5..b3f9bad 100644
+--- a/Library/Lock.c
++++ b/Library/Lock.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ VOID
+ InitializeLock (
+diff --git a/Library/Lock.h b/Library/Lock.h
+index 9e35b92..bd5304e 100644
+--- a/Library/Lock.h
++++ b/Library/Lock.h
+@@ -45,4 +45,6 @@ ReleaseLock (
+ IN FLOCK *Lock
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/Mem.c b/Library/Mem.c
+index f82cb52..9675b52 100644
+--- a/Library/Mem.c
++++ b/Library/Mem.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ VOID
+ SetMem (
+diff --git a/Library/Mem.h b/Library/Mem.h
+index bca1e1d..1e0b331 100644
+--- a/Library/Mem.h
++++ b/Library/Mem.h
+@@ -73,4 +73,6 @@ ZeroMem (
+ IN UINTN Size
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/Misc.c b/Library/Misc.c
+index 1564c49..e3204ff 100644
+--- a/Library/Misc.c
++++ b/Library/Misc.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ #if (PLATFORM == NT32)
+ #define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID \
+@@ -348,7 +348,7 @@ Returns:
+ ASSERT (Buffer != NULL);
+
+ if (mShellEnv == NULL) {
+- Status = LibLocateProtocol (&ShellEnvProtocol, &mShellEnv);
++ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&mShellEnv);
+ if (EFI_ERROR (Status)) {
+ mShellEnv = NULL;
+ }
+@@ -1171,7 +1171,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ Image->DeviceHandle,
+ &gEfiFirmwareVolumeProtocolGuid,
+- &FV
++ (VOID**)&FV
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = FV->ReadSection (
+@@ -1192,7 +1192,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ Image->DeviceHandle,
+ &gEfiFirmwareVolume2ProtocolGuid,
+- &FV2
++ (VOID**)&FV2
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = FV2->ReadSection (
+@@ -1339,7 +1339,7 @@ LibCmdGetStringByToken (
+ {
+ EFI_STATUS Status;
+ CHAR16 *String;
+- EFI_HII_HANDLE HiiHandle;
++ STATIC EFI_HII_HANDLE HiiHandle;
+
+ ASSERT (Str);
+
+@@ -1730,6 +1730,8 @@ Returns:
+ return L"X64";
+ case EFI_IMAGE_MACHINE_IA64:
+ return L"IA64";
++ case EFI_IMAGE_MACHINE_AARCH64:
++ return L"AARCH64";
+ default:
+ return L"UNKNOWN";
+ }
+@@ -2544,4 +2546,5 @@ Returns:
+ }
+
+ return Status;
+-}
+\ No newline at end of file
++}
++
+diff --git a/Library/Misc.h b/Library/Misc.h
+index 7a99186..a7a6825 100644
+--- a/Library/Misc.h
++++ b/Library/Misc.h
+@@ -258,3 +258,4 @@ LibGetExitCode (
+ );
+
+ #endif
++
+diff --git a/Library/Perf.c b/Library/Perf.c
+index 43e09ea..87c4113 100644
+--- a/Library/Perf.c
++++ b/Library/Perf.c
+@@ -19,7 +19,7 @@ Abstract:
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ #include EFI_PROTOCOL_DEFINITION (Performance)
+
+diff --git a/Library/RtData.c b/Library/RtData.c
+index af55cb4..145e933 100644
+--- a/Library/RtData.c
++++ b/Library/RtData.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ //
+ // RT - pointer to the runtime table
+diff --git a/Library/ShellDebug.c b/Library/ShellDebug.c
+index b31ef06..c8b93d5 100644
+--- a/Library/ShellDebug.c
++++ b/Library/ShellDebug.c
+@@ -19,7 +19,7 @@ Abstract:
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+ #include EFI_PROTOCOL_DEFINITION (DebugAssert)
+
+ EFI_DEBUG_ASSERT_PROTOCOL *mDebugAssert = NULL;
+diff --git a/Library/ShellDebug.h b/Library/ShellDebug.h
+index 039197e..aedb3fa 100644
+--- a/Library/ShellDebug.h
++++ b/Library/ShellDebug.h
+@@ -99,3 +99,4 @@ EFIDebugVariable (
+ );
+ #endif
+
++
+diff --git a/Library/ShellEnvInt.c b/Library/ShellEnvInt.c
+index b99d973..53de481 100644
+--- a/Library/ShellEnvInt.c
++++ b/Library/ShellEnvInt.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ EFI_STATUS
+ ShellExecute (
+diff --git a/Library/ShellEnvInt.h b/Library/ShellEnvInt.h
+index 4182dff..653f997 100644
+--- a/Library/ShellEnvInt.h
++++ b/Library/ShellEnvInt.h
+@@ -196,4 +196,6 @@ ShellGetHandleNum (
+ VOID
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
++
+diff --git a/Library/Str.c b/Library/Str.c
+index ca0c76b..d881dae 100644
+--- a/Library/Str.c
++++ b/Library/Str.c
+@@ -22,7 +22,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ INTN
+ StrCmp (
+@@ -421,7 +421,7 @@ Returns:
+ return (UINTN) -1;
+ }
+
+- u = u << 4 | c - (c >= 'A' ? 'A' - 10 : '0');
++ u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
+ } else {
+ break;
+ }
+@@ -472,7 +472,7 @@ Returns:
+ c = *(str++);
+ while (c) {
+ if (c >= '0' && c <= '9') {
+- if (u > m || u == m && c - '0' > (INTN) n) {
++ if ((u > m) || ((u == m) && (c - '0' > (INTN) n))) {
+ return (UINTN) -1;
+ }
+
+diff --git a/Library/Str.h b/Library/Str.h
+index 3f73bc5..7b01848 100644
+--- a/Library/Str.h
++++ b/Library/Str.h
+@@ -248,3 +248,4 @@ LibStubStrUpr (
+ );
+
+ #endif
++
+diff --git a/Library/VarCheck.c b/Library/VarCheck.c
+index 53597ff..1abec9d 100644
+--- a/Library/VarCheck.c
++++ b/Library/VarCheck.c
+@@ -21,7 +21,7 @@ Revision History
+
+ --*/
+
+-#include "EfiShelllib.h"
++#include "EfiShellLib.h"
+
+ VOID
+ LibCheckVarFreeVarList (
+diff --git a/Library/VarCheck.h b/Library/VarCheck.h
+index bc1f412..d2bfa66 100644
+--- a/Library/VarCheck.h
++++ b/Library/VarCheck.h
+@@ -41,7 +41,7 @@ typedef enum {
+ ARG_PARTIALLY_QUOTED = 0x2,
+ ARG_FIRST_HALF_QUOTED = 0x4,
+ ARG_FIRST_CHAR_IS_ESC = 0x8
+-};
++} SHELL_ARG_EXPR;
+
+ typedef struct {
+ CHAR16 *FlagStr;
+@@ -116,3 +116,4 @@ LibGetErrRedirFilename (
+ );
+
+ #endif
++
+diff --git a/Library/X64/efilibplat.h b/Library/X64/efilibplat.h
+index 90659b4..aad0dd0 100644
+--- a/Library/X64/efilibplat.h
++++ b/Library/X64/efilibplat.h
+@@ -35,3 +35,4 @@ InitializeLibPlatform (
+ #define MIN_ALIGNMENT_SIZE 8
+
+ #endif
++
+diff --git a/LoadPciRom/LoadPciRom.c b/LoadPciRom/LoadPciRom.c
+index f8854b7..99fd99d 100644
+--- a/LoadPciRom/LoadPciRom.c
++++ b/LoadPciRom/LoadPciRom.c
+@@ -24,7 +24,7 @@ Revision History
+
+ #include "EfiShellLib.h"
+ #include "LoadPciRom.h"
+-#include "Pci22.h"
++#include "pci22.h"
+
+ extern UINT8 STRING_ARRAY_NAME[];
+
+@@ -56,7 +56,7 @@ LoadEfiDriversFromRomImage (
+ );
+
+ EFI_HANDLE gMyImageHandle;
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDrvdiagGuid = EFI_DRVDIAG_GUID;
- SHELL_VAR_CHECK_ITEM DrvdiagCheckList[] = {
+ EFI_GUID EfiLoadPciRomGuid = EFI_LOADPCIROM_GUID;
+ SHELL_VAR_CHECK_ITEM LPRCheckList[] = {
{
-@@ -90,7 +90,7 @@
+@@ -81,7 +81,7 @@ SHELL_VAR_CHECK_ITEM LPRCheckList[] = {
NULL,
0,
0,
@@ -161,30 +1767,1318 @@ Index: drvdiag/drvdiag.c
}
};
-Index: drvdiag/drvdiag.h
-===================================================================
---- drvdiag/drvdiag.h (revision 64)
-+++ drvdiag/drvdiag.h (working copy)
-@@ -33,3 +33,4 @@
+@@ -377,7 +377,7 @@ Returns:
+ }
+
+ if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
+- Status = BS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, &Decompress);
++ Status = BS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
+ if (EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_LOADPCIROM_DECOMP_NOT_FOUND), HiiHandle);
+ SkipImage = TRUE;
+diff --git a/LoadPciRom/LoadPciRom.h b/LoadPciRom/LoadPciRom.h
+index e9db96d..116bb89 100644
+--- a/LoadPciRom/LoadPciRom.h
++++ b/LoadPciRom/LoadPciRom.h
+@@ -30,3 +30,4 @@ Revision History
}
#endif
+
-Index: drvdiag/drvdiag.inf
-===================================================================
---- drvdiag/drvdiag.inf (revision 64)
-+++ drvdiag/drvdiag.inf (working copy)
-@@ -40,7 +40,7 @@
+diff --git a/LoadPciRom/LoadPciRom.inf b/LoadPciRom/LoadPciRom.inf
+index 8e79af7..83744ef 100644
+--- a/LoadPciRom/LoadPciRom.inf
++++ b/LoadPciRom/LoadPciRom.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
+ [sources.common]
+ LoadPciRomStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ LoadPciRom.c
+ LoadPciRom.h
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeLoadPciRom
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/Ping/Ping.c b/Ping/Ping.c
+index 7d92881..65e45b7 100644
+--- a/Ping/Ping.c
++++ b/Ping/Ping.c
+@@ -20,14 +20,14 @@ Abstract:
+ --*/
+
+ #include "EfiShellLib.h"
+-#include "CpuFuncs.h"
++//#include "CpuFuncs.h"
+ #include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
+ #include EFI_PROTOCOL_DEFINITION (Ip4)
+ #include "Ping.h"
+ #include STRING_DEFINES_FILE
+ extern UINT8 STRING_ARRAY_NAME[];
+
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+
+ EFI_GUID EfiPingGuid = EFI_PING_GUID;
+ SHELL_VAR_CHECK_ITEM PingCheckList[] = {
+@@ -59,7 +59,7 @@ SHELL_VAR_CHECK_ITEM PingCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+@@ -114,6 +114,8 @@ UINT32 RttSum;
+ UINT32 RttMin;
+ UINT32 RttMax;
+
++EFI_CPU_ARCH_PROTOCOL *gCpu = NULL;
++
+ STATIC
+ UINT64
+ GetTimerValue (
+@@ -135,7 +137,22 @@ Returns:
+
+ --*/
+ {
+- return EfiReadTsc ();
++ static UINT64 CurrentTick = 0;
++ UINT64 TimerPeriod;
++ EFI_STATUS Status;
++
++ ASSERT (gCpu != NULL);
++
++ Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
++ if (EFI_ERROR (Status)) {
++ //
++ // The WinntGetTimerValue will return EFI_UNSUPPORTED. Set the
++ // TimerPeriod by ourselves.
++ //
++ CurrentTick += 1000000;
++ }
++
++ return CurrentTick;
+ }
+
+ STATIC
+@@ -168,7 +185,7 @@ Returns:
+ //
+ // Locate the Cpu Arch Protocol.
+ //
+- Status = BS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, &Cpu);
++ Status = BS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&Cpu);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+diff --git a/Ping/Ping.h b/Ping/Ping.h
+index 7867caf..6f59a0c 100644
+--- a/Ping/Ping.h
++++ b/Ping/Ping.h
+@@ -78,3 +78,4 @@ typedef struct _ICMP_TX_INFO {
+ } ICMP_TX_INFO;
+
+ #endif
++
+diff --git a/Ping/Ping.inf b/Ping/Ping.inf
+index 64dec5c..a678489 100644
+--- a/Ping/Ping.inf
++++ b/Ping/Ping.inf
+@@ -25,24 +25,24 @@ FILE_GUID = FAAA94BA-7095-4c0f-8D69-8E00C8328863
+ COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- DrvdiagStrings.uni
- drvdiag.c
- drvdiag.h
-@@ -48,17 +48,17 @@
+ PingStrings.uni
+ Ping.h
+ Ping.c
+
+ [includes.common]
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -52,7 +52,6 @@ COMPONENT_TYPE = APPLICATION
+ ArchProtocolLib
+ EdkGuidLib
+ EdkFrameworkGuidLib
+- EfiDriverLib
+
+ [libraries.Ia32]
+ CpuIA32Lib
+@@ -64,9 +63,12 @@ COMPONENT_TYPE = APPLICATION
+ CpuIA32Lib
+
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS)
+ IMAGE_ENTRY_POINT=Ping
+- C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
++ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/Shell.inf b/Shell.inf
+index fee3558..b1dc90e 100644
+--- a/Shell.inf
++++ b/Shell.inf
+@@ -25,179 +25,189 @@ FILE_GUID = c57ad6b7-0515-40a8-9d21-551652854e37
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- Library\ShellDebug.c
+- Library\DPath.c
+- Library\Init.c
+- Library\Lock.c
+- Library\Str.c
+- Library\IO.c
+- Library\Mem.c
+- Library\Misc.c
+- Library\Data.c
+- Library\RtData.c
+- Library\ShellEnvInt.c
+- Library\Handle.c
+- Library\FileIO.c
+- Library\ConsistMapping.c
+- Library\CRC.c
+- Library\Event.c
+- Library\Perf.c
+- Library\VarCheck.c
+- Library\HiiSupport.c
+-
+- newshell\NshellStrings.uni
+- newshell\init.c
+- newshell\nshell.h
+- newshell\fakehii.c
++ Library/ShellDebug.c
++ Library/DPath.c
++ Library/Init.c
++ Library/Lock.c
++ Library/Str.c
++ Library/IO.c
++ Library/Mem.c
++ Library/Misc.c
++ Library/Data.c
++ Library/RtData.c
++ Library/ShellEnvInt.c
++ Library/Handle.c
++ Library/FileIO.c
++ Library/ConsistMapping.c
++ Library/CRC.c
++ Library/Event.c
++ Library/Perf.c
++ Library/VarCheck.c
++ Library/HiiSupport.c
++
++ newshell/NshellStrings.uni
++ newshell/init.c
++ newshell/nshell.h
++ newshell/fakehii.c
+
+ ShCommonStrings.uni
+- shellenv\ShellenvHelpStrings.uni
+- shellenv\ShellenvStrings.uni
+- shellenv\ScriptCmdStrings.uni
+- shellenv\ConnectStrings.uni
+- shellenv\EchoStrings.uni
+- shellenv\HelpStrings.uni
+- shellenv\MapStrings.uni
+- shellenv\CdStrings.uni
+- shellenv\DhStrings.uni
++ shellenv/ShellenvHelpStrings.uni
++ shellenv/ShellenvStrings.uni
++ shellenv/ScriptCmdStrings.uni
++ shellenv/ConnectStrings.uni
++ shellenv/EchoStrings.uni
++ shellenv/HelpStrings.uni
++ shellenv/MapStrings.uni
++ shellenv/CdStrings.uni
++ shellenv/DhStrings.uni
+
+- shellenv\cmddisp.c
+- shellenv\connect.c
+- shellenv\data.c
+- shellenv\exec.c
+- shellenv\init.c
+- shellenv\protid.c
+- shellenv\var.c
+- shellenv\conio.c
+- shellenv\consoleproxy.c
+- shellenv\handle.c
+- shellenv\dprot.c
+- shellenv\map.c
+- shellenv\marg.c
+- shellenv\batch.c
+- shellenv\if.c
+- shellenv\goto.c
+- shellenv\echo.c
+- shellenv\pause.c
+- shellenv\for.c
+- shellenv\wait.c
+- shellenv\help.c
+- shellenv\shelle.h
+- shellenv\shellenvguid.h
+- shellenv\parsecmd.c
+- shellenv\shift.c
++ shellenv/cmddisp.c
++ shellenv/connect.c
++ shellenv/data.c
++ shellenv/exec.c
++ shellenv/init.c
++ shellenv/protid.c
++ shellenv/var.c
++ shellenv/conio.c
++ shellenv/consoleproxy.c
++ shellenv/handle.c
++ shellenv/dprot.c
++ shellenv/map.c
++ shellenv/marg.c
++ shellenv/batch.c
++ shellenv/if.c
++ shellenv/goto.c
++ shellenv/echo.c
++ shellenv/pause.c
++ shellenv/for.c
++ shellenv/wait.c
++ shellenv/help.c
++ shellenv/shelle.h
++ shellenv/shellenvguid.h
++ shellenv/parsecmd.c
++ shellenv/shift.c
+
+- unload\UnloadStrings.uni
+- unload\unload.c
++ unload/UnloadStrings.uni
++ unload/unload.c
+- attrib\AttribStrings.uni
+- attrib\attrib.c
+- attrib\attrib.h
++ attrib/AttribStrings.uni
++ attrib/attrib.c
++ attrib/attrib.h
+
+- cls\clsstrings.uni
+- cls\cls.c
++ cls/clsstrings.uni
++ cls/cls.c
+
+- cp\CpStrings.uni
+- cp\cp.h
+- cp\cp.c
++ cp/CpStrings.uni
++ cp/cp.h
++ cp/cp.c
+
+- date\DateStrings.uni
+- date\date.c
+- date\date.h
++ date/DateStrings.uni
++ date/date.c
++ date/date.h
+
+- load\LoadStrings.uni
+- load\load.c
+- load\load.h
++ load/LoadStrings.uni
++ load/load.c
++ load/load.h
+
+- ls\LsStrings.uni
+- ls\ls.h
+- ls\ls.c
++ ls/LsStrings.uni
++ ls/ls.h
++ ls/ls.c
+
+- mkdir\MkdirStrings.uni
+- mkdir\mkdir.c
+- mkdir\mkdir.h
++ mkdir/MkdirStrings.uni
++ mkdir/mkdir.c
++ mkdir/mkdir.h
+
+- mv\MvStrings.uni
+- mv\mv.c
+- mv\mv.h
++ mv/MvStrings.uni
++ mv/mv.c
++ mv/mv.h
+
+- reset\ResetStrings.uni
+- reset\reset.c
+- reset\reset.h
++ reset/ResetStrings.uni
++ reset/reset.c
++ reset/reset.h
+
+- rm\RmStrings.uni
+- rm\rm.h
+- rm\rm.c
++ rm/RmStrings.uni
++ rm/rm.h
++ rm/rm.c
+
+- type\TypeStrings.uni
+- type\type.c
+- type\type.h
+- time\TimeStrings.uni
+- time\time.c
+- time\time.h
+-
+- touch\TouchStrings.uni
+- touch\touch.c
+- touch\touch.h
+-
+- vol\VolStrings.uni
+- vol\vol.c
+- vol\vol.h
+-
+- ver\VerStrings.uni
+- ver\ver.c
+- ver\ver.h
++ type/TypeStrings.uni
++ type/type.c
++ type/type.h
++ time/TimeStrings.uni
++ time/time.c
++ time/time.h
++
++ touch/TouchStrings.uni
++ touch/touch.c
++ touch/touch.h
++
++ vol/VolStrings.uni
++ vol/vol.c
++ vol/vol.h
++
++ ver/VerStrings.uni
++ ver/ver.c
++ ver/ver.h
+
+- drivers\driversStrings.uni
+- drivers\drivers.c
+- drivers\drivers.h
++ drivers/driversStrings.uni
++ drivers/drivers.c
++ drivers/drivers.h
+
+- drvcfg\DrvcfgStrings.uni
+- drvcfg\drvcfg.c
+- drvcfg\drvcfg.h
++ drvcfg/DrvcfgStrings.uni
++ drvcfg/drvcfg.c
++ drvcfg/drvcfg.h
+
+- drvdiag\DrvdiagStrings.uni
+- drvdiag\drvdiag.c
+- drvdiag\drvdiag.h
++ drvdiag/DrvdiagStrings.uni
++ drvdiag/drvdiag.c
++ drvdiag/drvdiag.h
+
+
+
+ [sources.ia32]
+- ver\ia32\ver32.c
+- Library\ia32\math.c
+- Library\ia32\initplat.c
++ ver/IA32/ver32.c
++ Library/IA32/math.c
++ Library/IA32/initplat.c
+
+
+ [sources.ipf]
+- ver\ipf\ver64.c
+- Library\ipf\math.c
+- Library\ipf\initplat.c
+- Library\ipf\palproc.s
+- Library\ipf\salpal.c
++ ver/IPF/ver64.c
++ Library/IPF/math.c
++ Library/IPF/initplat.c
++ Library/IPF/palproc.s
++ Library/IPF/salpal.c
+
+ [sources.EBC]
+- ver\ebc\verEbc.c
+- Library\EBC\math.c
+- Library\EBC\initplat.c
++ ver/ebc/verEbc.c
++ Library/Ebc/math.c
++ Library/Ebc/initplat.c
+
+ [sources.x64]
+- ver\ia32\ver32.c
+- Library\ipf\math.c
+- Library\ia32\initplat.c
++ ver/IA32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
++
++[sources.ARM]
++ ver/ia32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
++
++[sources.AARCH64]
++ ver/ia32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
+
+ [includes.common]
+ .
+- .\Inc
+- .\ver
+- .\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
++ ./Inc
++ ./ver
++ ./Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
+ $(DEST_DIR)
+
+ [libraries.common]
+@@ -216,17 +226,18 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeShell
+- C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_MONOSHELL
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
++ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_MONOSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_MONOSHELL
+
+ [nmake.ebc]
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DEFI_MONOSHELL
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+-
+-
+-
+-
+\ No newline at end of file
+diff --git a/ShellFull.inf b/ShellFull.inf
+index 832dc79..48fa7aa 100644
+--- a/ShellFull.inf
++++ b/ShellFull.inf
+@@ -20,300 +20,310 @@
+ #--*/
+
+ [defines]
+-BASE_NAME = Shell
+-FILE_GUID = c57ad6b7-0515-40a8-9d21-551652854e37
++BASE_NAME = ShellFull
++FILE_GUID = 1903FB23-E526-4BDA-85E4-D68F2EEF0C20
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- Library\ShellDebug.c
+- Library\DPath.c
+- Library\Init.c
+- Library\Lock.c
+- Library\Str.c
+- Library\IO.c
+- Library\Mem.c
+- Library\Misc.c
+- Library\Data.c
+- Library\RtData.c
+- Library\ShellEnvInt.c
+- Library\Handle.c
+- Library\FileIO.c
+- Library\ConsistMapping.c
+- Library\CRC.c
+- Library\Event.c
+- Library\Perf.c
+- Library\VarCheck.c
+- Library\HiiSupport.c
+-
+- newshell\NshellStrings.uni
+- newshell\init.c
+- newshell\nshell.h
+- newshell\fakehii.c
++ Library/ShellDebug.c
++ Library/DPath.c
++ Library/Init.c
++ Library/Lock.c
++ Library/Str.c
++ Library/IO.c
++ Library/Mem.c
++ Library/Misc.c
++ Library/Data.c
++ Library/RtData.c
++ Library/ShellEnvInt.c
++ Library/Handle.c
++ Library/FileIO.c
++ Library/ConsistMapping.c
++ Library/CRC.c
++ Library/Event.c
++ Library/Perf.c
++ Library/VarCheck.c
++ Library/HiiSupport.c
++
++ newshell/NshellStrings.uni
++ newshell/init.c
++ newshell/nshell.h
++ newshell/fakehii.c
+
+ ShCommonStrings.uni
+- shellenv\ShellenvHelpStrings.uni
+- shellenv\ShellenvStrings.uni
+- shellenv\ScriptCmdStrings.uni
+- shellenv\ConnectStrings.uni
+- shellenv\EchoStrings.uni
+- shellenv\HelpStrings.uni
+- shellenv\MapStrings.uni
+- shellenv\CdStrings.uni
+- shellenv\DhStrings.uni
++ shellenv/ShellenvHelpStrings.uni
++ shellenv/ShellenvStrings.uni
++ shellenv/ScriptCmdStrings.uni
++ shellenv/ConnectStrings.uni
++ shellenv/EchoStrings.uni
++ shellenv/HelpStrings.uni
++ shellenv/MapStrings.uni
++ shellenv/CdStrings.uni
++ shellenv/DhStrings.uni
+
+- shellenv\cmddisp.c
+- shellenv\connect.c
+- shellenv\data.c
+- shellenv\exec.c
+- shellenv\init.c
+- shellenv\protid.c
+- shellenv\var.c
+- shellenv\conio.c
+- shellenv\consoleproxy.c
+- shellenv\handle.c
+- shellenv\dprot.c
+- shellenv\map.c
+- shellenv\marg.c
+- shellenv\batch.c
+- shellenv\if.c
+- shellenv\goto.c
+- shellenv\echo.c
+- shellenv\pause.c
+- shellenv\for.c
+- shellenv\wait.c
+- shellenv\help.c
+- shellenv\shelle.h
+- shellenv\shellenvguid.h
+- shellenv\parsecmd.c
+- shellenv\shift.c
++ shellenv/cmddisp.c
++ shellenv/connect.c
++ shellenv/data.c
++ shellenv/exec.c
++ shellenv/init.c
++ shellenv/protid.c
++ shellenv/var.c
++ shellenv/conio.c
++ shellenv/consoleproxy.c
++ shellenv/handle.c
++ shellenv/dprot.c
++ shellenv/map.c
++ shellenv/marg.c
++ shellenv/batch.c
++ shellenv/if.c
++ shellenv/goto.c
++ shellenv/echo.c
++ shellenv/pause.c
++ shellenv/for.c
++ shellenv/wait.c
++ shellenv/help.c
++ shellenv/shelle.h
++ shellenv/shellenvguid.h
++ shellenv/parsecmd.c
++ shellenv/shift.c
+
+- unload\UnloadStrings.uni
+- unload\unload.c
++ unload/UnloadStrings.uni
++ unload/unload.c
+
+- attrib\AttribStrings.uni
+- attrib\attrib.c
+- attrib\attrib.h
++ attrib/AttribStrings.uni
++ attrib/attrib.c
++ attrib/attrib.h
+
+- cls\clsstrings.uni
+- cls\cls.c
++ cls/clsstrings.uni
++ cls/cls.c
+
+- cp\CpStrings.uni
+- cp\cp.h
+- cp\cp.c
++ cp/CpStrings.uni
++ cp/cp.h
++ cp/cp.c
+
+- date\DateStrings.uni
+- date\date.c
+- date\date.h
++ date/DateStrings.uni
++ date/date.c
++ date/date.h
+
+- load\LoadStrings.uni
+- load\load.c
+- load\load.h
++ load/LoadStrings.uni
++ load/load.c
++ load/load.h
+
+- ls\LsStrings.uni
+- ls\ls.h
+- ls\ls.c
++ ls/LsStrings.uni
++ ls/ls.h
++ ls/ls.c
+
+- mkdir\MkdirStrings.uni
+- mkdir\mkdir.c
+- mkdir\mkdir.h
++ mkdir/MkdirStrings.uni
++ mkdir/mkdir.c
++ mkdir/mkdir.h
+
+- mv\MvStrings.uni
+- mv\mv.c
+- mv\mv.h
++ mv/MvStrings.uni
++ mv/mv.c
++ mv/mv.h
+
+- reset\ResetStrings.uni
+- reset\reset.c
+- reset\reset.h
++ reset/ResetStrings.uni
++ reset/reset.c
++ reset/reset.h
+
+- rm\RmStrings.uni
+- rm\rm.h
+- rm\rm.c
++ rm/RmStrings.uni
++ rm/rm.h
++ rm/rm.c
+
+- type\TypeStrings.uni
+- type\type.c
+- type\type.h
+- time\TimeStrings.uni
+- time\time.c
+- time\time.h
+-
+- touch\TouchStrings.uni
+- touch\touch.c
+- touch\touch.h
+-
+- vol\VolStrings.uni
+- vol\vol.c
+- vol\vol.h
+-
+- ver\VerStrings.uni
+- ver\ver.c
+- ver\ver.h
++ type/TypeStrings.uni
++ type/type.c
++ type/type.h
++ time/TimeStrings.uni
++ time/time.c
++ time/time.h
++
++ touch/TouchStrings.uni
++ touch/touch.c
++ touch/touch.h
++
++ vol/VolStrings.uni
++ vol/vol.c
++ vol/vol.h
++
++ ver/VerStrings.uni
++ ver/ver.c
++ ver/ver.h
+
+- drivers\driversStrings.uni
+- drivers\drivers.c
+- drivers\drivers.h
++ drivers/driversStrings.uni
++ drivers/drivers.c
++ drivers/drivers.h
+
+- drvcfg\DrvcfgStrings.uni
+- drvcfg\drvcfg.c
+- drvcfg\drvcfg.h
++ drvcfg/DrvcfgStrings.uni
++ drvcfg/drvcfg.c
++ drvcfg/drvcfg.h
+
+- drvdiag\DrvdiagStrings.uni
+- drvdiag\drvdiag.c
+- drvdiag\drvdiag.h
++ drvdiag/DrvdiagStrings.uni
++ drvdiag/drvdiag.c
++ drvdiag/drvdiag.h
+
+- comp\CompStrings.uni
+- comp\comp.c
++ comp/CompStrings.uni
++ comp/comp.c
+
+- dblk\dblkStrings.uni
+- dblk\dblk.c
+- dblk\efidump.c
++ dblk/dblkStrings.uni
++ dblk/dblk.c
++ dblk/efidump.c
+
+- devices\DevicesStrings.uni
+- devices\devices.c
++ devices/DevicesStrings.uni
++ devices/devices.c
+
+- devicetree\DevicetreeStrings.uni
+- devicetree\devicetree.c
++ devicetree/DevicetreeStrings.uni
++ devicetree/devicetree.c
+
+- dmem\MemStrings.uni
+- dmem\DebugStrings.uni
+- dmem\mem.c
+- dmem\MemCommonPart.c
+- dmem\efidump.c
++ dmem/MemStrings.uni
++ dmem/DebugStrings.uni
++ dmem/mem.c
++ dmem/MemCommonPart.c
++ dmem/efidump.c
+
+- dmpstore\DmpstoreStrings.uni
+- dmpstore\dmpstore.c
++ dmpstore/DmpstoreStrings.uni
++ dmpstore/dmpstore.c
+
+- edit\EditStrings.uni
+- edit\main.c
+- edit\libFileBuffer.c
+- edit\libEditor.c
+- edit\libTitleBar.c
+- edit\libStatusBar.c
+- edit\libInputBar.c
+- edit\libMenuBar.c
+- edit\libMisc.c
++ edit/EditStrings.uni
++ edit/main.c
++ edit/libFileBuffer.c
++ edit/libEditor.c
++ edit/libTitleBar.c
++ edit/libStatusBar.c
++ edit/libInputBar.c
++ edit/libMenuBar.c
++ edit/libMisc.c
+
+- eficompress\CompressStrings.uni
+- eficompress\compressMain.c
+- eficompress\compress.c
++ eficompress/CompressStrings.uni
++ eficompress/compressMain.c
++ eficompress/compress.c
+
+- efidecompress\DecompressStrings.uni
+- efidecompress\decompress.c
++ efidecompress/DecompressStrings.uni
++ efidecompress/decompress.c
+
+- err\ErrStrings.uni
+- err\err.c
++ err/ErrStrings.uni
++ err/err.c
+
+- guid\GuidStrings.uni
+- guid\guid.c
++ guid/GuidStrings.uni
++ guid/guid.c
+
+- hexedit\HexeditStrings.uni
+- hexedit\main.c
+- hexedit\libBufferImage.c
+- hexedit\libFileImage.c
+- hexedit\libDiskImage.c
+- hexedit\libMemImage.c
+- hexedit\libEditor.c
+- hexedit\libTitleBar.c
+- hexedit\libStatusBar.c
+- hexedit\libInputBar.c
+- hexedit\libMenuBar.c
+- hexedit\libClipBoard.c
+- hexedit\libMisc.c
+-
+- IfConfig\IfConfigStrings.uni
+- IfConfig\IfConfig.c
+- IfConfig\IfConfig.h
+- IfConfig\ShellNetHelper.c
+-
+- ipconfig\IpConfigStrings.uni
+- ipconfig\IpConfig.c
++ hexedit/HexeditStrings.uni
++ hexedit/main.c
++ hexedit/libBufferImage.c
++ hexedit/libFileImage.c
++ hexedit/libDiskImage.c
++ hexedit/libMemImage.c
++ hexedit/libEditor.c
++ hexedit/libTitleBar.c
++ hexedit/libStatusBar.c
++ hexedit/libInputBar.c
++ hexedit/libMenuBar.c
++ hexedit/libClipBoard.c
++ hexedit/libMisc.c
++
++ IfConfig/IfConfigStrings.uni
++ IfConfig/IfConfig.c
++ IfConfig/IfConfig.h
++ IfConfig/ShellNetHelper.c
++
++ IpConfig/IpConfigStrings.uni
++ IpConfig/IpConfig.c
+
+- loadpcirom\LoadPciRomStrings.uni
+- loadpcirom\LoadPciRom.c
++ loadpcirom/LoadPciRomStrings.uni
++ loadpcirom/LoadPciRom.c
+
+- mem\MemStrings.uni
+- mem\DebugStrings.uni
+- mem\mm.c
+- mem\MemCommonPart.c
+- mem\efidump.c
++ mem/MemStrings.uni
++ mem/DebugStrings.uni
++ mem/mm.c
++ mem/MemCommonPart.c
++ mem/efidump.c
+
+- memmap\memmapStrings.uni
+- memmap\memmap.c
++ memmap/memmapStrings.uni
++ memmap/memmap.c
+
+- mm\MmStrings.uni
+- mm\mm.c
++ mm/MmStrings.uni
++ mm/mm.c
+
+- mode\ModeStrings.uni
+- mode\mode.c
++ mode/ModeStrings.uni
++ mode/mode.c
+
+- mount\MountStrings.uni
+- mount\mount.c
++ mount/MountStrings.uni
++ mount/mount.c
+
+- openinfo\OPeninfoStrings.uni
+- openinfo\openinfo.c
++ openinfo/OPeninfoStrings.uni
++ openinfo/openinfo.c
+
+- Ping\PingStrings.uni
+- Ping\Ping.c
++ Ping/PingStrings.uni
++ Ping/Ping.c
+
+- pci\PciStrings.uni
+- pci\pci.c
+- pci\pci_class.c
++ pci/PciStrings.uni
++ pci/pci.c
++ pci/pci_class.c
+
+- sermode\SermodeStrings.uni
+- sermode\sermode.c
++ sermode/SermodeStrings.uni
++ sermode/sermode.c
+
+- smbiosview\SmBiosViewStrings.uni
+- smbiosview\QueryTable.c
+- smbiosview\EventLogInfo.c
+- smbiosview\PrintInfo.c
+- smbiosview\LibSmbiosView.c
+- smbiosview\smbiosview.c
+- smbiosview\smbios.c
++ smbiosview/SmBiosViewStrings.uni
++ smbiosview/QueryTable.c
++ smbiosview/EventLogInfo.c
++ smbiosview/PrintInfo.c
++ smbiosview/LibSmbiosView.c
++ smbiosview/smbiosview.c
++ smbiosview/smbios.c
+
+- stall\stallStrings.uni
+- stall\stall.c
++ stall/stallStrings.uni
++ stall/stall.c
+
+- telnetmgmt\TelnetMgmtStrings.uni
+- telnetmgmt\TelnetMgmt.c
++ telnetmgmt/TelnetMgmtStrings.uni
++ telnetmgmt/TelnetMgmt.c
+
+- tzone\TZoneStrings.uni
+- tzone\tzone.c
++ tzone/TZoneStrings.uni
++ tzone/tzone.c
+
+ [sources.ia32]
+- ver\ia32\ver32.c
+- Library\ia32\math.c
+- Library\ia32\initplat.c
++ ver/IA32/ver32.c
++ Library/IA32/math.c
++ Library/IA32/initplat.c
+
+ [sources.ipf]
+- ver\ipf\ver64.c
+- Library\ipf\math.c
+- Library\ipf\initplat.c
+- Library\ipf\palproc.s
+- Library\ipf\salpal.c
++ ver/IPF/ver64.c
++ Library/IPF/math.c
++ Library/IPF/initplat.c
++ Library/IPF/palproc.s
++ Library/IPF/salpal.c
+
+ [sources.EBC]
+- ver\ebc\verEbc.c
+- Library\EBC\math.c
+- Library\EBC\initplat.c
++ ver/ebc/verEbc.c
++ Library/Ebc/math.c
++ Library/Ebc/initplat.c
+
+ [sources.x64]
+- ver\ia32\ver32.c
+- Library\ipf\math.c
+- Library\ia32\initplat.c
++ ver/IA32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
++
++[sources.ARM]
++ ver/ia32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
++
++[sources.AARCH64]
++ ver/ia32/ver32.c
++ Library/IPF/math.c
++ Library/IA32/initplat.c
+
+ [includes.common]
+ .
+- .\Inc
+- .\ver
+- .\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
++ ./Inc
++ ./ver
++ ./Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
+ $(DEST_DIR)
+
+ [libraries.common]
+@@ -341,16 +351,18 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeShell
+- C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_MONOSHELL /DEFI_FULLSHELL
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
++ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_MONOSHELL /DEFI_FULLSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_MONOSHELL -DEFI_FULLSHELL
+
+ [nmake.ebc]
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DEFI_MONOSHELL /DEFI_FULLSHELL
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+-
+-
+-
+\ No newline at end of file
+diff --git a/SmbiosView/EventLogInfo.c b/SmbiosView/EventLogInfo.c
+index 7f9b726..33e3549 100644
+--- a/SmbiosView/EventLogInfo.c
++++ b/SmbiosView/EventLogInfo.c
+@@ -25,7 +25,7 @@ Revision History
+ #include "PrintInfo.h"
+ #include "QueryTable.h"
+ #include "EventLogInfo.h"
+-#include "smbios.h"
++#include "Smbios.h"
+ #include STRING_DEFINES_FILE
+
+ VOID
+diff --git a/SmbiosView/EventLogInfo.h b/SmbiosView/EventLogInfo.h
+index d1591c0..ca58380 100644
+--- a/SmbiosView/EventLogInfo.h
++++ b/SmbiosView/EventLogInfo.h
+@@ -85,3 +85,4 @@ DisplaySysEventLogData (
+ );
+
+ #endif
++
+diff --git a/SmbiosView/LibSmbios.h b/SmbiosView/LibSmbios.h
+index b13fd6b..c2e6b5e 100644
+--- a/SmbiosView/LibSmbios.h
++++ b/SmbiosView/LibSmbios.h
+@@ -642,3 +642,4 @@ LibGetSmbiosSystemGuidAndSerialNumber (
+
+
+ #endif
++
+diff --git a/SmbiosView/LibSmbiosView.c b/SmbiosView/LibSmbiosView.c
+index d31ed01..f1438bc 100644
+--- a/SmbiosView/LibSmbiosView.c
++++ b/SmbiosView/LibSmbiosView.c
+@@ -22,10 +22,10 @@ Revision History
+ --*/
+
+ #include "EfiShellLib.h"
+-#include "LIbSmbios.h"
++#include "LibSmbios.h"
+ #include "LibSmbiosView.h"
+ #include "smbiosview.h"
+-#include "smbios.h"
++#include "Smbios.h"
+ #include STRING_DEFINES_FILE
+
+ STATIC UINT8 mInit = 0;
+@@ -62,7 +62,7 @@ Returns:
+ //
+ // Get SMBIOS table from System Configure table
+ //
+- Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &mSmbiosTable);
++ Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID**)&mSmbiosTable);
+
+ if (mSmbiosTable == NULL) {
+ PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), HiiHandle);
+@@ -110,13 +110,13 @@ LibSmbiosGetEPS (
+
+ VOID
+ LibSmbiosGetStructHead (
+- SMBIOS_STRUCTURE_POINTER *pHead
++ SMBIOS_STRUCTURE_POINTER **pHead
+ )
+ {
+ //
+ // return SMBIOS structure table address
+ //
+- pHead = mSmbiosStruct;
++ *pHead = mSmbiosStruct;
+ }
+
+ EFI_STATUS
+diff --git a/SmbiosView/LibSmbiosView.h b/SmbiosView/LibSmbiosView.h
+index d763937..b7f7989 100644
+--- a/SmbiosView/LibSmbiosView.h
++++ b/SmbiosView/LibSmbiosView.h
+@@ -66,7 +66,7 @@ LibSmbiosGetEPS (
+
+ VOID
+ LibSmbiosGetStructHead (
+- SMBIOS_STRUCTURE_POINTER *pHead
++ SMBIOS_STRUCTURE_POINTER **pHead
+ );
+
+ EFI_STATUS
+@@ -128,3 +128,4 @@ SmbiosCheckStructure (
+ );
+
+ #endif
++
+diff --git a/SmbiosView/PrintInfo.c b/SmbiosView/PrintInfo.c
+index ff1f63c..1789ef6 100644
+--- a/SmbiosView/PrintInfo.c
++++ b/SmbiosView/PrintInfo.c
+@@ -26,7 +26,7 @@ Revision History
+ #include "LibSmbiosView.h"
+ #include "QueryTable.h"
+ #include "EventLogInfo.h"
+-#include "smbios.h"
++#include "Smbios.h"
+ #include STRING_DEFINES_FILE
+
+ //
+diff --git a/SmbiosView/PrintInfo.h b/SmbiosView/PrintInfo.h
+index 608dfb1..10faf21 100644
+--- a/SmbiosView/PrintInfo.h
++++ b/SmbiosView/PrintInfo.h
+@@ -199,3 +199,4 @@ DisplaySPSCharacteristics (
+ );
+
+ #endif
++
+diff --git a/SmbiosView/QueryTable.c b/SmbiosView/QueryTable.c
+index 4570938..1d9d60f 100644
+--- a/SmbiosView/QueryTable.c
++++ b/SmbiosView/QueryTable.c
+@@ -23,7 +23,7 @@ Revision History
+ #include "EfiShellLib.h"
+ #include "QueryTable.h"
+ #include "PrintInfo.h"
+-#include "smbios.h"
++#include "Smbios.h"
+
+ #include STRING_DEFINES_FILE
+
+diff --git a/SmbiosView/QueryTable.h b/SmbiosView/QueryTable.h
+index 727a053..ceb02fe 100644
+--- a/SmbiosView/QueryTable.h
++++ b/SmbiosView/QueryTable.h
+@@ -437,3 +437,4 @@ DisplayIPMIDIBMCInterfaceType (
+ );
+
+ #endif
++
+diff --git a/SmbiosView/Smbios.h b/SmbiosView/Smbios.h
+index 8a91b9e..15eb89c 100644
+--- a/SmbiosView/Smbios.h
++++ b/SmbiosView/Smbios.h
+@@ -37,3 +37,4 @@ extern EFI_HII_HANDLE HiiHandle;
+
+
+ #endif
++
+diff --git a/SmbiosView/Smbiosview.inf b/SmbiosView/Smbiosview.inf
+index f9e8c0b..d35b669 100644
+--- a/SmbiosView/Smbiosview.inf
++++ b/SmbiosView/Smbiosview.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 0F4C0280-B581-4940-AF19-D0CB5559CC95
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ SmBiosViewStrings.uni
+ QueryTable.c
+ QueryTable.h
+@@ -43,19 +43,19 @@ COMPONENT_TYPE = APPLICATION
+
[includes.common]
.
- ..\Inc
@@ -198,6 +3092,8 @@ Index: drvdiag/drvdiag.inf
- $(EDK_SOURCE)\Foundation\FrameWork\Include
- $(EDK_SOURCE)\Foundation\Core\Dxe
- $(DEST_DIR)\
+- $(EFI_SOURCE)\Application\Shell\Inc
+- $(EFI_SOURCE)\Application\Shell\Library
+ ../Inc
+ ../Library
+ $(EDK_SOURCE)/Foundation
@@ -209,14 +3105,250 @@ Index: drvdiag/drvdiag.inf
+ $(EDK_SOURCE)/Foundation/FrameWork/Include
+ $(EDK_SOURCE)/Foundation/Core/Dxe
+ $(DEST_DIR./
++ $(EFI_SOURCE)/Applicatio./Shels/Inc
++ $(EFI_SOURCE)/Applicatio./Shels/Library
[libraries.common]
EfiShellLib
-Index: cls/cls.c
-===================================================================
---- cls/cls.c (revision 64)
-+++ cls/cls.c (working copy)
-@@ -30,7 +30,7 @@
+@@ -70,7 +70,12 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeSmbiosViewApplication
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ L_PROJ_FLAGS=/align:4096
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/SmbiosView/smbiosview.c b/SmbiosView/smbiosview.c
+index 13b4fb7..79716d3 100644
+--- a/SmbiosView/smbiosview.c
++++ b/SmbiosView/smbiosview.c
+@@ -26,7 +26,7 @@ Revision History
+ #include "smbiosview.h"
+ #include "PrintInfo.h"
+ #include "QueryTable.h"
+-#include "smbios.h"
++#include "Smbios.h"
+
+ extern UINT8 STRING_ARRAY_NAME[];
+
+@@ -88,7 +88,7 @@ SHELL_VAR_CHECK_ITEM SmbiosviewCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE)0
+ }
+ };
+
+diff --git a/SmbiosView/smbiosview.h b/SmbiosView/smbiosview.h
+index dd65bc1..2101551 100644
+--- a/SmbiosView/smbiosview.h
++++ b/SmbiosView/smbiosview.h
+@@ -84,3 +84,4 @@ GetShowTypeString (
+ extern UINT8 gShowType;
+
+ #endif
++
+diff --git a/TelnetMgmt/TelnetMgmt.c b/TelnetMgmt/TelnetMgmt.c
+index 9d779df..04088d1 100644
+--- a/TelnetMgmt/TelnetMgmt.c
++++ b/TelnetMgmt/TelnetMgmt.c
+@@ -32,7 +32,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ #include STRING_DEFINES_FILE
+
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiTelnetMgmtGuid = EFI_TELNETMGMT_GUID;
+ EFI_GUID mEfiTelnetServerGuid = EFI_TELNET_SERVER_PROTOCOL_GUID;
+ SHELL_VAR_CHECK_ITEM TelnetmgmtCheckList[] = {
+@@ -58,7 +58,7 @@ SHELL_VAR_CHECK_ITEM TelnetmgmtCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/TelnetMgmt/TelnetMgmt.h b/TelnetMgmt/TelnetMgmt.h
+index 224fc3b..ed3c2f2 100644
+--- a/TelnetMgmt/TelnetMgmt.h
++++ b/TelnetMgmt/TelnetMgmt.h
+@@ -29,4 +29,4 @@ Revision History
+ 0x55d41b9a, 0x954d, 0x4fbb, 0x8d, 0x6d, 0x24, 0x75, 0xf5, 0x30, 0x9d, 0x37 \
+ }
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/TelnetMgmt/TelnetMgmt.inf b/TelnetMgmt/TelnetMgmt.inf
+index ad8b8bd..d2d9edb 100644
+--- a/TelnetMgmt/TelnetMgmt.inf
++++ b/TelnetMgmt/TelnetMgmt.inf
+@@ -25,23 +25,23 @@ FILE_GUID = 0C6282F4-F575-469d-BD55-7693AAC9D812
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ TelnetMgmtStrings.uni
+ TelnetMgmt.c
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -55,6 +55,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeTelnetMgmt
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/TelnetMgmt/TelnetServer.h b/TelnetMgmt/TelnetServer.h
+index 5eca179..8e0610f 100644
+--- a/TelnetMgmt/TelnetServer.h
++++ b/TelnetMgmt/TelnetServer.h
+@@ -81,3 +81,4 @@ typedef struct _EFI_TELNET_SERVER_PROTOCOL {
+ extern EFI_GUID gEfiTelnetServerGuid;
+
+ #endif
++
+diff --git a/attrib/attrib.c b/attrib/attrib.c
+index 3599d6d..6d1e677 100644
+--- a/attrib/attrib.c
++++ b/attrib/attrib.c
+@@ -57,7 +57,7 @@ AttribFile (
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiAttribGuid = EFI_ATTRIB_GUID;
+ SHELL_VAR_CHECK_ITEM AttribCheckList[] = {
+ {
+@@ -124,7 +124,7 @@ SHELL_VAR_CHECK_ITEM AttribCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+@@ -438,7 +438,7 @@ Returns:
+ //
+ Info = Arg->Info;
+ if (Add || Remove) {
+- Info->Attribute = Info->Attribute & (~Remove) | Add;
++ Info->Attribute = (Info->Attribute & (~Remove)) | Add;
+ Status = Arg->Handle->SetInfo (
+ Arg->Handle,
+ &gEfiFileInfoGuid,
+diff --git a/attrib/attrib.h b/attrib/attrib.h
+index 69ebd2f..c40c2df 100644
+--- a/attrib/attrib.h
++++ b/attrib/attrib.h
+@@ -29,4 +29,5 @@ Revision History
+ 0xcd691c77, 0xfc45, 0x4d7b, 0xb8, 0x92, 0x92, 0xa, 0x86, 0x2d, 0x67, 0xdc \
+ }
+
+-#endif
+\ No newline at end of file
++#endif
++
+diff --git a/attrib/attrib.inf b/attrib/attrib.inf
+index 38cc094..a35f1a7 100644
+--- a/attrib/attrib.inf
++++ b/attrib/attrib.inf
+@@ -41,24 +41,24 @@ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+ AttribStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ attrib.c
+ attrib.h
+
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -73,7 +73,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeAttrib
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/cls/cls.c b/cls/cls.c
+index 572cc82..bd9826a 100644
+--- a/cls/cls.c
++++ b/cls/cls.c
+@@ -30,7 +30,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
#include STRING_DEFINES_FILE
@@ -225,7 +3357,7 @@ Index: cls/cls.c
EFI_GUID EfiClsGuid = EFI_CLS_GUID;
SHELL_VAR_CHECK_ITEM ClsCheckList[] = {
{
-@@ -49,7 +49,7 @@
+@@ -49,7 +49,7 @@ SHELL_VAR_CHECK_ITEM ClsCheckList[] = {
NULL,
0,
0,
@@ -234,20 +3366,20 @@ Index: cls/cls.c
}
};
-Index: cls/cls.h
-===================================================================
---- cls/cls.h (revision 64)
-+++ cls/cls.h (working copy)
-@@ -36,3 +36,4 @@
+diff --git a/cls/cls.h b/cls/cls.h
+index eab21eb..31361c7 100644
+--- a/cls/cls.h
++++ b/cls/cls.h
+@@ -36,3 +36,4 @@ Revision History
}
#endif
+
-Index: cls/cls.inf
-===================================================================
---- cls/cls.inf (revision 64)
-+++ cls/cls.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/cls/cls.inf b/cls/cls.inf
+index 1e5ef66..70e676a 100644
+--- a/cls/cls.inf
++++ b/cls/cls.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
@@ -284,20 +3416,181 @@ Index: cls/cls.inf
[libraries.common]
EfiShellLib
-Index: newshell/nshell.inf
-===================================================================
---- newshell/nshell.inf (revision 64)
-+++ newshell/nshell.inf (working copy)
-@@ -26,24 +26,24 @@
+@@ -72,7 +72,12 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeCls
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+diff --git a/comp/comp.c b/comp/comp.c
+index 734bbe7..888f53f 100644
+--- a/comp/comp.c
++++ b/comp/comp.c
+@@ -50,7 +50,7 @@ SHELL_VAR_CHECK_ITEM CompCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/comp/comp.h b/comp/comp.h
+index 4dd667c..4d6c647 100644
+--- a/comp/comp.h
++++ b/comp/comp.h
+@@ -29,4 +29,4 @@ Revision History
+ 0x7761e2c2, 0x7297, 0x434d, 0xb6, 0x52, 0xa9, 0x76, 0x91, 0xb8, 0x66, 0xf3 \
+ }
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/comp/comp.inf b/comp/comp.inf
+index 7a525e4..86c464d 100644
+--- a/comp/comp.inf
++++ b/comp/comp.inf
+@@ -28,21 +28,21 @@ COMPONENT_TYPE = APPLICATION
+ CompStrings.uni
+ comp.c
+ comp.h
+-..\ShCommonStrings.uni
++../ShCommonStrings.uni
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -61,11 +61,16 @@ comp.h
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeComp
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+
+
+\ No newline at end of file
+diff --git a/cp/cp.c b/cp/cp.c
+index 25ac3cf..9299af4 100644
+--- a/cp/cp.c
++++ b/cp/cp.c
+@@ -66,7 +66,7 @@ SHELL_VAR_CHECK_ITEM CpCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+@@ -578,7 +578,7 @@ Returns:
+ //
+ if (SrcArg->Status == EFI_SUCCESS &&
+ (SrcArg->Info->Attribute & EFI_FILE_DIRECTORY) &&
+- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstMustDir && DstHandle)
++ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstMustDir && DstHandle)))
+ ) {
+ if (StrCmp (SrcFilePath, DstFilePath) == 0) {
+ PrintToken (STRING_TOKEN (STR_CP_CANNOT_COPY_ITSELF), HiiCpyHandle, L"cp/copy", SrcArg->FullName);
+@@ -592,7 +592,7 @@ Returns:
+ // we need to compose a full name of dir\file for the source
+ //
+ if (SrcArg->Status == EFI_SUCCESS &&
+- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstMustDir && DstHandle)) {
++ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstMustDir && DstHandle)))) {
+ if (DstFullName) {
+ FreePool (DstFullName);
+ }
+@@ -869,7 +869,6 @@ Returns:
+ EFI_STATUS Status;
+ EFI_FILE_INFO *SrcInfo;
+ EFI_FILE_INFO *DstInfo;
+- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *DstVol;
+ EFI_FILE_SYSTEM_INFO *DstFsInfo;
+ CHAR16 InputString[10];
+ UINTN BufSize;
+@@ -894,7 +893,6 @@ Returns:
+ SrcInfo = NULL;
+ DstInfo = NULL;
+ FileInfo = NULL;
+- DstVol = NULL;
+ DstFsInfo = NULL;
+ InputString[0] = 0;
+ BufSize = 0;
+@@ -1789,7 +1787,7 @@ Returns:
+ //
+ if (SrcArg->Status == EFI_SUCCESS &&
+ !(SrcArg->Info->Attribute & EFI_FILE_DIRECTORY) &&
+- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstDir && DstHandle)
++ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstDir && DstHandle)))
+ ) {
+ if (DstFullName) {
+ FreePool (DstFullName);
+diff --git a/cp/cp.h b/cp/cp.h
+index 338cdaa..89d22dd 100644
+--- a/cp/cp.h
++++ b/cp/cp.h
+@@ -67,4 +67,5 @@ CPMainProcOld (
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
+
+-#endif
+\ No newline at end of file
++#endif
++
+diff --git a/cp/cp.inf b/cp/cp.inf
+index 714c7bb..160434c 100644
+--- a/cp/cp.inf
++++ b/cp/cp.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
- NshellStrings.uni
+ CpStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- init.c
- nshell.h
- fakehii.c
-
+ cp.h
+ cp.c
+
[includes.common]
.
- ..\Inc
@@ -325,155 +3618,281 @@ Index: newshell/nshell.inf
[libraries.common]
EfiShellLib
-Index: newshell/FakeHii.c
-===================================================================
---- newshell/FakeHii.c (revision 64)
-+++ newshell/FakeHii.c (working copy)
-@@ -196,7 +196,7 @@
- Status = BS->HandleProtocol (
- mFakeHiiHandle,
- &gEfiHiiProtocolGuid,
-- &FakeHii
-+ (VOID**)&FakeHii
- );
- Status = BS->UninstallProtocolInterface (
- mFakeHiiHandle,
-@@ -320,7 +320,7 @@
- if (Language == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-- strcpya (Language, (UINT8 *) PackageHdr + HeaderSize - LanguageSize);
-+ strcpya (Language, (CHAR8*) ((UINT8 *) PackageHdr + HeaderSize - LanguageSize));
- for (Link = PackageList->StringPkgHdr.Flink; Link != &PackageList->StringPkgHdr; Link = Link->Flink) {
- StringPackage = CR (Link, FAKE_HII_STRING_PACKAGE, Entry, FAKE_HII_STRING_PACKAGE_SIGNATURE);
- if (CompareLanguage (Language, StringPackage->StringPkgHdr->Language)) {
-@@ -770,7 +770,7 @@
- StringPackage = NULL;
- for (Link = DatabaseRecord->StringPkgHdr.Flink; Link != &DatabaseRecord->StringPkgHdr; Link = Link->Flink) {
- StringPackage = CR (Link, FAKE_HII_STRING_PACKAGE, Entry, FAKE_HII_STRING_PACKAGE_SIGNATURE);
-- if (CompareLanguage (StringPackage->StringPkgHdr->Language, (UINT8 *) Language)) {
-+ if (CompareLanguage (StringPackage->StringPkgHdr->Language, (CHAR8 *) Language)) {
- Matched = TRUE;
- break;
- }
-Index: newshell/init.c
-===================================================================
---- newshell/init.c (revision 64)
-+++ newshell/init.c (working copy)
-@@ -23,7 +23,7 @@
- #include "nshell.h"
+@@ -72,7 +72,12 @@ COMPONENT_TYPE = APPLICATION
- extern UINT8 STRING_ARRAY_NAME[];
--extern BOOLEAN gHiiInitialized = FALSE;
-+BOOLEAN gHiiInitialized = FALSE;
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeCP
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
- //
- // This is the generated header file which includes whatever needs to be exported (strings + IFR)
-@@ -99,13 +99,13 @@
- Status = BS->HandleProtocol (
- ImgHnd,
- &gEfiLoadedImageProtocolGuid,
-- &img
-+ (VOID**)&img
- );
- if (!EFI_ERROR (Status)) {
- Status = BS->HandleProtocol (
- img->DeviceHandle,
- &gEfiDevicePathProtocolGuid,
-- &dp
-+ (VOID**)&dp
- );
- if (!EFI_ERROR (Status)) {
- *DevPath = DuplicateDevicePath (dp);
-@@ -220,7 +220,7 @@
- //
- Status = LibLocateProtocol (
- &gEfiConsoleControlProtocolGuid,
-- &ConsoleControl
-+ (VOID**)&ConsoleControl
- );
- if (!EFI_ERROR (Status)) {
- Status = ConsoleControl->GetMode (ConsoleControl, &mOldCurrentMode, NULL, NULL);
-@@ -342,7 +342,7 @@
- Status = _ShellLoadEnvDriver (ImageHandle);
- )
- if (EFI_ERROR (Status)) {
-- Status = LibLocateProtocol (&ShellEnvProtocol, &SE);
-+ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&SE);
- if (EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_NSHELL_ENV_DRIVER), HiiNewshellHandle);
- return Status;
-@@ -372,7 +372,7 @@
- *IsRootInstance = TRUE;
- }
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+diff --git a/date/date.c b/date/date.c
+index fb2f765..0416abe 100644
+--- a/date/date.c
++++ b/date/date.c
+@@ -53,8 +53,8 @@ STATIC
+ BOOLEAN
+ GetNumber (
+ IN CHAR16 *Str,
+- IN OUT INTN *Position,
+- IN OUT INTN *Number,
++ IN OUT UINTN *Position,
++ IN OUT UINTN *Number,
+ IN BOOLEAN EndNum
+ );
-- Status = LibLocateProtocol (&ShellEnvProtocol, &SE);
-+ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&SE);
- ASSERT (!EFI_ERROR (Status));
- SI = SE->NewShell (ImageHandle);
+@@ -92,7 +92,7 @@ SHELL_VAR_CHECK_ITEM DateCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
-@@ -543,7 +543,7 @@
- //
- ConsoleControlStatus = LibLocateProtocol (
- &gEfiConsoleControlProtocolGuid,
-- &ConsoleControl
-+ (VOID**)&ConsoleControl
- );
- if (!EFI_ERROR (ConsoleControlStatus)) {
- ConsoleControlStatus = ConsoleControl->GetMode (ConsoleControl, &CurrentMode, NULL, NULL);
-@@ -709,7 +709,7 @@
- //
- SE2->IncrementShellNestingLevel ();
+@@ -330,8 +330,8 @@ STATIC
+ BOOLEAN
+ GetNumber (
+ IN CHAR16 *Str,
+- IN OUT INTN *Position,
+- IN OUT INTN *Number,
++ IN OUT UINTN *Position,
++ IN OUT UINTN *Number,
+ IN BOOLEAN EndNum
+ )
+ {
+diff --git a/date/date.h b/date/date.h
+index c95ac4d..d327c33 100644
+--- a/date/date.h
++++ b/date/date.h
+@@ -32,3 +32,4 @@ Revision History
+ }
-- while (Status != -1) {
-+ while (Status != (EFI_STATUS) -1) {
- Status = NShellPrompt (ImageHandle);
- EFI_NT_EMULATOR_CODE (
- //
-@@ -723,7 +723,7 @@
- Status = BS->HandleProtocol (
- ImageHandle,
- &ShellInterfaceProtocol,
-- &SI
-+ (VOID**)&SI
- );
- ASSERT (!EFI_ERROR (Status));
- }
-Index: newshell/FakeHii.h
-===================================================================
---- newshell/FakeHii.h (revision 64)
-+++ newshell/FakeHii.h (working copy)
-@@ -479,3 +479,4 @@
#endif
++
+diff --git a/date/date.inf b/date/date.inf
+index 2c40f72..affbb73 100644
+--- a/date/date.inf
++++ b/date/date.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
- #endif
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ DateStrings.uni
+ Date.c
+ Date.h
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -71,7 +71,12 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeDate
+
-Index: newshell/nshell.h
-===================================================================
---- newshell/nshell.h (revision 64)
-+++ newshell/nshell.h (working copy)
-@@ -58,4 +58,5 @@
- #define EFI_NO_MONOSHELL_CODE(code) code
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+diff --git a/dblk/dblk.c b/dblk/dblk.c
+index 3019627..21c841e 100644
+--- a/dblk/dblk.c
++++ b/dblk/dblk.c
+@@ -52,7 +52,7 @@ SHELL_VAR_CHECK_ITEM DblkCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/dblk/dblk.h b/dblk/dblk.h
+index 0341aeb..d7ec371 100644
+--- a/dblk/dblk.h
++++ b/dblk/dblk.h
+@@ -168,3 +168,4 @@ DblkStructsPrint (
+ extern EFI_HII_HANDLE HiiDblkHandle;
+
#endif
++
+diff --git a/dblk/dblk.inf b/dblk/dblk.inf
+index f15392c..3c5dd45 100644
+--- a/dblk/dblk.inf
++++ b/dblk/dblk.inf
+@@ -26,23 +26,23 @@ COMPONENT_TYPE = APPLICATION
--#endif
+ [sources.common]
+ DblkStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ dblk.c
+ efidump.c
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -61,11 +61,16 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=DumpBlockDev
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+
+
\ No newline at end of file
-+#endif
+diff --git a/dblk/efidump.c b/dblk/efidump.c
+index 7fc0337..c18b826 100644
+--- a/dblk/efidump.c
++++ b/dblk/efidump.c
+@@ -24,7 +24,7 @@ Revision History
+ --*/
+
+ #include "dblk.h"
+-#include "Efipart.h"
++#include "EfiPart.h"
+ #include "EfiShellLib.h"
+
+ #include STRING_DEFINES_FILE
+@@ -320,13 +320,11 @@ DblkDumpSystemTable (
+ VOID *AcpiTable;
+ VOID *Acpi20Table;
+ VOID *SMBIOSTable;
+- VOID *SalSystemTable;
+ VOID *MpsTable;
+
+ AcpiTable = NULL;
+ Acpi20Table = NULL;
+ SMBIOSTable = NULL;
+- SalSystemTable = NULL;
+ MpsTable = NULL;
+
+ PrintToken (
+@@ -352,10 +350,12 @@ DblkDumpSystemTable (
+ PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiDblkHandle, LibDevicePathToStr (DevicePath));
+ }
+
+- PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiDblkHandle, (UINT64) Tbl.Sys->RuntimeServices);
+- PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiDblkHandle, (UINT64) Tbl.Sys->BootServices);
++ PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiDblkHandle, (UINT64)(UINTN) Tbl.Sys->RuntimeServices);
++ PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiDblkHandle, (UINT64)(UINTN) Tbl.Sys->BootServices);
+
+ EFI64_CODE (
++ VOID *SalSystemTable;
+
-Index: type/type.c
-===================================================================
---- type/type.c (revision 64)
-+++ type/type.c (working copy)
-@@ -59,7 +59,7 @@
- BOOLEAN TypeUnicode;
- BOOLEAN TypeAuto;
+ Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
+ if (!EFI_ERROR(Status)) {
+ PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiDblkHandle, (UINT64)SalSystemTable);
+@@ -364,22 +364,22 @@ DblkDumpSystemTable (
+
+ Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiDblkHandle, (UINT64) AcpiTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiDblkHandle, (UINT64)(UINTN) AcpiTable);
+ }
+
+ Status = LibGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Acpi20Table);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiDblkHandle, (UINT64) Acpi20Table);
++ PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiDblkHandle, (UINT64)(UINTN) Acpi20Table);
+ }
+
+ Status = LibGetSystemConfigurationTable (&gEfiMpsTableGuid, &MpsTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiDblkHandle, (UINT64) MpsTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiDblkHandle, (UINT64)(UINTN) MpsTable);
+ }
+
+ Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &SMBIOSTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiDblkHandle, (UINT64) SMBIOSTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiDblkHandle, (UINT64)(UINTN) SMBIOSTable);
+ }
+ }
+diff --git a/devices/devices.c b/devices/devices.c
+index bcc8beb..1934ef5 100644
+--- a/devices/devices.c
++++ b/devices/devices.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiTypeGuid = EFI_TYPE_GUID;
- SHELL_VAR_CHECK_ITEM TypeCheckList[] = {
+ EFI_GUID EfiDevicesGuid = EFI_DEVICES_GUID;
+ SHELL_VAR_CHECK_ITEM DevicesCheckList[] = {
{
-@@ -90,7 +90,7 @@
+@@ -61,7 +61,7 @@ SHELL_VAR_CHECK_ITEM DevicesCheckList[] = {
NULL,
0,
0,
@@ -482,29 +3901,28 @@ Index: type/type.c
}
};
-Index: type/type.h
-===================================================================
---- type/type.h (revision 64)
-+++ type/type.h (working copy)
-@@ -30,3 +30,4 @@
+diff --git a/devices/devices.h b/devices/devices.h
+index 19e0983..6aff8bf 100644
+--- a/devices/devices.h
++++ b/devices/devices.h
+@@ -32,3 +32,4 @@ Revision History
+ 0x6fabed98, 0x2a7, 0x46a4, 0x84, 0xd1, 0x76, 0xcd, 0x5c, 0x49, 0x78, 0x74 \
}
-
#endif
+
-Index: type/type.inf
-===================================================================
---- type/type.inf (revision 64)
-+++ type/type.inf (working copy)
-@@ -40,24 +40,24 @@
-
+diff --git a/devices/devices.inf b/devices/devices.inf
+index c380f7d..f9356da 100644
+--- a/devices/devices.inf
++++ b/devices/devices.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- TypeStrings.uni
- type.c
- type.h
-
+ DevicesStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ devices.c
+ devices.h
+
[includes.common]
.
- ..\Inc
@@ -532,11 +3950,23 @@ Index: type/type.inf
[libraries.common]
EfiShellLib
-Index: dmem/MemCommonPart.c
-===================================================================
---- dmem/MemCommonPart.c (revision 64)
-+++ dmem/MemCommonPart.c (working copy)
-@@ -58,7 +58,7 @@
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DevicesMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/dmem/MemCommonPart.c b/dmem/MemCommonPart.c
+index 377da17..c4807a3 100644
+--- a/dmem/MemCommonPart.c
++++ b/dmem/MemCommonPart.c
+@@ -58,7 +58,7 @@ SHELL_VAR_CHECK_ITEM DmemCheckList[] = {
NULL,
0,
0,
@@ -545,7 +3975,7 @@ Index: dmem/MemCommonPart.c
}
};
-@@ -148,7 +148,7 @@
+@@ -148,7 +148,7 @@ Return:
return EFI_SUCCESS;
}
@@ -554,7 +3984,7 @@ Index: dmem/MemCommonPart.c
Size = (SizeStr) ? Xtoi (SizeStr) : 512;
//
-@@ -156,7 +156,7 @@
+@@ -156,7 +156,7 @@ Return:
//
PrintToken (STRING_TOKEN (STR_DMEM_MEMORY_ADDR), HiiDmemHandle, 2 * sizeof (UINTN), Address, Size);
if (MMIo) {
@@ -563,7 +3993,7 @@ Index: dmem/MemCommonPart.c
if (EFI_ERROR (Status)) {
PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiDmemHandle, L"dmem", L"PciRootBridgeIo");
return Status;
-@@ -171,7 +171,7 @@
+@@ -171,7 +171,7 @@ Return:
return Status;
}
@@ -572,7 +4002,7 @@ Index: dmem/MemCommonPart.c
} else {
Buffer = (UINT8 *) (UINTN) Address;
}
-@@ -233,7 +233,7 @@
+@@ -233,7 +233,7 @@ Return:
//
MMIo = FALSE;
AddressStr = SizeStr = NULL;
@@ -581,7 +4011,7 @@ Index: dmem/MemCommonPart.c
Size = 512;
RetCode = LibCheckVariables (SI, DmemCheckList, &ChkPck, &Useful);
if (VarCheckOk != RetCode) {
-@@ -316,7 +316,7 @@
+@@ -316,7 +316,7 @@ Return:
//
PrintToken (STRING_TOKEN (STR_DMEM_NEW_MEMORY_ADDR), HiiDmemHandle, 2 * sizeof (UINTN), Address, Size);
if (MMIo) {
@@ -590,7 +4020,7 @@ Index: dmem/MemCommonPart.c
if (EFI_ERROR (Status)) {
PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiDmemHandle, L"dmem", L"PciRootBridgeIo");
return Status;
-@@ -331,7 +331,7 @@
+@@ -331,7 +331,7 @@ Return:
return Status;
}
@@ -599,22 +4029,88 @@ Index: dmem/MemCommonPart.c
} else {
Buffer = (UINT8 *) (UINTN) Address;
}
-Index: dmem/MemCommonPart.h
-===================================================================
---- dmem/MemCommonPart.h (revision 64)
-+++ dmem/MemCommonPart.h (working copy)
-@@ -61,4 +61,4 @@
+diff --git a/dmem/MemCommonPart.h b/dmem/MemCommonPart.h
+index f57e32a..f094fbb 100644
+--- a/dmem/MemCommonPart.h
++++ b/dmem/MemCommonPart.h
+@@ -61,4 +61,4 @@ EFIStructsPrint (
IN EFI_BLOCK_IO_PROTOCOL *BlkIo
);
-#endif
\ No newline at end of file
+#endif
-Index: dmem/efidump.c
-===================================================================
---- dmem/efidump.c (revision 64)
-+++ dmem/efidump.c (working copy)
-@@ -24,7 +24,7 @@
+diff --git a/dmem/debug.h b/dmem/debug.h
+index 50df0ed..8d5cd4e 100644
+--- a/dmem/debug.h
++++ b/dmem/debug.h
+@@ -156,3 +156,4 @@ EFIStructsPrint (
+ extern EFI_HII_HANDLE HiiDmemHandle;
+
+ #endif
++
+diff --git a/dmem/dmem.inf b/dmem/dmem.inf
+index ca0dcaf..acdf279 100644
+--- a/dmem/dmem.inf
++++ b/dmem/dmem.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 644E259E-FF88-4d31-8092-B99D8777F1C4
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ MemStrings.uni
+ DebugStrings.uni
+ mem.c
+@@ -34,17 +34,17 @@ COMPONENT_TYPE = APPLICATION
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -64,9 +64,13 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=DumpMem
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/dmem/efidump.c b/dmem/efidump.c
+index 051f6a0..11526f2 100644
+--- a/dmem/efidump.c
++++ b/dmem/efidump.c
+@@ -24,7 +24,7 @@ Revision History
--*/
#include "debug.h"
@@ -623,7 +4119,7 @@ Index: dmem/efidump.c
#include "EfiShellLib.h"
#include STRING_DEFINES_FILE
-@@ -320,13 +320,11 @@
+@@ -320,13 +320,11 @@ DumpSystemTable (
VOID *AcpiTable;
VOID *Acpi20Table;
VOID *SMBIOSTable;
@@ -637,7 +4133,7 @@ Index: dmem/efidump.c
MpsTable = NULL;
PrintToken (
-@@ -352,11 +350,13 @@
+@@ -352,11 +350,13 @@ DumpSystemTable (
PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiDmemHandle, LibDevicePathToStr (DevicePath));
}
@@ -654,7 +4150,7 @@ Index: dmem/efidump.c
if (!EFI_ERROR(Status)) {
PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiDmemHandle, (UINT64)SalSystemTable);
}
-@@ -364,22 +364,22 @@
+@@ -364,22 +364,22 @@ DumpSystemTable (
Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
if (!EFI_ERROR (Status)) {
@@ -681,29 +4177,50 @@ Index: dmem/efidump.c
}
}
-Index: dmem/debug.h
-===================================================================
---- dmem/debug.h (revision 64)
-+++ dmem/debug.h (working copy)
-@@ -156,3 +156,4 @@
- extern EFI_HII_HANDLE HiiDmemHandle;
+diff --git a/dmpstore/dmpstore.c b/dmpstore/dmpstore.c
+index 747762e..3473d19 100644
+--- a/dmpstore/dmpstore.c
++++ b/dmpstore/dmpstore.c
+@@ -95,7 +95,7 @@ SetFileVariable (
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiDmpstoreGuid = EFI_DMPSTORE_GUID;
+ SHELL_VAR_CHECK_ITEM DmpstoreCheckList[] = {
+ {
+@@ -132,7 +132,7 @@ SHELL_VAR_CHECK_ITEM DmpstoreCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+diff --git a/dmpstore/dmpstore.h b/dmpstore/dmpstore.h
+index 32d72ec..278fb59 100644
+--- a/dmpstore/dmpstore.h
++++ b/dmpstore/dmpstore.h
+@@ -40,3 +40,4 @@ typedef struct {
+ } DMPSTORE_VARIABLE;
#endif
+
-Index: dmem/dmem.inf
-===================================================================
---- dmem/dmem.inf (revision 64)
-+++ dmem/dmem.inf (working copy)
-@@ -25,7 +25,7 @@
+diff --git a/dmpstore/dmpstore.inf b/dmpstore/dmpstore.inf
+index f380759..4a5563d 100644
+--- a/dmpstore/dmpstore.inf
++++ b/dmpstore/dmpstore.inf
+@@ -25,24 +25,24 @@ FILE_GUID = 7185D15A-A0AE-4dd1-A58F-C6EAD28EC9A8
COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- MemStrings.uni
- DebugStrings.uni
- mem.c
-@@ -34,17 +34,17 @@
+ DmpstoreStrings.uni
+ dmpstore.c
+ dmpstore.h
[includes.common]
.
@@ -732,20 +4249,38 @@ Index: dmem/dmem.inf
[libraries.common]
EfiShellLib
-Index: devices/devices.c
-===================================================================
---- devices/devices.c (revision 64)
-+++ devices/devices.c (working copy)
-@@ -36,7 +36,7 @@
+@@ -61,11 +61,14 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeDumpStore
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
+-
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+
+\ No newline at end of file
+diff --git a/drivers/drivers.c b/drivers/drivers.c
+index 0c6cfc0..84271b9 100644
+--- a/drivers/drivers.c
++++ b/drivers/drivers.c
+@@ -43,7 +43,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
// Global Variables
//
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDevicesGuid = EFI_DEVICES_GUID;
- SHELL_VAR_CHECK_ITEM DevicesCheckList[] = {
+ EFI_GUID EfiDriversGuid = EFI_DRIVERS_GUID;
+ SHELL_VAR_CHECK_ITEM DriversCheckList[] = {
{
-@@ -61,7 +61,7 @@
+@@ -68,7 +68,7 @@ SHELL_VAR_CHECK_ITEM DriversCheckList[] = {
NULL,
0,
0,
@@ -754,28 +4289,46 @@ Index: devices/devices.c
}
};
-Index: devices/devices.h
-===================================================================
---- devices/devices.h (revision 64)
-+++ devices/devices.h (working copy)
-@@ -32,3 +32,4 @@
- 0x6fabed98, 0x2a7, 0x46a4, 0x84, 0xd1, 0x76, 0xcd, 0x5c, 0x49, 0x78, 0x74 \
+@@ -133,7 +133,6 @@ Returns:
+ EFI_HANDLE *ControllerHandleBuffer;
+ UINTN ChildControllerHandleCount;
+ CHAR16 *ImageName;
+- BOOLEAN IsHelp;
+ SHELL_VAR_CHECK_CODE RetCode;
+ CHAR16 *Useful;
+ SHELL_ARG_LIST *Item;
+@@ -143,7 +142,6 @@ Returns:
+ Language = NULL;
+ DriverImageHandleCount = 0;
+ DriverImageHandleBuffer = NULL;
+- IsHelp = FALSE;
+ ZeroMem (&ChkPck, sizeof (SHELL_VAR_CHECK_PACKAGE));
+
+ EFI_SHELL_APP_INIT (ImageHandle, SystemTable);
+diff --git a/drivers/drivers.h b/drivers/drivers.h
+index 6ef5e12..7c29cb0 100644
+--- a/drivers/drivers.h
++++ b/drivers/drivers.h
+@@ -33,3 +33,4 @@ Revision History
}
+
#endif
+
-Index: devices/devices.inf
-===================================================================
---- devices/devices.inf (revision 64)
-+++ devices/devices.inf (working copy)
-@@ -41,23 +41,23 @@
+diff --git a/drivers/drivers.inf b/drivers/drivers.inf
+index befa6cd..056bf90 100644
+--- a/drivers/drivers.inf
++++ b/drivers/drivers.inf
+@@ -40,7 +40,7 @@ COMPONENT_TYPE = APPLICATION
+
[sources.common]
- DevicesStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- devices.c
- devices.h
-
+ DriversStrings.uni
+ drivers.c
+ drivers.h
+@@ -48,17 +48,17 @@ COMPONENT_TYPE = APPLICATION
+
[includes.common]
.
- ..\Inc
@@ -803,20 +4356,32 @@ Index: devices/devices.inf
[libraries.common]
EfiShellLib
-Index: mv/mv.c
-===================================================================
---- mv/mv.c (revision 64)
-+++ mv/mv.c (working copy)
-@@ -36,7 +36,7 @@
+@@ -73,7 +73,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DriversMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/drvcfg/drvcfg.c b/drvcfg/drvcfg.c
+index b604432..a037ac6 100644
+--- a/drvcfg/drvcfg.c
++++ b/drvcfg/drvcfg.c
+@@ -38,7 +38,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
// Global Variables
//
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiMvGuid = EFI_MV_GUID;
- SHELL_VAR_CHECK_ITEM MvCheckList[] = {
+ EFI_GUID EfiDrvcfgGuid = EFI_DRVCFG_GUID;
+ SHELL_VAR_CHECK_ITEM DrvcfgCheckList[] = {
{
-@@ -55,7 +55,7 @@
+@@ -87,7 +87,7 @@ SHELL_VAR_CHECK_ITEM DrvcfgCheckList[] = {
NULL,
0,
0,
@@ -825,31 +4390,29 @@ Index: mv/mv.c
}
};
-Index: mv/mv.h
-===================================================================
---- mv/mv.h (revision 64)
-+++ mv/mv.h (working copy)
-@@ -33,4 +33,4 @@
-
- #define EFI_FILE_STRING_SIZE 260
+diff --git a/drvcfg/drvcfg.h b/drvcfg/drvcfg.h
+index 9e14b9f..4255940 100644
+--- a/drvcfg/drvcfg.h
++++ b/drvcfg/drvcfg.h
+@@ -33,3 +33,4 @@ Revision History
+ }
--#endif
-\ No newline at end of file
-+#endif
-Index: mv/mv.inf
-===================================================================
---- mv/mv.inf (revision 64)
-+++ mv/mv.inf (working copy)
-@@ -40,24 +40,24 @@
+ #endif
++
+diff --git a/drvcfg/drvcfg.inf b/drvcfg/drvcfg.inf
+index 71b2778..1abd9f2 100644
+--- a/drvcfg/drvcfg.inf
++++ b/drvcfg/drvcfg.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- MvStrings.uni
- mv.c
- mv.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ DrvcfgStrings.uni
+ drvcfg.c
+ drvcfg.h
+
[includes.common]
.
- ..\Inc
@@ -877,11 +4440,32 @@ Index: mv/mv.inf
[libraries.common]
EfiShellLib
-Index: unload/unload.c
-===================================================================
---- unload/unload.c (revision 64)
-+++ unload/unload.c (working copy)
-@@ -66,7 +66,7 @@
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DrvcfgMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/drvdiag/drvdiag.c b/drvdiag/drvdiag.c
+index 3a9435c..0db01de 100644
+--- a/drvdiag/drvdiag.c
++++ b/drvdiag/drvdiag.c
+@@ -41,7 +41,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiDrvdiagGuid = EFI_DRVDIAG_GUID;
+ SHELL_VAR_CHECK_ITEM DrvdiagCheckList[] = {
+ {
+@@ -90,7 +90,7 @@ SHELL_VAR_CHECK_ITEM DrvdiagCheckList[] = {
NULL,
0,
0,
@@ -890,99 +4474,30 @@ Index: unload/unload.c
}
};
-@@ -110,7 +110,7 @@
- *DriverName = LibDevicePathToStr (Image->FilePath);
- }
- } else {
-- LibGetDriverName(DriverBindingHandle, Language, DriverName);
-+ LibGetDriverName(DriverBindingHandle, (CHAR8*)Language, DriverName);
- }
-
- return EFI_SUCCESS;
-@@ -184,7 +184,7 @@
-
- DevicePath = NULL;
- BestDeviceName = NULL;
-- Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, &DevicePath);
-+ Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath);
-
- Print (L"\n");
- PrintToken (STRING_TOKEN (STR_UNLOAD_CONTROLLER_NAME), HiiUnloadHandle);
-@@ -242,14 +242,14 @@
- Image = FALSE;
- Status = _UnloadGetDriverName (
- DriverBindingHandleBuffer[Index],
-- Language,
-+ (UINT8*)Language,
- FALSE,
- &DriverName
- );
- if (DriverName == NULL) {
- Status = _UnloadGetDriverName (
- DriverBindingHandleBuffer[Index],
-- Language,
-+ (UINT8*)Language,
- TRUE,
- &DriverName
- );
-@@ -436,7 +436,7 @@
-
- Status = _UnloadGetDriverName (
- Handle,
-- Language,
-+ (UINT8*)Language,
- FALSE,
- &DriverName
- );
-@@ -450,7 +450,7 @@
-
- Status = _UnloadGetDriverName (
- Handle,
-- Language,
-+ (UINT8*)Language,
- TRUE,
- &DriverName
- );
-@@ -628,7 +628,7 @@
-
- if (Prot->Handles[Index] == Handle) {
- Dump = Verbose ? Prot->DumpInfo : Prot->DumpToken;
-- Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, &Interface);
-+ Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, (VOID**)&Interface);
- if (!EFI_ERROR (Status)) {
- if (Verbose) {
- for (Index1 = 0; Index1 < ProtocolBufferCount; Index1++) {
-@@ -676,7 +676,7 @@
- goto Done;
- }
-
-- Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], &Interface);
-+ Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], (VOID**)&Interface);
- if (!EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_UNLOAD_TWO_VARS_HG_NEW), HiiUnloadHandle, ProtocolBuffer[Index1], Interface);
- }
-Index: unload/unload.h
-===================================================================
---- unload/unload.h (revision 64)
-+++ unload/unload.h (working copy)
-@@ -36,3 +36,4 @@
+diff --git a/drvdiag/drvdiag.h b/drvdiag/drvdiag.h
+index 53d0478..8e10686 100644
+--- a/drvdiag/drvdiag.h
++++ b/drvdiag/drvdiag.h
+@@ -33,3 +33,4 @@ Revision History
}
#endif
+
-Index: unload/unload.inf
-===================================================================
---- unload/unload.inf (revision 64)
-+++ unload/unload.inf (working copy)
-@@ -39,23 +39,23 @@
- COMPONENT_TYPE = APPLICATION
+diff --git a/drvdiag/drvdiag.inf b/drvdiag/drvdiag.inf
+index f27c238..097b31b 100644
+--- a/drvdiag/drvdiag.inf
++++ b/drvdiag/drvdiag.inf
+@@ -40,7 +40,7 @@ COMPONENT_TYPE = APPLICATION
+
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- UnloadStrings.uni
- unload.c
-
+ DrvdiagStrings.uni
+ drvdiag.c
+ drvdiag.h
+@@ -48,17 +48,17 @@ COMPONENT_TYPE = APPLICATION
+
[includes.common]
.
- ..\Inc
@@ -1010,20 +4525,33 @@ Index: unload/unload.inf
[libraries.common]
EfiShellLib
-Index: mode/mode.inf
-===================================================================
---- mode/mode.inf (revision 64)
-+++ mode/mode.inf (working copy)
-@@ -40,24 +40,24 @@
+@@ -73,7 +73,11 @@ COMPONENT_TYPE = APPLICATION
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DrvdiagMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/edit/edit.inf b/edit/edit.inf
+index 0a48e87..3d69d4b 100644
+--- a/edit/edit.inf
++++ b/edit/edit.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 51A60577-F1F6-444a-A372-244BED272023
+ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- ModeStrings.uni
- mode.c
- mode.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ EditStrings.uni
+ editor.h
+ editortype.h
+@@ -41,17 +41,17 @@ COMPONENT_TYPE = APPLICATION
+
[includes.common]
.
- ..\Inc
@@ -1051,83 +4579,498 @@ Index: mode/mode.inf
[libraries.common]
EfiShellLib
-Index: mode/mode.c
-===================================================================
---- mode/mode.c (revision 64)
-+++ mode/mode.c (working copy)
-@@ -53,7 +53,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+@@ -70,11 +70,13 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeEFIEditor
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
+-
+-
+\ No newline at end of file
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/edit/editor.h b/edit/editor.h
+index c18db6a..f41b5b1 100644
+--- a/edit/editor.h
++++ b/edit/editor.h
+@@ -33,7 +33,7 @@ Abstract:
+ #include "libstatusbar.h"
+ #include "libinputbar.h"
+ #include "libmenubar.h"
+-#include "libmisc.h"
++#include "libMisc.h"
+ //
+ // This is the generated header file which includes whatever needs to be exported (strings + IFR)
+ //
+@@ -43,9 +43,10 @@ extern EFI_EDITOR_GLOBAL_EDITOR MainEditor;
+ extern BOOLEAN EditorFirst;
+ extern BOOLEAN EditorExit;
+
+-extern EFI_HII_HANDLE HiiHandle;
++extern EFI_HII_HANDLE gEditHiiHandle;
+ #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
+ extern EFI_HII_PROTOCOL *Hii;
+ #endif
+
+ #endif // _EFI_EDITOR_H_
++
+diff --git a/edit/editortype.h b/edit/editortype.h
+index 674f120..861b6c1 100644
+--- a/edit/editortype.h
++++ b/edit/editortype.h
+@@ -28,7 +28,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #define EDITOR_NAME L"EFI Editor\0"
+ #define EDITOR_VERSION L"0.99\0"
+
+-#define EFI_EDITOR_LINE_LIST 'eell'
++#define EFI_EDITOR_LINE_LIST EFI_SIGNATURE_32 ('e','e','l','l')
+
+ #define INSERT_MODE_STR L"INS"
+ #define OVERWR_MODE_STR L"OVR"
+@@ -149,8 +149,8 @@ typedef struct _EFI_EDITOR_MENU_ITEM {
+ } EFI_EDITOR_MENU_ITEM;
+
+ typedef struct {
+- UINT32 Foreground : 4;
+- UINT32 Background : 4;
++ UINT8 Foreground : 4;
++ UINT8 Background : 4;
+ } EFI_EDITOR_COLOR_ATTRIBUTES;
+
+ typedef union {
+@@ -223,3 +223,4 @@ typedef struct {
+ } EFI_EDITOR_GLOBAL_EDITOR;
+
+ #endif
++
+diff --git a/edit/libEditor.c b/edit/libEditor.c
+index b39a2f0..7f32ce1 100644
+--- a/edit/libEditor.c
++++ b/edit/libEditor.c
+@@ -123,7 +123,7 @@ MainEditorInit (
+ Status = BS->HandleProtocol (
+ In,
+ &gEfiSimplePointerProtocolGuid,
+- &MainEditor.MouseInterface
++ (VOID**)&MainEditor.MouseInterface
+ );
+ if (EFI_ERROR (Status)) {
+ //
+@@ -146,7 +146,7 @@ MainEditorInit (
+ Status = BS->HandleProtocol (
+ HandleBuffer[Index],
+ &gEfiSimplePointerProtocolGuid,
+- &MainEditor.MouseInterface
++ (VOID**)&MainEditor.MouseInterface
+ );
+ if (!EFI_ERROR (Status)) {
+ break;
+@@ -169,31 +169,31 @@ MainEditorInit (
+ //
+ Status = MainTitleBarInit ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TITLEBAR), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TITLEBAR), gEditHiiHandle);
+ return EFI_LOAD_ERROR;
}
- };
-Index: mode/mode.h
-===================================================================
---- mode/mode.h (revision 64)
-+++ mode/mode.h (working copy)
-@@ -30,3 +30,4 @@
+ Status = MainMenuBarInit ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MAINMENU), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MAINMENU), gEditHiiHandle);
+ return EFI_LOAD_ERROR;
+ }
+
+ Status = MainStatusBarInit ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR), gEditHiiHandle);
+ return EFI_LOAD_ERROR;
+ }
+
+ Status = MainInputBarInit ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR), gEditHiiHandle);
+ return EFI_LOAD_ERROR;
+ }
+
+ Status = FileBufferInit ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER), gEditHiiHandle);
+ return EFI_LOAD_ERROR;
+ }
+ //
+@@ -234,27 +234,27 @@ MainEditorCleanup (
+ //
+ Status = MainTitleBarCleanup ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TILEBAR_CLEANUP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TILEBAR_CLEANUP), gEditHiiHandle);
+ }
+
+ Status = MainMenuBarCleanup ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP), gEditHiiHandle);
+ }
+
+ Status = MainStatusBarCleanup ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP), gEditHiiHandle);
+ }
+
+ Status = MainInputBarCleanup ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP), gEditHiiHandle);
+ }
+
+ Status = FileBufferCleanup ();
+ if (EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), gEditHiiHandle);
+ }
+ //
+ // restore old mode
+diff --git a/edit/libFileBuffer.c b/edit/libFileBuffer.c
+index 1f1e2aa..1be2124 100644
+--- a/edit/libFileBuffer.c
++++ b/edit/libFileBuffer.c
+@@ -196,8 +196,9 @@ FileBufferRestoreMousePosition (
+ // backup the old screen attributes
+ //
+ Orig = MainEditor.ColorAttributes;
+- New.Colors.Foreground = Orig.Colors.Background;
+- New.Colors.Background = Orig.Colors.Foreground;
++ New.Data = 0;
++ New.Colors.Foreground = Orig.Colors.Foreground;
++ New.Colors.Background = Orig.Colors.Background;
+
+ //
+ // clear the old mouse position
+@@ -235,10 +236,14 @@ FileBufferRestoreMousePosition (
+ Value
+ );
+ }
++
+ //
+ // set the new mouse position
+ //
+- Out->SetAttribute (Out, New.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (New.Colors.Background, New.Colors.Foreground)
++ );
+
+ //
+ // clear the old mouse position
+@@ -278,7 +283,10 @@ FileBufferRestoreMousePosition (
+ //
+ // end of HasCharacter
+ //
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
+ }
+ //
+ // end of MouseNeedRefresh
+@@ -768,7 +776,7 @@ Returns:
+ Handle = NULL;
+ FileSize = 0;
+ UnicodeBuffer = NULL;
+- Type = 0;
++ Type = DEFAULT_TYPE;
+
+ //
+ // in this function, when you return error ( except EFI_OUT_OF_RESOURCES )
+@@ -2624,15 +2632,9 @@ FileBufferHome (
+ VOID
+ )
+ {
+- EFI_EDITOR_LINE *Line;
+ UINTN FRow;
+ UINTN FCol;
+
+- //
+- // go to the first column of the line
+- //
+- Line = FileBuffer.CurrentLine;
+-
+ FRow = FileBuffer.FilePosition.Row;
+ FCol = 1;
+
+diff --git a/edit/libInputBar.c b/edit/libInputBar.c
+index 0ec6858..f868ffb 100644
+--- a/edit/libInputBar.c
++++ b/edit/libInputBar.c
+@@ -141,8 +141,6 @@ Returns:
+ UINTN Size;
+ EFI_STATUS Status;
+ BOOLEAN NoDisplay;
+- UINTN Limit;
+- UINTN PromptLen;
+
+ //
+ // variable initialization
+@@ -162,10 +160,14 @@ Returns:
+ // back up the old screen attributes
+ //
+ Orig = MainEditor.ColorAttributes;
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
+
+- Out->SetAttribute (Out, New.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
++ );
+
+ //
+ // clear input bar
+@@ -173,13 +175,7 @@ Returns:
+ EditorClearLine (INPUT_BAR_LOCATION);
+
+ Out->SetCursorPosition (Out, 0, INPUT_BAR_LOCATION - 1);
+- PrintToken (STRING_TOKEN (STR_EDIT_LIBINPUTBAR_MAININPUTBAR), HiiHandle, MainInputBar.Prompt);
+-
+- //
+- // that's the maximum input length that can be displayed on screen
+- //
+- PromptLen = StrLen (MainInputBar.Prompt);
+- Limit = MainEditor.ScreenSize.Column - PromptLen;
++ PrintToken (STRING_TOKEN (STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gEditHiiHandle, MainInputBar.Prompt);
+
+ //
+ // this is a selection prompt, cursor will stay in edit area
+@@ -188,7 +184,10 @@ Returns:
+ if (StrStr (MainInputBar.Prompt, L"Yes/No")) {
+ NoDisplay = TRUE;
+ FileBufferRestorePosition ();
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
+ } else {
+ NoDisplay = FALSE;
}
+@@ -265,7 +264,10 @@ Returns:
+ //
+ // restore screen attributes
+ //
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
+
+ StatusBarNeedRefresh = TRUE;
+
+diff --git a/edit/libMenuBar.c b/edit/libMenuBar.c
+index 32fef4e..5ab13e6 100644
+--- a/edit/libMenuBar.c
++++ b/edit/libMenuBar.c
+@@ -189,7 +189,6 @@ MainMenuBarRefresh (
+ CHAR16 *NameString;
+ CHAR16 *FunctionKeyString;
+ UINTN BufferSize;
+- EFI_STATUS Status;
+
+ //
+ // variable initialization
+@@ -220,9 +219,9 @@ MainMenuBarRefresh (
+ FunctionKeyString = AllocatePool (BufferSize);
+
+ #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
+- Status = Hii->GetString (Hii, HiiHandle, Item->NameToken, FALSE, NULL, &BufferSize, NameString);
++ Hii->GetString (Hii, gEditHiiHandle, Item->NameToken, FALSE, NULL, &BufferSize, NameString);
+ #else
+- Status = LibGetString (HiiHandle, Item->NameToken, NameString, &BufferSize);
++ LibGetString (gEditHiiHandle, Item->NameToken, NameString, &BufferSize);
+ #endif
+
+ Width = max ((StrLen (NameString) + 6), 20);
+@@ -232,9 +231,9 @@ MainMenuBarRefresh (
+ }
+
+ #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
+- Status = Hii->GetString (Hii, HiiHandle, Item->FunctionKeyToken, FALSE, NULL, &BufferSize, FunctionKeyString);
++ Hii->GetString (Hii, gEditHiiHandle, Item->FunctionKeyToken, FALSE, NULL, &BufferSize, FunctionKeyString);
+ #else
+- Status = LibGetString (HiiHandle, Item->FunctionKeyToken, FunctionKeyString, &BufferSize);
++ LibGetString (gEditHiiHandle, Item->FunctionKeyToken, FunctionKeyString, &BufferSize);
+ #endif
+ PrintAt (Col - 1, Row - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
+
+diff --git a/edit/libMisc.h b/edit/libMisc.h
+index b7a438b..38cabf3 100644
+--- a/edit/libMisc.h
++++ b/edit/libMisc.h
+@@ -96,3 +96,4 @@ GetTextY (
+ ) ;
#endif
+
-Index: attrib/attrib.inf
-===================================================================
---- attrib/attrib.inf (revision 64)
-+++ attrib/attrib.inf (working copy)
-@@ -41,24 +41,24 @@
+diff --git a/edit/libStatusBar.c b/edit/libStatusBar.c
+index 1527c6e..88a24c9 100644
+--- a/edit/libStatusBar.c
++++ b/edit/libStatusBar.c
+@@ -157,11 +157,15 @@ Returns:
+ // back up the screen attributes
+ //
+ Orig = MainEditor.ColorAttributes;
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
- [sources.common]
- AttribStrings.uni
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- attrib.c
- attrib.h
-
+ Out->EnableCursor (Out, FALSE);
+- Out->SetAttribute (Out, New.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
++ );
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
+ //
+ // clear status bar
+@@ -191,7 +195,10 @@ Returns:
+ //
+ // restore the old screen attributes
+ //
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
- [libraries.common]
- EfiShellLib
-Index: attrib/attrib.c
-===================================================================
---- attrib/attrib.c (revision 64)
-+++ attrib/attrib.c (working copy)
-@@ -57,7 +57,7 @@
+ //
+ // restore position in edit area
+diff --git a/edit/libTitleBar.c b/edit/libTitleBar.c
+index d5d1ad9..8b432a2 100644
+--- a/edit/libTitleBar.c
++++ b/edit/libTitleBar.c
+@@ -120,10 +120,15 @@ Returns:
+ // backup the old screen attributes
+ //
+ Orig = MainEditor.ColorAttributes;
++
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
+
+- Out->SetAttribute (Out, New.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
++ );
+
+ //
+ // clear the old title bar
+@@ -142,7 +147,10 @@ Returns:
+ );
+
+ if (MainEditor.FileBuffer->FileName == NULL) {
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
+ FileBufferRestorePosition ();
+ return EFI_SUCCESS;
+ }
+@@ -204,7 +212,10 @@ Returns:
+ //
+ // restore the old attribute
+ //
+- Out->SetAttribute (Out, Orig.Data);
++ Out->SetAttribute (
++ Out,
++ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
++ );
+
+ //
+ // restore edit area cursor position
+diff --git a/edit/libeditor.h b/edit/libeditor.h
+index 9c84059..e6a174c 100644
+--- a/edit/libeditor.h
++++ b/edit/libeditor.h
+@@ -52,3 +52,4 @@ MainEditorSetCutLine (
+ );
+
+ #endif
++
+diff --git a/edit/libfilebuffer.h b/edit/libfilebuffer.h
+index d2b519b..79ecd1b 100644
+--- a/edit/libfilebuffer.h
++++ b/edit/libfilebuffer.h
+@@ -209,3 +209,4 @@ EditGetDefaultFileName (
+ );
+
+ #endif
++
+diff --git a/edit/libinputbar.h b/edit/libinputbar.h
+index bdbe9bf..3768306 100644
+--- a/edit/libinputbar.h
++++ b/edit/libinputbar.h
+@@ -44,3 +44,4 @@ MainInputBarSetStringSize (
+ );
+
+ #endif
++
+diff --git a/edit/libmenubar.h b/edit/libmenubar.h
+index 486aa81..27a89d8 100644
+--- a/edit/libmenubar.h
++++ b/edit/libmenubar.h
+@@ -85,3 +85,4 @@ MainCommandGotoLine (
+ );
+
+ #endif
++
+diff --git a/edit/libstatusbar.h b/edit/libstatusbar.h
+index bcc6997..05ccdef 100644
+--- a/edit/libstatusbar.h
++++ b/edit/libstatusbar.h
+@@ -53,3 +53,4 @@ MainStatusBarBackup (
+ );
+
+ #endif
++
+diff --git a/edit/libtitlebar.h b/edit/libtitlebar.h
+index eb7c1a3..3946ca7 100644
+--- a/edit/libtitlebar.h
++++ b/edit/libtitlebar.h
+@@ -46,3 +46,4 @@ MainTitleBarBackup (
+ );
+
+ #endif
++
+diff --git a/edit/main.c b/edit/main.c
+index 9f1c987..a69a1bc 100644
+--- a/edit/main.c
++++ b/edit/main.c
+@@ -34,7 +34,7 @@ EFI_BOOTSHELL_CODE(
//
// Global Variables
//
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiAttribGuid = EFI_ATTRIB_GUID;
- SHELL_VAR_CHECK_ITEM AttribCheckList[] = {
- {
-@@ -124,7 +124,7 @@
+-EFI_HII_HANDLE HiiHandle;
++EFI_HII_HANDLE gEditHiiHandle;
+ #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
+ EFI_HII_PROTOCOL *Hii;
+ #endif
+@@ -56,7 +56,7 @@ SHELL_VAR_CHECK_ITEM EditCheckList[] = {
NULL,
0,
0,
@@ -1136,83 +5079,116 @@ Index: attrib/attrib.c
}
};
-@@ -438,7 +438,7 @@
- //
- Info = Arg->Info;
- if (Add || Remove) {
-- Info->Attribute = Info->Attribute & (~Remove) | Add;
-+ Info->Attribute = (Info->Attribute & (~Remove)) | Add;
- Status = Arg->Handle->SetInfo (
- Arg->Handle,
- &gEfiFileInfoGuid,
-Index: attrib/attrib.h
-===================================================================
---- attrib/attrib.h (revision 64)
-+++ attrib/attrib.h (working copy)
-@@ -29,4 +29,5 @@
- 0xcd691c77, 0xfc45, 0x4d7b, 0xb8, 0x92, 0x92, 0xa, 0x86, 0x2d, 0x67, 0xdc \
+@@ -121,13 +121,13 @@ Returns:
+ //
+ // There should only be one HII protocol
+ //
+- Status = LibLocateProtocol (&gEfiHiiProtocolGuid, &Hii);
++ Status = LibLocateProtocol (&gEfiHiiProtocolGuid, (VOID**)&Hii);
+ if (EFI_ERROR (Status) || NULL == Hii) {
+ return EFI_ABORTED;
}
+ #endif
--#endif
-\ No newline at end of file
-+#endif
-+
-Index: err/err.inf
-===================================================================
---- err/err.inf (revision 64)
-+++ err/err.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
+- Status = LibInitializeStrings (&HiiHandle, STRING_ARRAY_NAME, &EfiEditGuid);
++ Status = LibInitializeStrings (&gEditHiiHandle, STRING_ARRAY_NAME, &EfiEditGuid);
- [sources.common]
--..\ShCommonStrings.uni
-+../ShCommonStrings.uni
- ErrStrings.uni
- err.c
- err.h
-@@ -33,17 +33,17 @@
+ if (EFI_ERROR (Status)) {
+ return Status;
+@@ -137,7 +137,7 @@ Returns:
+ if (VarCheckOk != RetCode) {
+ switch (RetCode) {
+ case VarCheckUnknown:
+- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_UNKNOWN_FLAG), HiiHandle, L"edit", Useful);
++ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_UNKNOWN_FLAG), gEditHiiHandle, L"edit", Useful);
+ break;
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
+ default:
+@@ -161,10 +161,10 @@ Returns:
+ ChkPck.FlagCount > 2 ||
+ (ChkPck.FlagCount == 2 && LibCheckVarGetFlag (&ChkPck, L"-b") == NULL)
+ ) {
+- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), HiiHandle, L"edit");
++ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), gEditHiiHandle, L"edit");
+ Status = EFI_INVALID_PARAMETER;
+ } else {
+- PrintToken (STRING_TOKEN (STR_EDIT_VERBOSE_HELP), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_VERBOSE_HELP), gEditHiiHandle);
+ Status = EFI_SUCCESS;
+ }
- [libraries.common]
- EfiShellLib
-Index: err/DebugMask.h
-===================================================================
---- err/DebugMask.h (revision 64)
-+++ err/DebugMask.h (working copy)
-@@ -67,3 +67,4 @@
+@@ -172,21 +172,21 @@ Returns:
+ }
+
+ if (ChkPck.ValueCount > 1) {
+- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), HiiHandle, L"edit");
++ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), gEditHiiHandle, L"edit");
+ Status = EFI_INVALID_PARAMETER;
+ goto done;
+ }
+
+ if (ChkPck.ValueCount == 1) {
+ if (!IsValidFileName (ChkPck.VarList->VarStr)) {
+- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INVALID_FILE_NAME), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INVALID_FILE_NAME), gEditHiiHandle);
+ Status = EFI_INVALID_PARAMETER;
+ goto done;
+ }
+ }
+
+ if (SI->RedirArgc != 0) {
+- PrintToken (STRING_TOKEN (STR_EDIT_NOREDIRECT), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_NOREDIRECT), gEditHiiHandle);
+ Status = EFI_INVALID_PARAMETER;
+ goto done;
+ }
+@@ -195,7 +195,7 @@ Returns:
+ if (EFI_ERROR (Status)) {
+ Out->ClearScreen (Out);
+ Out->EnableCursor (Out, TRUE);
+- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INIT_FAILED), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INIT_FAILED), gEditHiiHandle);
+ goto done;
+ }
+
+@@ -240,19 +240,19 @@ Returns:
+ //
+ if (Status == EFI_SUCCESS) {
+ } else if (Status == EFI_OUT_OF_RESOURCES) {
+- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), HiiHandle, L"edit");
++ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), gEditHiiHandle, L"edit");
+ } else {
+ if (Buffer != NULL) {
+ if (StrCmp (Buffer, L"") != 0) {
+ //
+ // print out the status string
+ //
+- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_BUFFER), HiiHandle, Buffer);
++ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_BUFFER), gEditHiiHandle, Buffer);
+ } else {
+- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gEditHiiHandle);
+ }
+ } else {
+- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gEditHiiHandle);
+ }
+ }
+
+diff --git a/err/DebugMask.h b/err/DebugMask.h
+index 61136aa..9ce362f 100644
+--- a/err/DebugMask.h
++++ b/err/DebugMask.h
+@@ -67,3 +67,4 @@ typedef struct _EFI_DEBUG_MASK_PROTOCOL {
extern EFI_GUID gEfiDebugMaskProtocolGuid;
#endif
+
-Index: err/err.c
-===================================================================
---- err/err.c (revision 64)
-+++ err/err.c (working copy)
-@@ -35,7 +35,7 @@
+diff --git a/err/err.c b/err/err.c
+index e41a9d6..6062ddb 100644
+--- a/err/err.c
++++ b/err/err.c
+@@ -35,7 +35,7 @@ extern UINTN EFIDebug;
//
// Global Variables
//
@@ -1221,7 +5197,7 @@ Index: err/err.c
EFI_GUID EfiErrGuid = EFI_ERR_GUID;
SHELL_VAR_CHECK_ITEM ErrCheckList[] = {
{
-@@ -60,7 +60,7 @@
+@@ -60,7 +60,7 @@ SHELL_VAR_CHECK_ITEM ErrCheckList[] = {
NULL,
0,
0,
@@ -1230,7 +5206,7 @@ Index: err/err.c
}
};
-@@ -149,7 +149,7 @@
+@@ -149,7 +149,7 @@ _DumpHandleMask (
EFI_DEBUG_MASK_PROTOCOL *dmp;
UINTN Mask;
@@ -1239,7 +5215,7 @@ Index: err/err.c
if (!EFI_ERROR (Status)) {
Status = dmp->GetDebugMask (dmp, &Mask);
if (!EFI_ERROR (Status)) {
-@@ -170,13 +170,11 @@
+@@ -170,13 +170,11 @@ _DumpDriverMask (
UINTN HandleNum;
UINTN Index;
UINTN DrvHandle;
@@ -1253,7 +5229,7 @@ Index: err/err.c
if (NULL != Handle) {
DrvHandle = (UINTN) StrToUIntegerBase (Handle, 16, &Status) - 1;
-@@ -278,7 +276,7 @@
+@@ -278,7 +276,7 @@ _SetDriverMask (
goto Done;
}
@@ -1262,7 +5238,7 @@ Index: err/err.c
if (EFI_ERROR (Status)) {
PrintToken (STRING_TOKEN (STR_ERR_HANDLE_NOT_FOUND), HiiHandle, DrvHandle + 1);
goto Done;
-@@ -336,7 +334,7 @@
+@@ -336,7 +334,7 @@ _SetAllDriverMask (
}
for (Index = 0; Index < BufferSize / sizeof(EFI_HANDLE); Index ++) {
@@ -1271,31 +5247,31 @@ Index: err/err.c
Status = dmp->SetDebugMask (dmp, Msk);
}
-Index: err/err.h
-===================================================================
---- err/err.h (revision 64)
-+++ err/err.h (working copy)
-@@ -29,4 +29,4 @@
+diff --git a/err/err.h b/err/err.h
+index f42e503..133006a 100644
+--- a/err/err.h
++++ b/err/err.h
+@@ -29,4 +29,4 @@ Revision History
0xdaab229b, 0x7883, 0x4f5f, 0xac, 0x6e, 0x15, 0x20, 0xc7, 0xe7, 0x8f, 0xd4 \
}
-#endif
\ No newline at end of file
+#endif
-Index: EfiDecompress/Decompress.inf
-===================================================================
---- EfiDecompress/Decompress.inf (revision 64)
-+++ EfiDecompress/Decompress.inf (working copy)
-@@ -25,7 +25,7 @@
+diff --git a/err/err.inf b/err/err.inf
+index 467e734..3afd967 100644
+--- a/err/err.inf
++++ b/err/err.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 7ED86F56-5558-4d4f-A972-9307909AE9BA
COMPONENT_TYPE = APPLICATION
[sources.common]
-..\ShCommonStrings.uni
+../ShCommonStrings.uni
- DecompressStrings.uni
- decompress.c
- decompress.h
-@@ -33,17 +33,17 @@
+ ErrStrings.uni
+ err.c
+ err.h
+@@ -33,17 +33,17 @@ err.h
[includes.common]
.
@@ -1324,83 +5300,120 @@ Index: EfiDecompress/Decompress.inf
[libraries.common]
EfiShellLib
-Index: EfiDecompress/Decompress.c
-===================================================================
---- EfiDecompress/Decompress.c (revision 64)
-+++ EfiDecompress/Decompress.c (working copy)
-@@ -22,7 +22,7 @@
- --*/
-
- #include "EfiShellLib.h"
--#include "decompress.h"
-+#include "Decompress.h"
-
- extern UINT8 STRING_ARRAY_NAME[];
+@@ -63,11 +63,14 @@ err.h
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeError
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
-@@ -31,7 +31,7 @@
+-
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+
+\ No newline at end of file
+diff --git a/guid/guid.c b/guid/guid.c
+index 7f26e7d..78ec5eb 100644
+--- a/guid/guid.c
++++ b/guid/guid.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
- #include STRING_DEFINES_FILE
-
--#include EFI_PROTOCOL_DEFINITION (decompress)
-+#include EFI_PROTOCOL_DEFINITION (Decompress)
-
- EFI_HII_HANDLE HiiDecompressHandle;
- EFI_GUID EfiDecompressGuid = EFI_DECOMPRESS_GUID;
-@@ -52,7 +52,7 @@
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiGuidGuid = EFI_GUID_GUID;
+ SHELL_VAR_CHECK_ITEM GuidCheckList[] = {
+ {
+@@ -55,7 +55,7 @@ SHELL_VAR_CHECK_ITEM GuidCheckList[] = {
NULL,
0,
0,
- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
++ (SHELL_VAR_CHECK_FLAG_TYPE)0
}
};
-@@ -192,7 +192,7 @@
- //
- //
- //
-- Status = LibLocateProtocol (&gEfiDecompressProtocolGuid, &Decompress);
-+ Status = LibLocateProtocol (&gEfiDecompressProtocolGuid, (VOID**)&Decompress);
- if (EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_DECOMPRESS_PROTOCOL_NOT_FOUND), HiiDecompressHandle, L"efidecompress");
- Status = EFI_UNSUPPORTED;
-Index: EfiDecompress/Decompress.h
-===================================================================
---- EfiDecompress/Decompress.h (revision 64)
-+++ EfiDecompress/Decompress.h (working copy)
-@@ -29,4 +29,4 @@
- 0xe15963a9, 0xa05a, 0x480e, 0x91, 0x49, 0x32, 0xe9, 0x24, 0x5d, 0x98, 0xcb \
+diff --git a/guid/guid.h b/guid/guid.h
+index af7560a..e6cf872 100644
+--- a/guid/guid.h
++++ b/guid/guid.h
+@@ -31,4 +31,4 @@ Revision History
+ 0x425bff44, 0x1cae, 0x4c27, 0x98, 0x2c, 0x25, 0xc8, 0x74, 0x59, 0xdf, 0xd6 \
}
-#endif
\ No newline at end of file
+#endif
-Index: hexedit/libStatusBar.c
-===================================================================
---- hexedit/libStatusBar.c (revision 64)
-+++ hexedit/libStatusBar.c (working copy)
-@@ -173,6 +173,7 @@
- // back up the screen attributes
- //
- Orig = HMainEditor.ColorAttributes;
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
-Index: hexedit/libtitlebar.h
-===================================================================
---- hexedit/libtitlebar.h (revision 64)
-+++ hexedit/libtitlebar.h (working copy)
-@@ -46,3 +46,4 @@
- );
-
- #endif
+diff --git a/guid/guid.inf b/guid/guid.inf
+index 60639d2..621fab4 100644
+--- a/guid/guid.inf
++++ b/guid/guid.inf
+@@ -37,23 +37,23 @@
+ FILE_GUID = CBEB01F8-0912-4d87-8A6B-45D02847A405
+ COMPONENT_TYPE = APPLICATION
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ GuidStrings.uni
+ guid.c
+ guid.h
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+ [libraries.common]
+ EfiShellLib
+ EdkProtocolLib
+@@ -63,8 +63,15 @@
+ EdkGuidLib
+ EdkFrameworkGuidLib
+ EfiGuidLib
+
-Index: hexedit/heditor.h
-===================================================================
---- hexedit/heditor.h (revision 64)
-+++ hexedit/heditor.h (working copy)
-@@ -39,7 +39,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=GuidMain
+- C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
++
+\ No newline at end of file
+diff --git a/hexedit/heditor.h b/hexedit/heditor.h
+index 09196d6..74a3160 100644
+--- a/hexedit/heditor.h
++++ b/hexedit/heditor.h
+@@ -39,7 +39,7 @@ Abstract:
#include "libinputbar.h"
#include "libmenubar.h"
@@ -1409,7 +5422,7 @@ Index: hexedit/heditor.h
#include "libclipboard.h"
-@@ -52,9 +52,10 @@
+@@ -52,9 +52,10 @@ extern HEFI_EDITOR_GLOBAL_EDITOR HMainEditor;
extern BOOLEAN HEditorFirst;
extern BOOLEAN HEditorExit;
@@ -1421,11 +5434,100 @@ Index: hexedit/heditor.h
#endif // _HEDITOR_H
+
-Index: hexedit/libBufferImage.c
-===================================================================
---- hexedit/libBufferImage.c (revision 64)
-+++ hexedit/libBufferImage.c (working copy)
-@@ -203,6 +203,9 @@
+diff --git a/hexedit/heditortype.h b/hexedit/heditortype.h
+index 59317a9..d3936d0 100644
+--- a/hexedit/heditortype.h
++++ b/hexedit/heditortype.h
+@@ -30,7 +30,7 @@ Abstract:
+ #define EDITOR_NAME L"EFI Hex Editor\0"
+ #define EDITOR_VERSION L"0.99\0"
+
+-#define EFI_EDITOR_LINE_LIST 'eell'
++#define EFI_EDITOR_LINE_LIST EFI_SIGNATURE_32 ('e','e','l','l')
+
+ #define FILE_ATTRIBUTES EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE
+ #define FILE_READ_WRITE EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE
+@@ -147,8 +147,8 @@ typedef struct _HEFI_EDITOR_MENU_ITEM {
+ } HEFI_EDITOR_MENU_ITEM;
+
+ typedef struct {
+- UINT32 Foreground : 4;
+- UINT32 Background : 4;
++ UINT8 Foreground : 4;
++ UINT8 Background : 4;
+ } HEFI_EDITOR_COLOR_ATTRIBUTES;
+
+ typedef union {
+@@ -251,3 +251,4 @@ typedef struct {
+ } HEFI_EDITOR_GLOBAL_EDITOR;
+
+ #endif
++
+diff --git a/hexedit/hexedit.inf b/hexedit/hexedit.inf
+index cf89b9e..aa44590 100644
+--- a/hexedit/hexedit.inf
++++ b/hexedit/hexedit.inf
+@@ -25,7 +25,7 @@ FILE_GUID = A5A41A42-5B2B-4de6-9556-DDC6DC31231C
+ COMPONENT_TYPE = APPLICATION
+
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ HexeditStrings.uni
+ heditor.h
+ heditortype.h
+@@ -45,17 +45,17 @@ COMPONENT_TYPE = APPLICATION
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
+
+ [libraries.common]
+ EfiShellLib
+@@ -75,11 +75,14 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeEFIHexEditor
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
+-
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+
+\ No newline at end of file
+diff --git a/hexedit/libBufferImage.c b/hexedit/libBufferImage.c
+index 8a91058..2481dd3 100644
+--- a/hexedit/libBufferImage.c
++++ b/hexedit/libBufferImage.c
+@@ -203,6 +203,9 @@ Returns:
case MEM_BUFFER:
HMemImageBackup ();
break;
@@ -1435,7 +5537,7 @@ Index: hexedit/libBufferImage.c
}
return EFI_SUCCESS;
-@@ -587,7 +590,7 @@
+@@ -587,7 +590,7 @@ HBufferImageRestoreMousePosition (
UINT8 Value;
BOOLEAN HighBits;
@@ -1444,7 +5546,7 @@ Index: hexedit/libBufferImage.c
if (HMainEditor.MouseSupported) {
if (HBufferImageMouseNeedRefresh) {
-@@ -610,6 +613,7 @@
+@@ -610,6 +613,7 @@ HBufferImageRestoreMousePosition (
// backup the old screen attributes
//
Orig = HMainEditor.ColorAttributes;
@@ -1452,7 +5554,7 @@ Index: hexedit/libBufferImage.c
New.Colors.Foreground = Orig.Colors.Background;
New.Colors.Background = Orig.Colors.Foreground;
-@@ -801,10 +805,10 @@
+@@ -801,10 +805,10 @@ Returns:
UINTN StartRow;
UINTN EndRow;
UINTN FStartRow;
@@ -1464,7 +5566,7 @@ Index: hexedit/libBufferImage.c
New.Colors.Foreground = Orig.Colors.Background;
New.Colors.Background = Orig.Colors.Foreground;
-@@ -870,7 +874,6 @@
+@@ -870,7 +874,6 @@ Returns:
}
FStartRow = StartRow;
@@ -1472,7 +5574,7 @@ Index: hexedit/libBufferImage.c
StartRow = TEXT_START_ROW + StartRow - HBufferImage.LowVisibleRow;
EndRow = TEXT_START_ROW + EndRow - HBufferImage.LowVisibleRow;
-@@ -980,6 +983,10 @@
+@@ -980,6 +983,10 @@ HBufferImageRead (
case MEM_BUFFER:
Status = HMemImageRead (MemOffset, MemSize, Recover);
break;
@@ -1483,7 +5585,7 @@ Index: hexedit/libBufferImage.c
}
if (EFI_ERROR (Status)) {
-@@ -1030,6 +1037,10 @@
+@@ -1030,6 +1037,10 @@ HBufferImageSave (
case MEM_BUFFER:
Status = HMemImageSave (MemOffset, MemSize);
break;
@@ -1494,7 +5596,7 @@ Index: hexedit/libBufferImage.c
}
if (EFI_ERROR (Status)) {
-@@ -1967,14 +1978,11 @@
+@@ -1967,14 +1978,11 @@ Returns:
--*/
{
@@ -1509,7 +5611,7 @@ Index: hexedit/libBufferImage.c
FRow = HBufferImage.BufferPosition.Row;
FCol = HBufferImage.BufferPosition.Column;
-@@ -1996,7 +2004,7 @@
+@@ -1996,7 +2004,7 @@ Returns:
//
// get correct line
//
@@ -1518,7 +5620,7 @@ Index: hexedit/libBufferImage.c
FRow -= Gap;
-@@ -2025,13 +2033,10 @@
+@@ -2025,13 +2033,10 @@ Returns:
--*/
{
@@ -1532,7 +5634,7 @@ Index: hexedit/libBufferImage.c
//
// curosr will at the high bit
//
-@@ -2157,7 +2162,6 @@
+@@ -2157,7 +2162,6 @@ Returns:
HEFI_EDITOR_LINE *Line;
EFI_LIST_ENTRY *Link;
@@ -1540,7 +5642,7 @@ Index: hexedit/libBufferImage.c
UINTN OldFCol;
UINTN OldFRow;
-@@ -2167,11 +2171,6 @@
+@@ -2167,11 +2171,6 @@ Returns:
EFI_STATUS Status;
@@ -1552,7 +5654,7 @@ Index: hexedit/libBufferImage.c
Size = HBufferImageGetTotalSize ();
if (Size < Count) {
-@@ -2300,7 +2299,6 @@
+@@ -2300,7 +2299,6 @@ Returns:
HEFI_EDITOR_LINE *Line;
EFI_LIST_ENTRY *Link;
@@ -1560,7 +5662,7 @@ Index: hexedit/libBufferImage.c
UINTN OldFCol;
UINTN OldFRow;
-@@ -2308,11 +2306,6 @@
+@@ -2308,11 +2306,6 @@ Returns:
UINTN NewPos;
@@ -1572,145 +5674,11 @@ Index: hexedit/libBufferImage.c
Size = HBufferImageGetTotalSize ();
//
-Index: hexedit/libstatusbar.h
-===================================================================
---- hexedit/libstatusbar.h (revision 64)
-+++ hexedit/libstatusbar.h (working copy)
-@@ -55,3 +55,4 @@
- );
-
- #endif
-+
-Index: hexedit/heditortype.h
-===================================================================
---- hexedit/heditortype.h (revision 64)
-+++ hexedit/heditortype.h (working copy)
-@@ -30,7 +30,7 @@
- #define EDITOR_NAME L"EFI Hex Editor\0"
- #define EDITOR_VERSION L"0.99\0"
-
--#define EFI_EDITOR_LINE_LIST 'eell'
-+#define EFI_EDITOR_LINE_LIST EFI_SIGNATURE_32 ('e','e','l','l')
-
- #define FILE_ATTRIBUTES EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE
- #define FILE_READ_WRITE EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE
-@@ -147,8 +147,8 @@
- } HEFI_EDITOR_MENU_ITEM;
-
- typedef struct {
-- UINT32 Foreground : 4;
-- UINT32 Background : 4;
-+ UINT8 Foreground : 4;
-+ UINT8 Background : 4;
- } HEFI_EDITOR_COLOR_ATTRIBUTES;
-
- typedef union {
-@@ -251,3 +251,4 @@
- } HEFI_EDITOR_GLOBAL_EDITOR;
-
- #endif
-+
-Index: hexedit/libMemImage.c
-===================================================================
---- hexedit/libMemImage.c (revision 64)
-+++ hexedit/libMemImage.c (working copy)
-@@ -91,7 +91,7 @@
- Status = BS->LocateProtocol (
- &gEfiPciRootBridgeIoProtocolGuid,
- NULL,
-- &HMemImage.IoFncs
-+ (VOID**)&HMemImage.IoFncs
- );
- if (Status == EFI_NOT_FOUND) {
- //
-@@ -225,9 +225,6 @@
- CHAR16 *Str;
- HEFI_EDITOR_LINE *Line;
-
-- HEFI_EDITOR_ACTIVE_BUFFER_TYPE BufferTypeBackup;
--
-- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = MEM_BUFFER;
-
- Buffer = AllocatePool (Size);
-@@ -344,8 +341,6 @@
- EFI_STATUS Status;
- VOID *Buffer;
-
-- HEFI_EDITOR_ACTIVE_BUFFER_TYPE BufferTypeBackup;
--
- //
- // not modified, so directly return
- //
-@@ -353,7 +348,6 @@
- return EFI_SUCCESS;
- }
-
-- BufferTypeBackup = HBufferImage.BufferType;
- HBufferImage.BufferType = MEM_BUFFER;
-
- Buffer = AllocatePool (Size);
-Index: hexedit/libbufferimage.h
-===================================================================
---- hexedit/libbufferimage.h (revision 64)
-+++ hexedit/libbufferimage.h (working copy)
-@@ -253,3 +253,4 @@
- );
-
- #endif
-+
-Index: hexedit/libInputBar.c
-===================================================================
---- hexedit/libInputBar.c (revision 64)
-+++ hexedit/libInputBar.c (working copy)
-@@ -169,8 +169,6 @@
- UINTN Size;
- EFI_STATUS Status;
- BOOLEAN NoDisplay;
-- UINTN Limit;
-- UINTN PromptLen;
-
- //
- // variable initialization
-@@ -190,6 +188,7 @@
- // back up the old screen attributes
- //
- Orig = HMainEditor.ColorAttributes;
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
-@@ -201,15 +200,9 @@
- HEditorClearLine (INPUT_BAR_LOCATION);
-
- Out->SetCursorPosition (Out, 0, INPUT_BAR_LOCATION - 1);
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBINPUTBAR_MAININPUTBAR), HiiHandle, HMainInputBar.Prompt);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBINPUTBAR_MAININPUTBAR), gHexEditHiiHandle, HMainInputBar.Prompt);
-
- //
-- // that's the maximum input length that can be displayed on screen
-- //
-- PromptLen = StrLen (HMainInputBar.Prompt);
-- Limit = HMainEditor.ScreenSize.Column - PromptLen;
--
-- //
- // this is a selection prompt, cursor will stay in edit area
- // actually this is for search , search/replace
- //
-Index: hexedit/libmemimage.h
-===================================================================
---- hexedit/libmemimage.h (revision 64)
-+++ hexedit/libmemimage.h (working copy)
-@@ -55,3 +55,4 @@
- );
-
- #endif
-+
-Index: hexedit/libEditor.c
-===================================================================
---- hexedit/libEditor.c (revision 64)
-+++ hexedit/libEditor.c (working copy)
-@@ -20,7 +20,7 @@
+diff --git a/hexedit/libEditor.c b/hexedit/libEditor.c
+index f511020..ac085b7 100644
+--- a/hexedit/libEditor.c
++++ b/hexedit/libEditor.c
+@@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
--*/
@@ -1719,7 +5687,7 @@ Index: hexedit/libEditor.c
HEFI_EDITOR_COLOR_ATTRIBUTES HOriginalColors;
INTN HOriginalMode;
-@@ -136,7 +136,7 @@
+@@ -136,7 +136,7 @@ Returns:
Status = BS->HandleProtocol (
In,
&gEfiSimplePointerProtocolGuid,
@@ -1728,7 +5696,7 @@ Index: hexedit/libEditor.c
);
if (EFI_ERROR (Status)) {
//
-@@ -159,7 +159,7 @@
+@@ -159,7 +159,7 @@ Returns:
Status = BS->HandleProtocol (
HandleBuffer[Index],
&gEfiSimplePointerProtocolGuid,
@@ -1737,7 +5705,7 @@ Index: hexedit/libEditor.c
);
if (!EFI_ERROR (Status)) {
break;
-@@ -182,37 +182,37 @@
+@@ -182,37 +182,37 @@ Returns:
//
Status = HMainTitleBarInit ();
if (EFI_ERROR (Status)) {
@@ -1781,7 +5749,7 @@ Index: hexedit/libEditor.c
return EFI_LOAD_ERROR;
}
//
-@@ -259,32 +259,32 @@
+@@ -259,32 +259,32 @@ Returns:
//
Status = HMainTitleBarCleanup ();
if (EFI_ERROR (Status)) {
@@ -1820,7 +5788,7 @@ Index: hexedit/libEditor.c
}
//
// restore old mode
-@@ -732,6 +732,9 @@
+@@ -732,6 +732,9 @@ Returns:
case MEM_BUFFER:
OldSize = HBufferImage.MemImage->Size;
break;
@@ -1830,29 +5798,87 @@ Index: hexedit/libEditor.c
}
if (LengthChange == FALSE) {
-Index: hexedit/libfileimage.h
-===================================================================
---- hexedit/libfileimage.h (revision 64)
-+++ hexedit/libfileimage.h (working copy)
-@@ -59,3 +59,4 @@
- );
+diff --git a/hexedit/libInputBar.c b/hexedit/libInputBar.c
+index 3a4cc7e..1cb911f 100644
+--- a/hexedit/libInputBar.c
++++ b/hexedit/libInputBar.c
+@@ -169,8 +169,6 @@ Returns:
+ UINTN Size;
+ EFI_STATUS Status;
+ BOOLEAN NoDisplay;
+- UINTN Limit;
+- UINTN PromptLen;
- #endif
-+
-Index: hexedit/libinputbar.h
-===================================================================
---- hexedit/libinputbar.h (revision 64)
-+++ hexedit/libinputbar.h (working copy)
-@@ -44,3 +44,4 @@
- );
+ //
+ // variable initialization
+@@ -190,6 +188,7 @@ Returns:
+ // back up the old screen attributes
+ //
+ Orig = HMainEditor.ColorAttributes;
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
- #endif
-+
-Index: hexedit/libMenuBar.c
-===================================================================
---- hexedit/libMenuBar.c (revision 64)
-+++ hexedit/libMenuBar.c (working copy)
-@@ -222,7 +222,6 @@
+@@ -201,13 +200,7 @@ Returns:
+ HEditorClearLine (INPUT_BAR_LOCATION);
+
+ Out->SetCursorPosition (Out, 0, INPUT_BAR_LOCATION - 1);
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBINPUTBAR_MAININPUTBAR), HiiHandle, HMainInputBar.Prompt);
+-
+- //
+- // that's the maximum input length that can be displayed on screen
+- //
+- PromptLen = StrLen (HMainInputBar.Prompt);
+- Limit = HMainEditor.ScreenSize.Column - PromptLen;
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBINPUTBAR_MAININPUTBAR), gHexEditHiiHandle, HMainInputBar.Prompt);
+
+ //
+ // this is a selection prompt, cursor will stay in edit area
+diff --git a/hexedit/libMemImage.c b/hexedit/libMemImage.c
+index 407bb2e..2fed45b 100644
+--- a/hexedit/libMemImage.c
++++ b/hexedit/libMemImage.c
+@@ -91,7 +91,7 @@ Returns:
+ Status = BS->LocateProtocol (
+ &gEfiPciRootBridgeIoProtocolGuid,
+ NULL,
+- &HMemImage.IoFncs
++ (VOID**)&HMemImage.IoFncs
+ );
+ if (Status == EFI_NOT_FOUND) {
+ //
+@@ -225,9 +225,6 @@ Returns:
+ CHAR16 *Str;
+ HEFI_EDITOR_LINE *Line;
+
+- HEFI_EDITOR_ACTIVE_BUFFER_TYPE BufferTypeBackup;
+-
+- BufferTypeBackup = HBufferImage.BufferType;
+ HBufferImage.BufferType = MEM_BUFFER;
+
+ Buffer = AllocatePool (Size);
+@@ -344,8 +341,6 @@ Returns:
+ EFI_STATUS Status;
+ VOID *Buffer;
+
+- HEFI_EDITOR_ACTIVE_BUFFER_TYPE BufferTypeBackup;
+-
+ //
+ // not modified, so directly return
+ //
+@@ -353,7 +348,6 @@ Returns:
+ return EFI_SUCCESS;
+ }
+
+- BufferTypeBackup = HBufferImage.BufferType;
+ HBufferImage.BufferType = MEM_BUFFER;
+
+ Buffer = AllocatePool (Size);
+diff --git a/hexedit/libMenuBar.c b/hexedit/libMenuBar.c
+index 5ecb694..00bfa99 100644
+--- a/hexedit/libMenuBar.c
++++ b/hexedit/libMenuBar.c
+@@ -222,7 +222,6 @@ Returns:
CHAR16 *NameString;
CHAR16 *FunctionKeyString;
UINTN BufferSize;
@@ -1860,7 +5886,7 @@ Index: hexedit/libMenuBar.c
//
// variable initialization
-@@ -255,9 +254,9 @@
+@@ -255,9 +254,9 @@ Returns:
FunctionKeyString = AllocatePool (BufferSize);
#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
@@ -1872,7 +5898,7 @@ Index: hexedit/libMenuBar.c
#endif
Width = max ((StrLen (NameString) + 6), 18);
-@@ -267,9 +266,9 @@
+@@ -267,9 +266,9 @@ Returns:
}
#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
@@ -1884,7 +5910,7 @@ Index: hexedit/libMenuBar.c
#endif
if (Index >= 10) {
PrintAt (Col - 1, Row - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
-@@ -1138,7 +1137,6 @@
+@@ -1138,7 +1137,6 @@ Returns:
// the file won't be saved
//
return EFI_SUCCESS;
@@ -1892,7 +5918,7 @@ Index: hexedit/libMenuBar.c
case L'c':
case L'C':
-@@ -1567,7 +1565,6 @@
+@@ -1567,7 +1565,6 @@ Returns:
--*/
{
UINTN Index;
@@ -1900,7 +5926,7 @@ Index: hexedit/libMenuBar.c
EFI_LIST_ENTRY *Link;
UINT8 *Buffer;
UINTN Count;
-@@ -1592,8 +1589,6 @@
+@@ -1592,8 +1589,6 @@ Returns:
Link = Link->Flink;
}
@@ -1909,62 +5935,154 @@ Index: hexedit/libMenuBar.c
Count = HMainEditor.SelectEnd - HMainEditor.SelectStart + 1;
Buffer = AllocatePool (Count);
if (Buffer == NULL) {
-Index: hexedit/libeditor.h
-===================================================================
---- hexedit/libeditor.h (revision 64)
-+++ hexedit/libeditor.h (working copy)
-@@ -47,3 +47,4 @@
+diff --git a/hexedit/libMisc.h b/hexedit/libMisc.h
+index 979a7f0..5c2216b 100644
+--- a/hexedit/libMisc.h
++++ b/hexedit/libMisc.h
+@@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #ifndef _LIB_MISC_H_
+ #define _LIB_MISC_H_
+
+-#include "Heditortype.h"
++#include "heditortype.h"
+
+ VOID
+ HEditorClearLine (
+@@ -108,3 +108,4 @@ HXtoi (
);
#endif
+
-Index: hexedit/hexedit.inf
-===================================================================
---- hexedit/hexedit.inf (revision 64)
-+++ hexedit/hexedit.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
+diff --git a/hexedit/libStatusBar.c b/hexedit/libStatusBar.c
+index 59d3d4b..278b3ba 100644
+--- a/hexedit/libStatusBar.c
++++ b/hexedit/libStatusBar.c
+@@ -173,6 +173,7 @@ Returns:
+ // back up the screen attributes
+ //
+ Orig = HMainEditor.ColorAttributes;
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- HexeditStrings.uni
- heditor.h
- heditortype.h
-@@ -45,17 +45,17 @@
+diff --git a/hexedit/libTitleBar.c b/hexedit/libTitleBar.c
+index 9e7b9e9..cf010f5 100644
+--- a/hexedit/libTitleBar.c
++++ b/hexedit/libTitleBar.c
+@@ -166,6 +166,7 @@ Returns:
+ // backup the old screen attributes
+ //
+ Orig = HMainEditor.ColorAttributes;
++ New.Data = 0;
+ New.Colors.Foreground = Orig.Colors.Background;
+ New.Colors.Background = Orig.Colors.Foreground;
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
+@@ -212,7 +213,7 @@ Returns:
+ // the space for file name is 35 characters
+ //
+ if (StrLen (FileNameTmp) <= 35) {
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR), HiiHandle, FileNameTmp);
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR), gHexEditHiiHandle, FileNameTmp);
- [libraries.common]
- EfiShellLib
-Index: hexedit/libdiskimage.c
-===================================================================
---- hexedit/libdiskimage.c (revision 64)
-+++ hexedit/libdiskimage.c (working copy)
-@@ -228,11 +228,7 @@
+ for (Index = StrLen (FileNameTmp); Index < 35; Index++) {
+ Print (L" ");
+@@ -220,7 +221,7 @@ Returns:
+
+ } else {
+ for (Index = 0; Index < 32; Index++) {
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C), HiiHandle, FileNameTmp[Index]);
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C), gHexEditHiiHandle, FileNameTmp[Index]);
+ }
+ //
+ // print "..."
+@@ -234,14 +235,14 @@ Returns:
+ if (StrLen (HMainEditor.BufferImage->DiskImage->Name) <= 9) {
+ PrintToken (
+ STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR),
+- HiiHandle,
++ gHexEditHiiHandle,
+ HMainEditor.BufferImage->DiskImage->Name
+ );
+ } else {
+ for (Index = 0; Index < 6; Index++) {
+ PrintToken (
+ STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C),
+- HiiHandle,
++ gHexEditHiiHandle,
+ HMainEditor.BufferImage->DiskImage->Name[Index]
+ );
+ }
+@@ -253,7 +254,7 @@ Returns:
+
+ PrintToken (
+ STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_TWOVARS),
+- HiiHandle,
++ gHexEditHiiHandle,
+ HMainEditor.BufferImage->DiskImage->Offset,
+ HMainEditor.BufferImage->DiskImage->Offset + HMainEditor.BufferImage->DiskImage->Size - 1
+ );
+@@ -269,7 +270,7 @@ Returns:
+ case MEM_BUFFER:
+ PrintToken (
+ STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_TWOVARS),
+- HiiHandle,
++ gHexEditHiiHandle,
+ HMainEditor.BufferImage->MemImage->Offset,
+ HMainEditor.BufferImage->MemImage->Offset + HMainEditor.BufferImage->MemImage->Size - 1
+ );
+@@ -280,21 +281,26 @@ Returns:
+
+ break;
+
++ default:
++ break;
+ }
+ //
+ // 9 characters
+ //
+ switch (HMainEditor.BufferImage->BufferType) {
+ case FILE_BUFFER:
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_FILE), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_FILE), gHexEditHiiHandle);
+ break;
+
+ case DISK_BUFFER:
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_DISK), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_DISK), gHexEditHiiHandle);
+ break;
+
+ case MEM_BUFFER:
+- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MEM), HiiHandle);
++ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MEM), gHexEditHiiHandle);
++ break;
++
++ default:
+ break;
+ }
+ //
+diff --git a/hexedit/libbufferimage.h b/hexedit/libbufferimage.h
+index 71b48c2..ed8c673 100644
+--- a/hexedit/libbufferimage.h
++++ b/hexedit/libbufferimage.h
+@@ -253,3 +253,4 @@ HBufferImageIsInSelectedArea (
+ );
+
+ #endif
++
+diff --git a/hexedit/libclipboard.h b/hexedit/libclipboard.h
+index 1604fc5..766f089 100644
+--- a/hexedit/libclipboard.h
++++ b/hexedit/libclipboard.h
+@@ -43,3 +43,4 @@ HClipBoardGet (
+ );
+
+ #endif
++
+diff --git a/hexedit/libdiskimage.c b/hexedit/libdiskimage.c
+index 7e11ad0..5b67a76 100644
+--- a/hexedit/libdiskimage.c
++++ b/hexedit/libdiskimage.c
+@@ -228,11 +228,7 @@ Returns:
UINTN Bytes;
HEFI_EDITOR_LINE *Line;
@@ -1976,7 +6094,7 @@ Index: hexedit/libdiskimage.c
HBufferImage.BufferType = DISK_BUFFER;
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ShellGetMap (DeviceName);
-@@ -246,7 +242,7 @@
+@@ -246,7 +242,7 @@ Returns:
Status = LibDevicePathToInterface (
&gEfiBlockIoProtocolGuid,
DevicePath,
@@ -1985,7 +6103,7 @@ Index: hexedit/libdiskimage.c
);
if (EFI_ERROR (Status)) {
HMainStatusBarSetStatusString (L"Read Disk Failed");
-@@ -269,8 +265,6 @@
+@@ -269,8 +265,6 @@ Returns:
return EFI_OUT_OF_RESOURCES;
}
@@ -1994,7 +6112,7 @@ Index: hexedit/libdiskimage.c
//
// read from disk
//
-@@ -405,10 +399,6 @@
+@@ -405,10 +399,6 @@ Returns:
VOID *Buffer;
UINTN Bytes;
@@ -2005,7 +6123,7 @@ Index: hexedit/libdiskimage.c
//
// if not modified, directly return
//
-@@ -416,7 +406,6 @@
+@@ -416,7 +406,6 @@ Returns:
return EFI_SUCCESS;
}
@@ -2013,7 +6131,7 @@ Index: hexedit/libdiskimage.c
HBufferImage.BufferType = DISK_BUFFER;
DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) ShellGetMap (DeviceName);
-@@ -427,7 +416,7 @@
+@@ -427,7 +416,7 @@ Returns:
Status = LibDevicePathToInterface (
&gEfiBlockIoProtocolGuid,
DevicePath,
@@ -2022,7 +6140,7 @@ Index: hexedit/libdiskimage.c
);
if (EFI_ERROR (Status)) {
return Status;
-@@ -448,8 +437,6 @@
+@@ -448,8 +437,6 @@ Returns:
return Status;
}
@@ -2031,11 +6149,92 @@ Index: hexedit/libdiskimage.c
//
// write the buffer to disk
//
-Index: hexedit/main.c
-===================================================================
---- hexedit/main.c (revision 64)
-+++ hexedit/main.c (working copy)
-@@ -27,7 +27,7 @@
+diff --git a/hexedit/libdiskimage.h b/hexedit/libdiskimage.h
+index 505c857..4effe6c 100644
+--- a/hexedit/libdiskimage.h
++++ b/hexedit/libdiskimage.h
+@@ -58,3 +58,4 @@ HDiskImageSave (
+ );
+
+ #endif
++
+diff --git a/hexedit/libeditor.h b/hexedit/libeditor.h
+index 6c2e3d9..573eca6 100644
+--- a/hexedit/libeditor.h
++++ b/hexedit/libeditor.h
+@@ -47,3 +47,4 @@ HMainEditorBackup (
+ );
+
+ #endif
++
+diff --git a/hexedit/libfileimage.h b/hexedit/libfileimage.h
+index baff90c..5ae42b3 100644
+--- a/hexedit/libfileimage.h
++++ b/hexedit/libfileimage.h
+@@ -59,3 +59,4 @@ HFileImageSave (
+ );
+
+ #endif
++
+diff --git a/hexedit/libinputbar.h b/hexedit/libinputbar.h
+index 24a8973..f7f14ca 100644
+--- a/hexedit/libinputbar.h
++++ b/hexedit/libinputbar.h
+@@ -44,3 +44,4 @@ HMainInputBarSetStringSize (
+ );
+
+ #endif
++
+diff --git a/hexedit/libmemimage.h b/hexedit/libmemimage.h
+index 98c0c08..7cae8b7 100644
+--- a/hexedit/libmemimage.h
++++ b/hexedit/libmemimage.h
+@@ -55,3 +55,4 @@ HMemImageSave (
+ );
+
+ #endif
++
+diff --git a/hexedit/libmenubar.h b/hexedit/libmenubar.h
+index e3766e2..2ee2033 100644
+--- a/hexedit/libmenubar.h
++++ b/hexedit/libmenubar.h
+@@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ #ifndef _LIB_MENU_BAR_H_
+ #define _LIB_MENU_BAR_H_
+
+-#include "Heditortype.h"
++#include "heditortype.h"
+
+ EFI_STATUS
+ HMainMenuBarInit (
+@@ -94,3 +94,4 @@ HMainCommandExit (
+ );
+
+ #endif
++
+diff --git a/hexedit/libstatusbar.h b/hexedit/libstatusbar.h
+index eade183..6ee05a3 100644
+--- a/hexedit/libstatusbar.h
++++ b/hexedit/libstatusbar.h
+@@ -55,3 +55,4 @@ HMainStatusBarBackup (
+ );
+
+ #endif
++
+diff --git a/hexedit/libtitlebar.h b/hexedit/libtitlebar.h
+index b6045ab..948cd43 100644
+--- a/hexedit/libtitlebar.h
++++ b/hexedit/libtitlebar.h
+@@ -46,3 +46,4 @@ HMainTitleBarBackup (
+ );
+
+ #endif
++
+diff --git a/hexedit/main.c b/hexedit/main.c
+index 9c2a032..43340d8 100644
+--- a/hexedit/main.c
++++ b/hexedit/main.c
+@@ -27,7 +27,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
// Global Variables
//
@@ -2044,7 +6243,7 @@ Index: hexedit/main.c
#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
EFI_HII_PROTOCOL *Hii;
#endif
-@@ -67,7 +67,7 @@
+@@ -67,7 +67,7 @@ SHELL_VAR_CHECK_ITEM HexeditCheckList[] = {
NULL,
0,
0,
@@ -2053,7 +6252,7 @@ Index: hexedit/main.c
}
};
-@@ -93,10 +93,10 @@
+@@ -93,10 +93,10 @@ PrintUsage (
VOID
)
{
@@ -2068,7 +6267,7 @@ Index: hexedit/main.c
Print (L"\n\n");
}
-@@ -147,7 +147,7 @@
+@@ -147,7 +147,7 @@ Returns:
EFI_SHELL_APP_INIT (ImageHandle, SystemTable);
#if (EFI_SPECIFICATION_VERSION < 0x0002000A)
@@ -2077,7 +6276,7 @@ Index: hexedit/main.c
if (EFI_ERROR (Status)) {
return Status;
}
-@@ -158,12 +158,12 @@
+@@ -158,12 +158,12 @@ Returns:
// Register our string package with HII and return the handle to it.
// If previously registered we will simply receive the handle
//
@@ -2092,7 +6291,7 @@ Index: hexedit/main.c
L"hexedit",
EFI_VERSION_1_10
);
-@@ -187,17 +187,17 @@
+@@ -187,17 +187,17 @@ Returns:
switch (RetCode) {
case VarCheckConflict:
@@ -2113,7 +6312,7 @@ Index: hexedit/main.c
break;
default:
-@@ -220,10 +220,10 @@
+@@ -220,10 +220,10 @@ Returns:
ChkPck.FlagCount > 2 ||
(ChkPck.FlagCount == 2 && LibCheckVarGetFlag (&ChkPck, L"-b") == NULL)
) {
@@ -2126,7 +6325,7 @@ Index: hexedit/main.c
Status = EFI_SUCCESS;
}
-@@ -233,13 +233,13 @@
+@@ -233,13 +233,13 @@ Returns:
Item = LibCheckVarGetFlag (&ChkPck, L"-d");
if (Item) {
if (3 < ChkPck.ValueCount) {
@@ -2142,7 +6341,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -249,7 +249,7 @@
+@@ -249,7 +249,7 @@ Returns:
Item = Item->Next;
Result = HXtoi (Item->VarStr, &Offset);
if (EFI_ERROR (Result)) {
@@ -2151,7 +6350,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -257,13 +257,13 @@
+@@ -257,13 +257,13 @@ Returns:
Item = Item->Next;
Result = HXtoi (Item->VarStr, &Size);
if (EFI_ERROR (Result)) {
@@ -2167,7 +6366,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -274,13 +274,13 @@
+@@ -274,13 +274,13 @@ Returns:
Item = LibCheckVarGetFlag (&ChkPck, L"-m");
if (Item) {
if (2 < ChkPck.ValueCount) {
@@ -2183,7 +6382,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -288,7 +288,7 @@
+@@ -288,7 +288,7 @@ Returns:
Item = ChkPck.VarList;
Result = HXtoi (Item->VarStr, &Offset);
if (EFI_ERROR (Result)) {
@@ -2192,7 +6391,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -296,20 +296,20 @@
+@@ -296,20 +296,20 @@ Returns:
Item = Item->Next;
Result = HXtoi (Item->VarStr, &Size);
if (EFI_ERROR (Result)) {
@@ -2216,7 +6415,7 @@ Index: hexedit/main.c
goto done;
}
-@@ -319,13 +319,13 @@
+@@ -319,13 +319,13 @@ Returns:
Item = LibCheckVarGetFlag (&ChkPck, L"-f");
if (Item) {
if (1 < ChkPck.ValueCount) {
@@ -2232,7 +6431,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -333,7 +333,7 @@
+@@ -333,7 +333,7 @@ Returns:
Item = ChkPck.VarList;
Name = Item->VarStr;
if (!HIsValidFileName (Name)) {
@@ -2241,7 +6440,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -345,20 +345,20 @@
+@@ -345,20 +345,20 @@ Returns:
if (Name != NULL) {
FreeName = TRUE;
} else {
@@ -2265,7 +6464,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -367,7 +367,7 @@
+@@ -367,7 +367,7 @@ Returns:
}
if (SI->RedirArgc != 0) {
@@ -2274,7 +6473,7 @@ Index: hexedit/main.c
Status = EFI_INVALID_PARAMETER;
goto done;
}
-@@ -376,7 +376,7 @@
+@@ -376,7 +376,7 @@ Returns:
if (EFI_ERROR (Status)) {
Out->ClearScreen (Out);
Out->EnableCursor (Out, TRUE);
@@ -2283,7 +6482,7 @@ Index: hexedit/main.c
goto done;
}
-@@ -421,7 +421,9 @@
+@@ -421,7 +421,9 @@ Returns:
FALSE
);
break;
@@ -2294,7 +6493,7 @@ Index: hexedit/main.c
}
if (!EFI_ERROR (Status)) {
-@@ -453,19 +455,19 @@
+@@ -453,19 +455,19 @@ Returns:
//
if (Status == EFI_SUCCESS) {
} else if (Status == EFI_OUT_OF_RESOURCES) {
@@ -2318,237 +6517,112 @@ Index: hexedit/main.c
}
}
-Index: hexedit/libmenubar.h
-===================================================================
---- hexedit/libmenubar.h (revision 64)
-+++ hexedit/libmenubar.h (working copy)
-@@ -20,7 +20,7 @@
- #ifndef _LIB_MENU_BAR_H_
- #define _LIB_MENU_BAR_H_
-
--#include "Heditortype.h"
-+#include "heditortype.h"
-
- EFI_STATUS
- HMainMenuBarInit (
-@@ -94,3 +94,4 @@
- );
-
+diff --git a/inc/shellenv.h b/inc/shellenv.h
+index 1334f2c..10b28c9 100644
+--- a/inc/shellenv.h
++++ b/inc/shellenv.h
+@@ -492,3 +492,4 @@ UnInstallShellEnvironment (
#endif
-+
-Index: hexedit/libMisc.h
-===================================================================
---- hexedit/libMisc.h (revision 64)
-+++ hexedit/libMisc.h (working copy)
-@@ -20,7 +20,7 @@
- #ifndef _LIB_MISC_H_
- #define _LIB_MISC_H_
--#include "Heditortype.h"
-+#include "heditortype.h"
-
- VOID
- HEditorClearLine (
-@@ -108,3 +108,4 @@
- );
-
- #endif
+ #endif // _SHELLENV_H_
+
-Index: hexedit/libdiskimage.h
-===================================================================
---- hexedit/libdiskimage.h (revision 64)
-+++ hexedit/libdiskimage.h (working copy)
-@@ -58,3 +58,4 @@
- );
+diff --git a/inc/shelltypes.h b/inc/shelltypes.h
+index 1b6cc38..36de6c7 100644
+--- a/inc/shelltypes.h
++++ b/inc/shelltypes.h
+@@ -36,7 +36,7 @@ extern "C"
+ #endif
+ #include "Tiano.h"
+-#include "linkedlist.h"
++#include "LinkedList.h"
+
+ #include EFI_PROTOCOL_DEFINITION (FileInfo)
+ #include EFI_PROTOCOL_DEFINITION (SimpleFileSystem)
+@@ -183,3 +183,4 @@ typedef struct {
#endif
-+
-Index: hexedit/libclipboard.h
-===================================================================
---- hexedit/libclipboard.h (revision 64)
-+++ hexedit/libclipboard.h (working copy)
-@@ -43,3 +43,4 @@
- );
#endif
+
-Index: hexedit/libTitleBar.c
-===================================================================
---- hexedit/libTitleBar.c (revision 64)
-+++ hexedit/libTitleBar.c (working copy)
-@@ -166,6 +166,7 @@
- // backup the old screen attributes
- //
- Orig = HMainEditor.ColorAttributes;
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
-@@ -212,7 +213,7 @@
- // the space for file name is 35 characters
- //
- if (StrLen (FileNameTmp) <= 35) {
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR), HiiHandle, FileNameTmp);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR), gHexEditHiiHandle, FileNameTmp);
-
- for (Index = StrLen (FileNameTmp); Index < 35; Index++) {
- Print (L" ");
-@@ -220,7 +221,7 @@
-
- } else {
- for (Index = 0; Index < 32; Index++) {
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C), HiiHandle, FileNameTmp[Index]);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C), gHexEditHiiHandle, FileNameTmp[Index]);
- }
- //
- // print "..."
-@@ -234,14 +235,14 @@
- if (StrLen (HMainEditor.BufferImage->DiskImage->Name) <= 9) {
- PrintToken (
- STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR),
-- HiiHandle,
-+ gHexEditHiiHandle,
- HMainEditor.BufferImage->DiskImage->Name
- );
- } else {
- for (Index = 0; Index < 6; Index++) {
- PrintToken (
- STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_C),
-- HiiHandle,
-+ gHexEditHiiHandle,
- HMainEditor.BufferImage->DiskImage->Name[Index]
- );
- }
-@@ -253,7 +254,7 @@
-
- PrintToken (
- STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_TWOVARS),
-- HiiHandle,
-+ gHexEditHiiHandle,
- HMainEditor.BufferImage->DiskImage->Offset,
- HMainEditor.BufferImage->DiskImage->Offset + HMainEditor.BufferImage->DiskImage->Size - 1
- );
-@@ -269,7 +270,7 @@
- case MEM_BUFFER:
- PrintToken (
- STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MAINEDITOR_TWOVARS),
-- HiiHandle,
-+ gHexEditHiiHandle,
- HMainEditor.BufferImage->MemImage->Offset,
- HMainEditor.BufferImage->MemImage->Offset + HMainEditor.BufferImage->MemImage->Size - 1
- );
-@@ -280,22 +281,27 @@
-
- break;
-
-+ default:
-+ break;
+diff --git a/load/load.c b/load/load.c
+index 44247cc..b268c58 100644
+--- a/load/load.c
++++ b/load/load.c
+@@ -60,7 +60,7 @@ SHELL_VAR_CHECK_ITEM LoadCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
}
- //
- // 9 characters
- //
- switch (HMainEditor.BufferImage->BufferType) {
- case FILE_BUFFER:
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_FILE), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_FILE), gHexEditHiiHandle);
- break;
-
- case DISK_BUFFER:
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_DISK), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_DISK), gHexEditHiiHandle);
- break;
+ };
- case MEM_BUFFER:
-- PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MEM), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_HEXEDIT_LIBTITLEBAR_MEM), gHexEditHiiHandle);
- break;
-+
-+ default:
-+ break;
+diff --git a/load/load.h b/load/load.h
+index 477c816..746aa89 100644
+--- a/load/load.h
++++ b/load/load.h
+@@ -33,3 +33,4 @@ Revision History
}
- //
- // print modified field
-Index: Ping/Ping.h
-===================================================================
---- Ping/Ping.h (revision 64)
-+++ Ping/Ping.h (working copy)
-@@ -78,3 +78,4 @@
- } ICMP_TX_INFO;
#endif
+
-Index: Ping/Ping.inf
-===================================================================
---- Ping/Ping.inf (revision 64)
-+++ Ping/Ping.inf (working copy)
-@@ -25,24 +25,24 @@
+diff --git a/load/load.inf b/load/load.inf
+index 3ba1dbf..6d1785d 100644
+--- a/load/load.inf
++++ b/load/load.inf
+@@ -39,23 +39,23 @@ FILE_GUID = 5B93B225-2E47-4a61-8EE5-B8EA42EE3EA8
COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- PingStrings.uni
- Ping.h
- Ping.c
-
+ LoadStrings.uni
+ load.c
+
[includes.common]
+ .
- ..\Inc
- ..\Library
-- $(EDK_SOURCE)\Foundation\Efi
- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Efi\Include
- $(EDK_SOURCE)\Foundation\Include
- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
- $(EDK_SOURCE)\Foundation\FrameWork
- $(EDK_SOURCE)\Foundation\FrameWork\Include
- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
- $(DEST_DIR)\
+ ../Inc
+ ../Library
-+ $(EDK_SOURCE)/Foundation/Efi
+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Efi/Include
+ $(EDK_SOURCE)/Foundation/Include
+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
+ $(EDK_SOURCE)/Foundation/FrameWork
+ $(EDK_SOURCE)/Foundation/FrameWork/Include
+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
+ $(DEST_DIR./
[libraries.common]
EfiShellLib
-@@ -52,7 +52,6 @@
- ArchProtocolLib
- EdkGuidLib
- EdkFrameworkGuidLib
-- EfiDriverLib
-
- [libraries.Ia32]
- CpuIA32Lib
-Index: Ping/Ping.c
-===================================================================
---- Ping/Ping.c (revision 64)
-+++ Ping/Ping.c (working copy)
-@@ -20,14 +20,14 @@
- --*/
-
- #include "EfiShellLib.h"
--#include "CpuFuncs.h"
-+//#include "CpuFuncs.h"
- #include EFI_ARCH_PROTOCOL_DEFINITION (Cpu)
- #include EFI_PROTOCOL_DEFINITION (Ip4)
- #include "Ping.h"
- #include STRING_DEFINES_FILE
- extern UINT8 STRING_ARRAY_NAME[];
+@@ -70,6 +70,11 @@ COMPONENT_TYPE = APPLICATION
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
-
- EFI_GUID EfiPingGuid = EFI_PING_GUID;
- SHELL_VAR_CHECK_ITEM PingCheckList[] = {
-@@ -59,7 +59,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeLoad
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/ls/ls.c b/ls/ls.c
+index bfb4f9c..0d731d7 100644
+--- a/ls/ls.c
++++ b/ls/ls.c
+@@ -59,7 +59,7 @@ SHELL_VAR_CHECK_ITEM LsCheckList[] = {
NULL,
0,
0,
@@ -2557,106 +6631,82 @@ Index: Ping/Ping.c
}
};
-@@ -114,6 +114,8 @@
- UINT32 RttMin;
- UINT32 RttMax;
-
-+EFI_CPU_ARCH_PROTOCOL *gCpu = NULL;
-+
- STATIC
- UINT64
- GetTimerValue (
-@@ -135,7 +137,22 @@
-
- --*/
+@@ -199,7 +199,6 @@ Returns:
+ CHAR16 *PtrTwo;
+ CHAR16 *Path;
+ EFI_LIST_ENTRY DirList;
+- EFI_LIST_ENTRY *Link;
+ SHELL_FILE_ARG *Arg;
+ BOOLEAN WildcardsEncountered;
+ CHAR16 *Pattern;
+@@ -210,7 +209,6 @@ Returns:
+ Argv = SI->Argv;
+ PtrTwo = NULL;
+ InitializeListHead (&DirList);
+- Link = NULL;
+ Arg = NULL;
+ Pattern = NULL;
+ Status = EFI_SUCCESS;
+@@ -815,8 +813,6 @@ GetPattern (
+ CHAR16 *Path
+ )
{
-- return EfiReadTsc ();
-+ static UINT64 CurrentTick = 0;
-+ UINT64 TimerPeriod;
-+ EFI_STATUS Status;
-+
-+ ASSERT (gCpu != NULL);
-+
-+ Status = gCpu->GetTimerValue (gCpu, 0, &CurrentTick, &TimerPeriod);
-+ if (EFI_ERROR (Status)) {
-+ //
-+ // The WinntGetTimerValue will return EFI_UNSUPPORTED. Set the
-+ // TimerPeriod by ourselves.
-+ //
-+ CurrentTick += 1000000;
-+ }
-+
-+ return CurrentTick;
- }
+-
+- EFI_STATUS Status;
+ CHAR16 *PtrOne;
+ CHAR16 *PtrTwo;
+ UINTN Index1;
+@@ -825,7 +821,6 @@ GetPattern (
+ BOOLEAN LeadingBlanks;
- STATIC
-@@ -168,7 +185,7 @@
- //
- // Locate the Cpu Arch Protocol.
- //
-- Status = BS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, &Cpu);
-+ Status = BS->LocateProtocol (&gEfiCpuArchProtocolGuid, NULL, (VOID**)&Cpu);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-Index: time/time.c
-===================================================================
---- time/time.c (revision 64)
-+++ time/time.c (working copy)
-@@ -49,7 +49,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+ LeadingBlanks = TRUE;
+- Status = EFI_SUCCESS;
-@@ -64,8 +64,8 @@
- BOOLEAN
- GetNumber (
- IN CHAR16 *Str,
-- IN OUT INTN *Offset,
-- IN OUT INTN *number,
-+ IN OUT UINTN *Offset,
-+ IN OUT UINTN *number,
- IN BOOLEAN GetSecond
- );
+ for (PtrOne = PtrTwo = Path; PtrOne < Path + StrLen (Path); PtrOne++) {
+ if ((*PtrOne) == ' ' && LeadingBlanks) {
+@@ -917,14 +912,14 @@ IsMatch (
-@@ -296,8 +296,8 @@
- BOOLEAN
- GetNumber (
- IN CHAR16 *Str,
-- IN OUT INTN *Offset,
-- IN OUT INTN *Number,
-+ IN OUT UINTN *Offset,
-+ IN OUT UINTN *Number,
- IN BOOLEAN GetSecond
- )
- {
-Index: time/time.h
-===================================================================
---- time/time.h (revision 64)
-+++ time/time.h (working copy)
-@@ -32,3 +32,4 @@
- }
+ if ((IsMatch && mIgnoreAttribute) ||
+ (IsMatch && !mAttributes && !(Info->Attribute & EFI_FILE_HIDDEN) && !(Info->Attribute & EFI_FILE_SYSTEM)) ||
+- IsMatch &&
++ (IsMatch &&
+ mAttributes &&
+ (
+ (mAttribA ? (Info->Attribute & EFI_FILE_ARCHIVE ? TRUE : FALSE) : TRUE) &&
+ (mAttribH ? (Info->Attribute & EFI_FILE_HIDDEN ? TRUE : FALSE) : TRUE) &&
+ (mAttribR ? (Info->Attribute & EFI_FILE_READ_ONLY ? TRUE : FALSE) : TRUE) &&
+ (mAttribS ? (Info->Attribute & EFI_FILE_SYSTEM ? TRUE : FALSE) : TRUE) &&
+- (mAttribD ? (Info->Attribute & EFI_FILE_DIRECTORY ? TRUE : FALSE) : TRUE)
++ (mAttribD ? (Info->Attribute & EFI_FILE_DIRECTORY ? TRUE : FALSE) : TRUE))
+ )
+ ) {
+ IsMatch = TRUE;
+diff --git a/ls/ls.h b/ls/ls.h
+index e967235..f0a5151 100644
+--- a/ls/ls.h
++++ b/ls/ls.h
+@@ -91,4 +91,5 @@ MainProc (
+ IN UINT16 VHlpToken
+ );
- #endif
+-#endif
+\ No newline at end of file
++#endif
+
-Index: time/time.inf
-===================================================================
---- time/time.inf (revision 64)
-+++ time/time.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/ls/ls.inf b/ls/ls.inf
+index 854a5b1..547fce8 100644
+--- a/ls/ls.inf
++++ b/ls/ls.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- TimeStrings.uni
- Time.c
- Time.h
-
+ LsStrings.uni
+ ls.c
+ ls.h
+
[includes.common]
.
- ..\Inc
@@ -2684,20 +6734,23 @@ Index: time/time.inf
[libraries.common]
EfiShellLib
-Index: mount/mount.c
-===================================================================
---- mount/mount.c (revision 64)
-+++ mount/mount.c (working copy)
-@@ -36,7 +36,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiMountGuid = EFI_MOUNT_GUID;
- SHELL_VAR_CHECK_ITEM MountCheckList[] = {
- {
-@@ -55,7 +55,7 @@
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeLS
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mem/MemCommonPart.c b/mem/MemCommonPart.c
+index 54af027..b5ccc17 100644
+--- a/mem/MemCommonPart.c
++++ b/mem/MemCommonPart.c
+@@ -58,7 +58,7 @@ SHELL_VAR_CHECK_ITEM MemCheckList[] = {
NULL,
0,
0,
@@ -2706,28 +6759,165 @@ Index: mount/mount.c
}
};
-Index: mount/mount.h
-===================================================================
---- mount/mount.h (revision 64)
-+++ mount/mount.h (working copy)
-@@ -33,3 +33,4 @@
+@@ -149,7 +149,7 @@ Returns:
+ return EFI_SUCCESS;
+ }
+
+- Address = (AddressStr) ? Xtoi (AddressStr) : (UINT64) SystemTable;
++ Address = (AddressStr) ? Xtoi (AddressStr) : (UINT64)(UINTN) SystemTable;
+ Size = (SizeStr) ? Xtoi (SizeStr) : 512;
+
+ //
+@@ -157,7 +157,7 @@ Returns:
+ //
+ PrintToken (STRING_TOKEN (STR_MEM_MEMORY_ADDR), HiiMemHandle, 2 * sizeof (UINTN), Address, Size);
+ if (MMIo) {
+- Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, &PciRootBridgeIo);
++ Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRootBridgeIo);
+ if (EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiMemHandle, L"mem", L"PciRootBridgeIo");
+ return Status;
+@@ -172,7 +172,7 @@ Returns:
+ return Status;
+ }
+
+- PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer);
++ PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciWidthUint8, Address, Size, Buffer);
+ } else {
+ Buffer = (UINT8 *) (UINTN) Address;
+ }
+@@ -233,7 +233,7 @@ Returns:
+ MMIo = FALSE;
+ AddressStr = NULL;
+ SizeStr = NULL;
+- Address = (UINT64) SystemTable;
++ Address = (UINT64)(UINTN) SystemTable;
+ Size = 512;
+ RetCode = LibCheckVariables (SI, MemCheckList, &ChkPck, &Useful);
+ if (VarCheckOk != RetCode) {
+@@ -312,7 +312,7 @@ Returns:
+ //
+ PrintToken (STRING_TOKEN (STR_MEM_NEW_MEMORY_ADDR), HiiMemHandle, 2 * sizeof (UINTN), Address, Size);
+ if (MMIo) {
+- Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, &PciRootBridgeIo);
++ Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRootBridgeIo);
+ if (EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiMemHandle, L"mem", L"PciRootBridgeIo");
+ return Status;
+@@ -327,7 +327,7 @@ Returns:
+ return Status;
+ }
+
+- PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer);
++ PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciWidthUint8, Address, Size, Buffer);
+ } else {
+ Buffer = (UINT8 *) (UINTN) Address;
}
+diff --git a/mem/MemCommonPart.h b/mem/MemCommonPart.h
+index 3b34908..f1fd015 100644
+--- a/mem/MemCommonPart.h
++++ b/mem/MemCommonPart.h
+@@ -62,4 +62,4 @@ EFIMemStructsPrint (
+ IN EFI_BLOCK_IO_PROTOCOL *BlkIo
+ );
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/mem/debug.h b/mem/debug.h
+index 2b02c89..8db1a9f 100644
+--- a/mem/debug.h
++++ b/mem/debug.h
+@@ -156,3 +156,4 @@ EFIStructsPrint (
+ extern EFI_HII_HANDLE HiiMemHandle;
#endif
+
-Index: mount/mount.inf
-===================================================================
---- mount/mount.inf (revision 64)
-+++ mount/mount.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/mem/efidump.c b/mem/efidump.c
+index d7b22cb..cf5382a 100644
+--- a/mem/efidump.c
++++ b/mem/efidump.c
+@@ -24,7 +24,7 @@ Revision History
+ --*/
+
+ #include "debug.h"
+-#include "Efipart.h"
++#include "EfiPart.h"
+ #include "EfiShellLib.h"
+
+ #include STRING_DEFINES_FILE
+@@ -320,13 +320,11 @@ DumpMemSystemTable (
+ VOID *AcpiTable;
+ VOID *Acpi20Table;
+ VOID *SMBIOSTable;
+- VOID *SalSystemTable;
+ VOID *MpsTable;
+
+ AcpiTable = NULL;
+ Acpi20Table = NULL;
+ SMBIOSTable = NULL;
+- SalSystemTable = NULL;
+ MpsTable = NULL;
+
+ PrintToken (
+@@ -352,11 +350,13 @@ DumpMemSystemTable (
+ PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiMemHandle, LibDevicePathToStr (DevicePath));
+ }
+
+- PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiMemHandle, (UINT64) Tbl.Sys->RuntimeServices);
+- PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiMemHandle, (UINT64) Tbl.Sys->BootServices);
++ PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiMemHandle, (UINT64)(UINTN) Tbl.Sys->RuntimeServices);
++ PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiMemHandle, (UINT64)(UINTN) Tbl.Sys->BootServices);
+
+ EFI64_CODE (
+- Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
++ VOID *SalSystemTable;
++
++ Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
+ if (!EFI_ERROR(Status)) {
+ PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiMemHandle, (UINT64)SalSystemTable);
+ }
+@@ -364,22 +364,22 @@ DumpMemSystemTable (
+
+ Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiMemHandle, (UINT64) AcpiTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiMemHandle, (UINT64)(UINTN) AcpiTable);
+ }
+
+ Status = LibGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Acpi20Table);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiMemHandle, (UINT64) Acpi20Table);
++ PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiMemHandle, (UINT64)(UINTN) Acpi20Table);
+ }
+
+ Status = LibGetSystemConfigurationTable (&gEfiMpsTableGuid, &MpsTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiMemHandle, (UINT64) MpsTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiMemHandle, (UINT64)(UINTN) MpsTable);
+ }
+ Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &SMBIOSTable);
+ if (!EFI_ERROR (Status)) {
+- PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiMemHandle, (UINT64) SMBIOSTable);
++ PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiMemHandle, (UINT64)(UINTN) SMBIOSTable);
+ }
+ }
+
+diff --git a/mem/mem.inf b/mem/mem.inf
+index 0561176..4ba34ad 100644
+--- a/mem/mem.inf
++++ b/mem/mem.inf
+@@ -25,7 +25,7 @@ FILE_GUID = 1B0B8206-74DC-4681-AA0D-039A9699EA56
+ COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- MountStrings.uni
- mount.c
- mount.h
+ MemStrings.uni
+ DebugStrings.uni
+ mm.c
+@@ -34,17 +34,17 @@ COMPONENT_TYPE = APPLICATION
[includes.common]
.
@@ -2756,19 +6946,76 @@ Index: mount/mount.inf
[libraries.common]
EfiShellLib
-Index: mkdir/mkdir.inf
-===================================================================
---- mkdir/mkdir.inf (revision 64)
-+++ mkdir/mkdir.inf (working copy)
-@@ -41,23 +41,23 @@
+@@ -63,9 +63,13 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=DumpMm
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/memmap/memmap.c b/memmap/memmap.c
+index f7353ff..24da6e2 100644
+--- a/memmap/memmap.c
++++ b/memmap/memmap.c
+@@ -35,7 +35,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiMemmapGuid = EFI_MEMMAP_GUID;
+ SHELL_VAR_CHECK_ITEM MemmapCheckList[] = {
+ {
+@@ -54,7 +54,7 @@ SHELL_VAR_CHECK_ITEM MemmapCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- 0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+ }
+ };
+
+@@ -216,7 +216,7 @@ Returns:
+ }
+
+ Bytes = LShiftU64 (Desc->NumberOfPages, 12);
+- Ptr = MemoryTypeStr (Desc->Type);
++ Ptr = MemoryTypeStr ((EFI_MEMORY_TYPE)Desc->Type);
+ PrintToken (
+ STRING_TOKEN (STR_MEMMAP_FIVE_ARGS),
+ HiiHandle,
+diff --git a/memmap/memmap.h b/memmap/memmap.h
+index d9f5d72..e32a0aa 100644
+--- a/memmap/memmap.h
++++ b/memmap/memmap.h
+@@ -33,3 +33,4 @@ Revision History
+ }
+
+ #endif
++
+diff --git a/memmap/memmap.inf b/memmap/memmap.inf
+index 1d68c61..48af15c 100644
+--- a/memmap/memmap.inf
++++ b/memmap/memmap.inf
+@@ -40,7 +40,7 @@ COMPONENT_TYPE = APPLICATION
+
[sources.common]
- MkdirStrings.uni
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- mkdir.c
- mkdir.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ memmapStrings.uni
+ memmap.c
+ memmap.h
+@@ -48,17 +48,17 @@ COMPONENT_TYPE = APPLICATION
+
[includes.common]
.
- ..\Inc
@@ -2796,11 +7043,23 @@ Index: mkdir/mkdir.inf
[libraries.common]
EfiShellLib
-Index: mkdir/mkdir.c
-===================================================================
---- mkdir/mkdir.c (revision 64)
-+++ mkdir/mkdir.c (working copy)
-@@ -49,7 +49,7 @@
+@@ -73,7 +73,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeMemmap
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mkdir/mkdir.c b/mkdir/mkdir.c
+index 79a08ca..5d8c5f5 100644
+--- a/mkdir/mkdir.c
++++ b/mkdir/mkdir.c
+@@ -49,7 +49,7 @@ MkDir (
//
// Global Variables
//
@@ -2809,7 +7068,7 @@ Index: mkdir/mkdir.c
EFI_GUID EfiMkdirGuid = EFI_MKDIR_GUID;
SHELL_VAR_CHECK_ITEM MkdirCheckList[] = {
{
-@@ -68,7 +68,7 @@
+@@ -68,7 +68,7 @@ SHELL_VAR_CHECK_ITEM MkdirCheckList[] = {
NULL,
0,
0,
@@ -2818,11 +7077,11 @@ Index: mkdir/mkdir.c
}
};
-Index: mkdir/mkdir.h
-===================================================================
---- mkdir/mkdir.h (revision 64)
-+++ mkdir/mkdir.h (working copy)
-@@ -29,4 +29,5 @@
+diff --git a/mkdir/mkdir.h b/mkdir/mkdir.h
+index 20f8068..2da2b13 100644
+--- a/mkdir/mkdir.h
++++ b/mkdir/mkdir.h
+@@ -29,4 +29,5 @@ Revision History
0x75ecb57f, 0x4264, 0x49d2, 0x98, 0xe6, 0x39, 0x1a, 0x32, 0x17, 0x9d, 0xf2 \
}
@@ -2830,52 +7089,19 @@ Index: mkdir/mkdir.h
\ No newline at end of file
+#endif
+
-Index: pci/pci.h
-===================================================================
---- pci/pci.h (revision 64)
-+++ pci/pci.h (working copy)
-@@ -30,7 +30,7 @@
- 0x388da6c3, 0x3447, 0x4b1f, 0xa0, 0xba, 0xa9, 0xe8, 0xa2, 0x87, 0xf1, 0x76 \
- }
-
--#include "TIANO.h"
-+#include "Tiano.h"
-
- typedef enum {
- PciDevice,
-@@ -477,3 +477,4 @@
- #pragma pack()
-
- #endif // _PCI_H_
-+
-Index: pci/pci_class.c
-===================================================================
---- pci/pci_class.c (revision 64)
-+++ pci/pci_class.c (working copy)
-@@ -30,7 +30,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
-
- PCI_CLASS_ENTRY gClassStringList[];
-
-Index: pci/pci.inf
-===================================================================
---- pci/pci.inf (revision 64)
-+++ pci/pci.inf (working copy)
-@@ -41,7 +41,7 @@
+diff --git a/mkdir/mkdir.inf b/mkdir/mkdir.inf
+index e49daac..4f98af0 100644
+--- a/mkdir/mkdir.inf
++++ b/mkdir/mkdir.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
- PciStrings.uni
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- pci.c
- pci.h
- pci_class.h
-@@ -49,17 +49,17 @@
-
+ MkdirStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ mkdir.c
+ mkdir.h
+
[includes.common]
.
- ..\Inc
@@ -2903,47 +7129,59 @@ Index: pci/pci.inf
[libraries.common]
EfiShellLib
-Index: pci/pci_class.h
-===================================================================
---- pci/pci_class.h (revision 64)
-+++ pci/pci_class.h (working copy)
-@@ -24,7 +24,7 @@
- #ifndef _PCI_CLASS_H_
- #define _PCI_CLASS_H_
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
--#include "TIANO.h" // for UINT32 etc.
-+#include "Tiano.h" // for UINT32 etc.
- #define PCI_CLASS_STRING_LIMIT 54
- //
- // Printable strings for Pci class code
-@@ -58,3 +58,4 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeMkDir
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mm/mm.c b/mm/mm.c
+index 033849b..cb53465 100644
+--- a/mm/mm.c
++++ b/mm/mm.c
+@@ -49,18 +49,18 @@ DumpIoModify (
+
+ VOID
+ ReadMem (
+- IN EFI_IO_WIDTH Width,
+- IN UINT64 Address,
+- IN UINTN Size,
+- IN VOID *Buffer
++ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
++ IN UINT64 Address,
++ IN UINTN Size,
++ IN VOID *Buffer
);
- #endif // _PCI_CLASS_H_
-+
-Index: pci/pci.c
-===================================================================
---- pci/pci.c (revision 64)
-+++ pci/pci.c (working copy)
-@@ -334,7 +334,7 @@
- {
- 0,
- 0,
-- 0,
-+ (PCIE_CAPREG_FIELD_WIDTH)0,
- NULL,
- PcieExplainTypeMax
- }
-@@ -344,7 +344,7 @@
+ VOID
+ WriteMem (
+- IN EFI_IO_WIDTH Width,
+- IN UINT64 Address,
+- IN UINTN Size,
+- IN VOID *Buffer
++ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
++ IN UINT64 Address,
++ IN UINTN Size,
++ IN VOID *Buffer
+ );
+
+ STATIC
+@@ -73,7 +73,7 @@ GetHex (
+ //
// Global Variables
//
- PCI_CONFIG_SPACE *mConfigSpace;
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiPciGuid = EFI_PCI_GUID;
- SHELL_VAR_CHECK_ITEM PciCheckList[] = {
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiIomodGuid = EFI_IOMOD_GUID;
+ SHELL_VAR_CHECK_ITEM IomodCheckList[] = {
{
-@@ -375,7 +375,7 @@
+@@ -134,7 +134,7 @@ SHELL_VAR_CHECK_ITEM IomodCheckList[] = {
NULL,
0,
0,
@@ -2952,84 +7190,139 @@ Index: pci/pci.c
}
};
-@@ -1034,7 +1034,7 @@
- Status = BS->HandleProtocol (
- Handle,
- &gEfiPciRootBridgeIoProtocolGuid,
-- IoDev
-+ (VOID**)IoDev
- );
+@@ -146,13 +146,13 @@ EFI_BOOTSHELL_CODE(
- if (EFI_ERROR (Status)) {
-@@ -1043,7 +1043,7 @@
- //
- // Call Configuration() to get address space descriptors
- //
-- Status = (*IoDev)->Configuration (*IoDev, Descriptors);
-+ Status = (*IoDev)->Configuration (*IoDev, (VOID**)Descriptors);
- if (Status == EFI_UNSUPPORTED) {
- *Descriptors = NULL;
- return EFI_SUCCESS;
-@@ -1237,7 +1237,7 @@
- PrintToken (STRING_TOKEN (STR_PCI2_SINGLE_FUNCTION), HiiHandle);
- }
+ EFI_STATUS
+ OldShellParserMM (
+- OUT EFI_IO_WIDTH *Width,
+- OUT EFI_ACCESS_TYPE *AccessType,
+- OUT UINT64 *Address,
+- OUT UINT64 *Value,
+- OUT UINTN *Size,
+- OUT BOOLEAN *Interactive,
+- OUT CHAR16 **ValueStr
++ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH *Width,
++ OUT EFI_ACCESS_TYPE *AccessType,
++ OUT UINT64 *Address,
++ OUT UINT64 *Value,
++ OUT UINTN *Size,
++ OUT BOOLEAN *Interactive,
++ OUT CHAR16 **ValueStr
+ );
-- HeaderType = (UINT8) (Common->HeaderType & 0x7f);
-+ HeaderType = (PCI_HEADER_TYPE) (Common->HeaderType & 0x7f);
- switch (HeaderType) {
- case PciDevice:
- PrintToken (STRING_TOKEN (STR_PCI2_PCI_DEVICE), HiiHandle);
-@@ -1300,6 +1300,9 @@
- );
- CapPtr = ConfigSpace->NonCommon.CardBus.CapabilitiesPtr;
- break;
-+
-+ default:
-+ Status = EFI_UNSUPPORTED;
- }
- //
- // If Status bit4 is 1, dump or explain capability structure
-@@ -1956,7 +1959,7 @@
- INDEX_OF (&(CardBus->IoBase0)),
- Io32Bit ? L" 32 bit" : L" 16 bit",
- CardBus->IoBase0 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
-- CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff) | 0x00000003
-+ (CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
+ EFI_STATUS
+@@ -207,12 +207,11 @@ Notes:
+ UINT64 PciEAddress;
+ UINT64 Value;
+ UINT32 SegmentNumber;
+- EFI_IO_WIDTH Width;
++ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width;
+ EFI_ACCESS_TYPE AccessType;
+ UINT64 Buffer;
+ UINTN Index;
+ UINTN Size;
+- CHAR16 *AddressStr;
+ CHAR16 *ValueStr;
+ BOOLEAN Complete;
+ CHAR16 InputStr[80];
+@@ -261,7 +260,7 @@ Notes:
+ if (IS_OLD_SHELL) {
+ Status = OldShellParserMM (&Width, &AccessType, &Address, &Value, &Size, &Interactive, &ValueStr);
+ if (EFI_ERROR (Status)) {
+- if (-1 == Status) {
++ if ((EFI_STATUS)-1 == Status) {
+ PrintToken (STRING_TOKEN (STR_HELPINFO_MM_VERBOSEHELP), HiiHandle);
+ Status = EFI_SUCCESS;
+ }
+@@ -274,7 +273,6 @@ Notes:
+ Width = EfiPciWidthUint8;
+ Size = 1;
+ AccessType = EfiMemory;
+- AddressStr = NULL;
+ ValueStr = NULL;
+ Interactive = TRUE;
- Io32Bit = (BOOLEAN) (CardBus->IoBase1 & PCI_BIT_0);
-@@ -1966,7 +1969,7 @@
- INDEX_OF (&(CardBus->IoBase1)),
- Io32Bit ? L" 32 bit" : L" 16 bit",
- CardBus->IoBase1 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
-- CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff) | 0x00000003
-+ (CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
- );
+@@ -662,10 +660,10 @@ Done:
- //
-Index: memmap/memmap.h
-===================================================================
---- memmap/memmap.h (revision 64)
-+++ memmap/memmap.h (working copy)
-@@ -33,3 +33,4 @@
+ VOID
+ ReadMem (
+- IN EFI_IO_WIDTH Width,
+- IN UINT64 Address,
+- IN UINTN Size,
+- IN VOID *Buffer
++ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
++ IN UINT64 Address,
++ IN UINTN Size,
++ IN VOID *Buffer
+ )
+ {
+ do {
+@@ -694,10 +692,10 @@ ReadMem (
+
+ VOID
+ WriteMem (
+- IN EFI_IO_WIDTH Width,
+- IN UINT64 Address,
+- IN UINTN Size,
+- IN VOID *Buffer
++ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
++ IN UINT64 Address,
++ IN UINTN Size,
++ IN VOID *Buffer
+ )
+ {
+ do {
+@@ -750,7 +748,7 @@ GetHex (
+ }
+
+ if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
+- u = u << 4 | c - (c >= 'A' ? 'A' - 10 : '0');
++ u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
+
+ Find = TRUE;
+ } else {
+@@ -766,13 +764,13 @@ GetHex (
+
+ EFI_STATUS
+ OldShellParserMM (
+- OUT EFI_IO_WIDTH *Width,
+- OUT EFI_ACCESS_TYPE *AccessType,
+- OUT UINT64 *Address,
+- OUT UINT64 *Value,
+- OUT UINTN *Size,
+- OUT BOOLEAN *Interactive,
+- OUT CHAR16 **ValueStr
++ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH *Width,
++ OUT EFI_ACCESS_TYPE *AccessType,
++ OUT UINT64 *Address,
++ OUT UINT64 *Value,
++ OUT UINTN *Size,
++ OUT BOOLEAN *Interactive,
++ OUT CHAR16 **ValueStr
+ )
+ /*++
+
+diff --git a/mm/mm.h b/mm/mm.h
+index 8306f4c..0890e50 100644
+--- a/mm/mm.h
++++ b/mm/mm.h
+@@ -33,3 +33,4 @@ Revision History
}
#endif
+
-Index: memmap/memmap.inf
-===================================================================
---- memmap/memmap.inf (revision 64)
-+++ memmap/memmap.inf (working copy)
-@@ -40,7 +40,7 @@
-
+diff --git a/mm/mm.inf b/mm/mm.inf
+index 4857d9e..97221eb 100644
+--- a/mm/mm.inf
++++ b/mm/mm.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
+ MmStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- memmapStrings.uni
- memmap.c
- memmap.h
-@@ -48,17 +48,17 @@
+ mm.c
+ mm.h
[includes.common]
.
@@ -3058,20 +7351,23 @@ Index: memmap/memmap.inf
[libraries.common]
EfiShellLib
-Index: memmap/memmap.c
-===================================================================
---- memmap/memmap.c (revision 64)
-+++ memmap/memmap.c (working copy)
-@@ -35,7 +35,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiMemmapGuid = EFI_MEMMAP_GUID;
- SHELL_VAR_CHECK_ITEM MemmapCheckList[] = {
- {
-@@ -54,7 +54,7 @@
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=DumpIoModify
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mode/mode.c b/mode/mode.c
+index becf429..e49df84 100644
+--- a/mode/mode.c
++++ b/mode/mode.c
+@@ -53,7 +53,7 @@ SHELL_VAR_CHECK_ITEM ModeCheckList[] = {
NULL,
0,
0,
@@ -3080,37 +7376,29 @@ Index: memmap/memmap.c
}
};
-@@ -216,7 +216,7 @@
- }
-
- Bytes = LShiftU64 (Desc->NumberOfPages, 12);
-- Ptr = MemoryTypeStr (Desc->Type);
-+ Ptr = MemoryTypeStr ((EFI_MEMORY_TYPE)Desc->Type);
- PrintToken (
- STRING_TOKEN (STR_MEMMAP_FIVE_ARGS),
- HiiHandle,
-Index: dblk/dblk.h
-===================================================================
---- dblk/dblk.h (revision 64)
-+++ dblk/dblk.h (working copy)
-@@ -168,3 +168,4 @@
- extern EFI_HII_HANDLE HiiDblkHandle;
+diff --git a/mode/mode.h b/mode/mode.h
+index eadbac1..3c4560b 100644
+--- a/mode/mode.h
++++ b/mode/mode.h
+@@ -30,3 +30,4 @@ Revision History
+ }
#endif
+
-Index: dblk/dblk.inf
-===================================================================
---- dblk/dblk.inf (revision 64)
-+++ dblk/dblk.inf (working copy)
-@@ -26,23 +26,23 @@
+diff --git a/mode/mode.inf b/mode/mode.inf
+index 47e5c80..98ea62e 100644
+--- a/mode/mode.inf
++++ b/mode/mode.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
+
[sources.common]
- DblkStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- dblk.c
- efidump.c
-
+ ModeStrings.uni
+ mode.c
+ mode.h
+
[includes.common]
.
- ..\Inc
@@ -3138,80 +7426,32 @@ Index: dblk/dblk.inf
[libraries.common]
EfiShellLib
-Index: dblk/efidump.c
-===================================================================
---- dblk/efidump.c (revision 64)
-+++ dblk/efidump.c (working copy)
-@@ -24,7 +24,7 @@
- --*/
-
- #include "dblk.h"
--#include "Efipart.h"
-+#include "EfiPart.h"
- #include "EfiShellLib.h"
-
- #include STRING_DEFINES_FILE
-@@ -320,13 +320,11 @@
- VOID *AcpiTable;
- VOID *Acpi20Table;
- VOID *SMBIOSTable;
-- VOID *SalSystemTable;
- VOID *MpsTable;
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
- AcpiTable = NULL;
- Acpi20Table = NULL;
- SMBIOSTable = NULL;
-- SalSystemTable = NULL;
- MpsTable = NULL;
-
- PrintToken (
-@@ -352,10 +350,12 @@
- PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiDblkHandle, LibDevicePathToStr (DevicePath));
- }
-
-- PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiDblkHandle, (UINT64) Tbl.Sys->RuntimeServices);
-- PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiDblkHandle, (UINT64) Tbl.Sys->BootServices);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiDblkHandle, (UINT64)(UINTN) Tbl.Sys->RuntimeServices);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiDblkHandle, (UINT64)(UINTN) Tbl.Sys->BootServices);
-
- EFI64_CODE (
-+ VOID *SalSystemTable;
-+
- Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
- if (!EFI_ERROR(Status)) {
- PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiDblkHandle, (UINT64)SalSystemTable);
-@@ -364,22 +364,22 @@
-
- Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiDblkHandle, (UINT64) AcpiTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiDblkHandle, (UINT64)(UINTN) AcpiTable);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Acpi20Table);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiDblkHandle, (UINT64) Acpi20Table);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiDblkHandle, (UINT64)(UINTN) Acpi20Table);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiMpsTableGuid, &MpsTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiDblkHandle, (UINT64) MpsTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiDblkHandle, (UINT64)(UINTN) MpsTable);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &SMBIOSTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiDblkHandle, (UINT64) SMBIOSTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiDblkHandle, (UINT64)(UINTN) SMBIOSTable);
- }
- }
-
-Index: dblk/dblk.c
-===================================================================
---- dblk/dblk.c (revision 64)
-+++ dblk/dblk.c (working copy)
-@@ -52,7 +52,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeMode
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mount/mount.c b/mount/mount.c
+index fa32b1f..6825511 100644
+--- a/mount/mount.c
++++ b/mount/mount.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiMountGuid = EFI_MOUNT_GUID;
+ SHELL_VAR_CHECK_ITEM MountCheckList[] = {
+ {
+@@ -55,7 +55,7 @@ SHELL_VAR_CHECK_ITEM MountCheckList[] = {
NULL,
0,
0,
@@ -3220,29 +7460,29 @@ Index: dblk/dblk.c
}
};
-Index: date/date.h
-===================================================================
---- date/date.h (revision 64)
-+++ date/date.h (working copy)
-@@ -32,3 +32,4 @@
+diff --git a/mount/mount.h b/mount/mount.h
+index afd795e..ce65e8e 100644
+--- a/mount/mount.h
++++ b/mount/mount.h
+@@ -33,3 +33,4 @@ Revision History
}
#endif
+
-Index: date/date.inf
-===================================================================
---- date/date.inf (revision 64)
-+++ date/date.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/mount/mount.inf b/mount/mount.inf
+index 922c490..e0154e2 100644
+--- a/mount/mount.inf
++++ b/mount/mount.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- DateStrings.uni
- Date.c
- Date.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ MountStrings.uni
+ mount.c
+ mount.h
+
[includes.common]
.
- ..\Inc
@@ -3270,22 +7510,32 @@ Index: date/date.inf
[libraries.common]
EfiShellLib
-Index: date/date.c
-===================================================================
---- date/date.c (revision 64)
-+++ date/date.c (working copy)
-@@ -53,8 +53,8 @@
- BOOLEAN
- GetNumber (
- IN CHAR16 *Str,
-- IN OUT INTN *Position,
-- IN OUT INTN *Number,
-+ IN OUT UINTN *Position,
-+ IN OUT UINTN *Number,
- IN BOOLEAN EndNum
- );
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
-@@ -92,7 +92,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=MountMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/mv/mv.c b/mv/mv.c
+index 3b04021..9eefd23 100644
+--- a/mv/mv.c
++++ b/mv/mv.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiMvGuid = EFI_MV_GUID;
+ SHELL_VAR_CHECK_ITEM MvCheckList[] = {
+ {
+@@ -55,7 +55,7 @@ SHELL_VAR_CHECK_ITEM MvCheckList[] = {
NULL,
0,
0,
@@ -3294,52 +7544,31 @@ Index: date/date.c
}
};
-@@ -330,8 +330,8 @@
- BOOLEAN
- GetNumber (
- IN CHAR16 *Str,
-- IN OUT INTN *Position,
-- IN OUT INTN *Number,
-+ IN OUT UINTN *Position,
-+ IN OUT UINTN *Number,
- IN BOOLEAN EndNum
- )
- {
-Index: rm/rm.c
-===================================================================
---- rm/rm.c (revision 64)
-+++ rm/rm.c (working copy)
-@@ -54,7 +54,7 @@
- NULL,
- 0,
- 0,
-- FALSE
-+ (SHELL_VAR_CHECK_FLAG_TYPE) FALSE
- }
- };
+diff --git a/mv/mv.h b/mv/mv.h
+index 6ed33eb..2dbf314 100644
+--- a/mv/mv.h
++++ b/mv/mv.h
+@@ -33,4 +33,4 @@ Revision History
-Index: rm/rm.h
-===================================================================
---- rm/rm.h (revision 64)
-+++ rm/rm.h (working copy)
-@@ -59,3 +59,4 @@
- );
+ #define EFI_FILE_STRING_SIZE 260
+
+-#endif
+\ No newline at end of file
++#endif
+diff --git a/mv/mv.inf b/mv/mv.inf
+index b52e28d..46000f0 100644
+--- a/mv/mv.inf
++++ b/mv/mv.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
- #endif
-+
-Index: rm/rm.inf
-===================================================================
---- rm/rm.inf (revision 64)
-+++ rm/rm.inf (working copy)
-@@ -41,23 +41,23 @@
[sources.common]
- RmStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- rm.h
- rm.c
-
+ MvStrings.uni
+ mv.c
+ mv.h
+
[includes.common]
.
- ..\Inc
@@ -3367,99 +7596,167 @@ Index: rm/rm.inf
[libraries.common]
EfiShellLib
-Index: mem/MemCommonPart.c
-===================================================================
---- mem/MemCommonPart.c (revision 64)
-+++ mem/MemCommonPart.c (working copy)
-@@ -58,7 +58,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
-@@ -149,7 +149,7 @@
- return EFI_SUCCESS;
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeMv
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/newshell/FakeHii.c b/newshell/FakeHii.c
+index c187b47..5dff3ad 100644
+--- a/newshell/FakeHii.c
++++ b/newshell/FakeHii.c
+@@ -196,7 +196,7 @@ FakeUninstallHiiDatabase (
+ Status = BS->HandleProtocol (
+ mFakeHiiHandle,
+ &gEfiHiiProtocolGuid,
+- &FakeHii
++ (VOID**)&FakeHii
+ );
+ Status = BS->UninstallProtocolInterface (
+ mFakeHiiHandle,
+@@ -320,7 +320,7 @@ InsertStringPackage (
+ if (Language == NULL) {
+ return EFI_OUT_OF_RESOURCES;
}
+- strcpya (Language, (UINT8 *) PackageHdr + HeaderSize - LanguageSize);
++ strcpya (Language, (CHAR8*) ((UINT8 *) PackageHdr + HeaderSize - LanguageSize));
+ for (Link = PackageList->StringPkgHdr.Flink; Link != &PackageList->StringPkgHdr; Link = Link->Flink) {
+ StringPackage = CR (Link, FAKE_HII_STRING_PACKAGE, Entry, FAKE_HII_STRING_PACKAGE_SIGNATURE);
+ if (CompareLanguage (Language, StringPackage->StringPkgHdr->Language)) {
+@@ -770,7 +770,7 @@ FakeHiiGetString (
+ StringPackage = NULL;
+ for (Link = DatabaseRecord->StringPkgHdr.Flink; Link != &DatabaseRecord->StringPkgHdr; Link = Link->Flink) {
+ StringPackage = CR (Link, FAKE_HII_STRING_PACKAGE, Entry, FAKE_HII_STRING_PACKAGE_SIGNATURE);
+- if (CompareLanguage (StringPackage->StringPkgHdr->Language, (UINT8 *) Language)) {
++ if (CompareLanguage (StringPackage->StringPkgHdr->Language, (CHAR8 *) Language)) {
+ Matched = TRUE;
+ break;
+ }
+diff --git a/newshell/FakeHii.h b/newshell/FakeHii.h
+index a73332b..4c34460 100644
+--- a/newshell/FakeHii.h
++++ b/newshell/FakeHii.h
+@@ -479,3 +479,4 @@ extern BOOLEAN gHiiInitialized;
+ #endif
-- Address = (AddressStr) ? Xtoi (AddressStr) : (UINT64) SystemTable;
-+ Address = (AddressStr) ? Xtoi (AddressStr) : (UINT64)(UINTN) SystemTable;
- Size = (SizeStr) ? Xtoi (SizeStr) : 512;
+ #endif
++
+diff --git a/newshell/init.c b/newshell/init.c
+index fd4adf6..fe73711 100644
+--- a/newshell/init.c
++++ b/newshell/init.c
+@@ -23,7 +23,7 @@ Abstract:
+ #include "nshell.h"
+ extern UINT8 STRING_ARRAY_NAME[];
+-extern BOOLEAN gHiiInitialized = FALSE;
++BOOLEAN gHiiInitialized = FALSE;
+
+ //
+ // This is the generated header file which includes whatever needs to be exported (strings + IFR)
+@@ -99,13 +99,13 @@ _GetFsDpOfImg (
+ Status = BS->HandleProtocol (
+ ImgHnd,
+ &gEfiLoadedImageProtocolGuid,
+- &img
++ (VOID**)&img
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = BS->HandleProtocol (
+ img->DeviceHandle,
+ &gEfiDevicePathProtocolGuid,
+- &dp
++ (VOID**)&dp
+ );
+ if (!EFI_ERROR (Status)) {
+ *DevPath = DuplicateDevicePath (dp);
+@@ -220,7 +220,7 @@ _DoInit (
//
-@@ -157,7 +157,7 @@
- //
- PrintToken (STRING_TOKEN (STR_MEM_MEMORY_ADDR), HiiMemHandle, 2 * sizeof (UINTN), Address, Size);
- if (MMIo) {
-- Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, &PciRootBridgeIo);
-+ Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRootBridgeIo);
+ Status = LibLocateProtocol (
+ &gEfiConsoleControlProtocolGuid,
+- &ConsoleControl
++ (VOID**)&ConsoleControl
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = ConsoleControl->GetMode (ConsoleControl, &mOldCurrentMode, NULL, NULL);
+@@ -342,7 +342,7 @@ _EnableShellEnv (
+ Status = _ShellLoadEnvDriver (ImageHandle);
+ )
if (EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiMemHandle, L"mem", L"PciRootBridgeIo");
- return Status;
-@@ -172,7 +172,7 @@
- return Status;
- }
-
-- PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer);
-+ PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciWidthUint8, Address, Size, Buffer);
- } else {
- Buffer = (UINT8 *) (UINTN) Address;
+- Status = LibLocateProtocol (&ShellEnvProtocol, &SE);
++ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&SE);
+ if (EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_NSHELL_ENV_DRIVER), HiiNewshellHandle);
+ return Status;
+@@ -372,7 +372,7 @@ _InstallShellInterface (
+ *IsRootInstance = TRUE;
}
-@@ -233,7 +233,7 @@
- MMIo = FALSE;
- AddressStr = NULL;
- SizeStr = NULL;
-- Address = (UINT64) SystemTable;
-+ Address = (UINT64)(UINTN) SystemTable;
- Size = 512;
- RetCode = LibCheckVariables (SI, MemCheckList, &ChkPck, &Useful);
- if (VarCheckOk != RetCode) {
-@@ -312,7 +312,7 @@
+
+- Status = LibLocateProtocol (&ShellEnvProtocol, &SE);
++ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&SE);
+ ASSERT (!EFI_ERROR (Status));
+ SI = SE->NewShell (ImageHandle);
+
+@@ -543,7 +543,7 @@ _CleanUpOnExit (
//
- PrintToken (STRING_TOKEN (STR_MEM_NEW_MEMORY_ADDR), HiiMemHandle, 2 * sizeof (UINTN), Address, Size);
- if (MMIo) {
-- Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, &PciRootBridgeIo);
-+ Status = BS->LocateProtocol (&gEfiPciRootBridgeIoProtocolGuid, NULL, (VOID**)&PciRootBridgeIo);
- if (EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_LOC_PROT_ERR_EX), HiiMemHandle, L"mem", L"PciRootBridgeIo");
- return Status;
-@@ -327,7 +327,7 @@
- return Status;
- }
+ ConsoleControlStatus = LibLocateProtocol (
+ &gEfiConsoleControlProtocolGuid,
+- &ConsoleControl
++ (VOID**)&ConsoleControl
+ );
+ if (!EFI_ERROR (ConsoleControlStatus)) {
+ ConsoleControlStatus = ConsoleControl->GetMode (ConsoleControl, &CurrentMode, NULL, NULL);
+@@ -709,7 +709,7 @@ Returns:
+ //
+ SE2->IncrementShellNestingLevel ();
-- PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciIoWidthUint8, Address, Size, Buffer);
-+ PciRootBridgeIo->Mem.Read (PciRootBridgeIo, EfiPciWidthUint8, Address, Size, Buffer);
- } else {
- Buffer = (UINT8 *) (UINTN) Address;
- }
-Index: mem/MemCommonPart.h
-===================================================================
---- mem/MemCommonPart.h (revision 64)
-+++ mem/MemCommonPart.h (working copy)
-@@ -62,4 +62,4 @@
- IN EFI_BLOCK_IO_PROTOCOL *BlkIo
- );
+- while (Status != -1) {
++ while (Status != (EFI_STATUS) -1) {
+ Status = NShellPrompt (ImageHandle);
+ EFI_NT_EMULATOR_CODE (
+ //
+@@ -723,7 +723,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ ImageHandle,
+ &ShellInterfaceProtocol,
+- &SI
++ (VOID**)&SI
+ );
+ ASSERT (!EFI_ERROR (Status));
+ }
+diff --git a/newshell/nshell.h b/newshell/nshell.h
+index 5c58410..c2a3a9e 100644
+--- a/newshell/nshell.h
++++ b/newshell/nshell.h
+@@ -58,4 +58,5 @@ extern EFI_SHELL_ENVIRONMENT *SE;
+ #define EFI_NO_MONOSHELL_CODE(code) code
+ #endif
-#endif
\ No newline at end of file
+#endif
-Index: mem/mem.inf
-===================================================================
---- mem/mem.inf (revision 64)
-+++ mem/mem.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
++
+diff --git a/newshell/nshell.inf b/newshell/nshell.inf
+index 22479b0..405e23c 100644
+--- a/newshell/nshell.inf
++++ b/newshell/nshell.inf
+@@ -26,24 +26,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
+ NshellStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- MemStrings.uni
- DebugStrings.uni
- mm.c
-@@ -34,17 +34,17 @@
-
+ init.c
+ nshell.h
+ fakehii.c
+
[includes.common]
.
- ..\Inc
@@ -3487,91 +7784,39 @@ Index: mem/mem.inf
[libraries.common]
EfiShellLib
-Index: mem/efidump.c
-===================================================================
---- mem/efidump.c (revision 64)
-+++ mem/efidump.c (working copy)
-@@ -24,7 +24,7 @@
- --*/
-
- #include "debug.h"
--#include "Efipart.h"
-+#include "EfiPart.h"
- #include "EfiShellLib.h"
-
- #include STRING_DEFINES_FILE
-@@ -320,13 +320,11 @@
- VOID *AcpiTable;
- VOID *Acpi20Table;
- VOID *SMBIOSTable;
-- VOID *SalSystemTable;
- VOID *MpsTable;
-
- AcpiTable = NULL;
- Acpi20Table = NULL;
- SMBIOSTable = NULL;
-- SalSystemTable = NULL;
- MpsTable = NULL;
-
- PrintToken (
-@@ -352,11 +350,13 @@
- PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiMemHandle, LibDevicePathToStr (DevicePath));
- }
-
-- PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiMemHandle, (UINT64) Tbl.Sys->RuntimeServices);
-- PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiMemHandle, (UINT64) Tbl.Sys->BootServices);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiMemHandle, (UINT64)(UINTN) Tbl.Sys->RuntimeServices);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiMemHandle, (UINT64)(UINTN) Tbl.Sys->BootServices);
-
- EFI64_CODE (
-- Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
-+ VOID *SalSystemTable;
-+
-+ Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
- if (!EFI_ERROR(Status)) {
- PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiMemHandle, (UINT64)SalSystemTable);
- }
-@@ -364,22 +364,22 @@
-
- Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiMemHandle, (UINT64) AcpiTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiMemHandle, (UINT64)(UINTN) AcpiTable);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Acpi20Table);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiMemHandle, (UINT64) Acpi20Table);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiMemHandle, (UINT64)(UINTN) Acpi20Table);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiMpsTableGuid, &MpsTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiMemHandle, (UINT64) MpsTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiMemHandle, (UINT64)(UINTN) MpsTable);
- }
-
- Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &SMBIOSTable);
- if (!EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiMemHandle, (UINT64) SMBIOSTable);
-+ PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiMemHandle, (UINT64)(UINTN) SMBIOSTable);
- }
- }
-
-Index: mem/debug.h
-===================================================================
---- mem/debug.h (revision 64)
-+++ mem/debug.h (working copy)
-@@ -156,3 +156,4 @@
- extern EFI_HII_HANDLE HiiMemHandle;
+@@ -63,11 +63,13 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeShell
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+- C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_MONOSHELL=2
+-
++ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
- #endif
-+
-Index: ls/ls.c
-===================================================================
---- ls/ls.c (revision 64)
-+++ ls/ls.c (working copy)
-@@ -59,7 +59,7 @@
+-
+\ No newline at end of file
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/openinfo/openinfo.c b/openinfo/openinfo.c
+index 9b3356c..16274fe 100644
+--- a/openinfo/openinfo.c
++++ b/openinfo/openinfo.c
+@@ -36,7 +36,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+ //
+ // Global Variables
+ //
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiOpeninfoGuid = EFI_OPENINFO_GUID;
+ SHELL_VAR_CHECK_ITEM OpeninfoCheckList[] = {
+ {
+@@ -55,7 +55,7 @@ SHELL_VAR_CHECK_ITEM OpeninfoCheckList[] = {
NULL,
0,
0,
@@ -3580,82 +7825,29 @@ Index: ls/ls.c
}
};
-@@ -199,7 +199,6 @@
- CHAR16 *PtrTwo;
- CHAR16 *Path;
- EFI_LIST_ENTRY DirList;
-- EFI_LIST_ENTRY *Link;
- SHELL_FILE_ARG *Arg;
- BOOLEAN WildcardsEncountered;
- CHAR16 *Pattern;
-@@ -210,7 +209,6 @@
- Argv = SI->Argv;
- PtrTwo = NULL;
- InitializeListHead (&DirList);
-- Link = NULL;
- Arg = NULL;
- Pattern = NULL;
- Status = EFI_SUCCESS;
-@@ -815,8 +813,6 @@
- CHAR16 *Path
- )
- {
--
-- EFI_STATUS Status;
- CHAR16 *PtrOne;
- CHAR16 *PtrTwo;
- UINTN Index1;
-@@ -825,7 +821,6 @@
- BOOLEAN LeadingBlanks;
-
- LeadingBlanks = TRUE;
-- Status = EFI_SUCCESS;
-
- for (PtrOne = PtrTwo = Path; PtrOne < Path + StrLen (Path); PtrOne++) {
- if ((*PtrOne) == ' ' && LeadingBlanks) {
-@@ -917,14 +912,14 @@
-
- if ((IsMatch && mIgnoreAttribute) ||
- (IsMatch && !mAttributes && !(Info->Attribute & EFI_FILE_HIDDEN) && !(Info->Attribute & EFI_FILE_SYSTEM)) ||
-- IsMatch &&
-+ (IsMatch &&
- mAttributes &&
- (
- (mAttribA ? (Info->Attribute & EFI_FILE_ARCHIVE ? TRUE : FALSE) : TRUE) &&
- (mAttribH ? (Info->Attribute & EFI_FILE_HIDDEN ? TRUE : FALSE) : TRUE) &&
- (mAttribR ? (Info->Attribute & EFI_FILE_READ_ONLY ? TRUE : FALSE) : TRUE) &&
- (mAttribS ? (Info->Attribute & EFI_FILE_SYSTEM ? TRUE : FALSE) : TRUE) &&
-- (mAttribD ? (Info->Attribute & EFI_FILE_DIRECTORY ? TRUE : FALSE) : TRUE)
-+ (mAttribD ? (Info->Attribute & EFI_FILE_DIRECTORY ? TRUE : FALSE) : TRUE))
- )
- ) {
- IsMatch = TRUE;
-Index: ls/ls.h
-===================================================================
---- ls/ls.h (revision 64)
-+++ ls/ls.h (working copy)
-@@ -91,4 +91,5 @@
- IN UINT16 VHlpToken
- );
+diff --git a/openinfo/openinfo.h b/openinfo/openinfo.h
+index fdd070d..56ed64a 100644
+--- a/openinfo/openinfo.h
++++ b/openinfo/openinfo.h
+@@ -33,3 +33,4 @@ Revision History
+ }
--#endif
-\ No newline at end of file
-+#endif
+ #endif
+
-Index: ls/ls.inf
-===================================================================
---- ls/ls.inf (revision 64)
-+++ ls/ls.inf (working copy)
-@@ -40,24 +40,24 @@
-
+diff --git a/openinfo/openinfo.inf b/openinfo/openinfo.inf
+index 638462d..8bc1e18 100644
+--- a/openinfo/openinfo.inf
++++ b/openinfo/openinfo.inf
+@@ -41,24 +41,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- LsStrings.uni
- ls.c
- ls.h
-
+ OPeninfoStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ openinfo.c
+ openinfo.h
+
+
[includes.common]
.
- ..\Inc
@@ -3683,11 +7875,41 @@ Index: ls/ls.inf
[libraries.common]
EfiShellLib
-Index: stall/stall.c
-===================================================================
---- stall/stall.c (revision 64)
-+++ stall/stall.c (working copy)
-@@ -50,7 +50,7 @@
+@@ -73,7 +73,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=OpeninfoMain
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/pci/pci.c b/pci/pci.c
+index 8dc0dba..bb587c9 100644
+--- a/pci/pci.c
++++ b/pci/pci.c
+@@ -334,7 +334,7 @@ PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
+ {
+ 0,
+ 0,
+- 0,
++ (PCIE_CAPREG_FIELD_WIDTH)0,
+ NULL,
+ PcieExplainTypeMax
+ }
+@@ -344,7 +344,7 @@ PCIE_EXPLAIN_STRUCT PcieExplainList[] = {
+ // Global Variables
+ //
+ PCI_CONFIG_SPACE *mConfigSpace;
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiPciGuid = EFI_PCI_GUID;
+ SHELL_VAR_CHECK_ITEM PciCheckList[] = {
+ {
+@@ -375,7 +375,7 @@ SHELL_VAR_CHECK_ITEM PciCheckList[] = {
NULL,
0,
0,
@@ -3696,28 +7918,93 @@ Index: stall/stall.c
}
};
-Index: stall/stall.h
-===================================================================
---- stall/stall.h (revision 64)
-+++ stall/stall.h (working copy)
-@@ -30,3 +30,4 @@
+@@ -1034,7 +1034,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ Handle,
+ &gEfiPciRootBridgeIoProtocolGuid,
+- IoDev
++ (VOID**)IoDev
+ );
+
+ if (EFI_ERROR (Status)) {
+@@ -1043,7 +1043,7 @@ Returns:
+ //
+ // Call Configuration() to get address space descriptors
+ //
+- Status = (*IoDev)->Configuration (*IoDev, Descriptors);
++ Status = (*IoDev)->Configuration (*IoDev, (VOID**)Descriptors);
+ if (Status == EFI_UNSUPPORTED) {
+ *Descriptors = NULL;
+ return EFI_SUCCESS;
+@@ -1237,7 +1237,7 @@ Returns:
+ PrintToken (STRING_TOKEN (STR_PCI2_SINGLE_FUNCTION), HiiHandle);
}
- #endif
+- HeaderType = (UINT8) (Common->HeaderType & 0x7f);
++ HeaderType = (PCI_HEADER_TYPE) (Common->HeaderType & 0x7f);
+ switch (HeaderType) {
+ case PciDevice:
+ PrintToken (STRING_TOKEN (STR_PCI2_PCI_DEVICE), HiiHandle);
+@@ -1300,6 +1300,9 @@ Returns:
+ );
+ CapPtr = ConfigSpace->NonCommon.CardBus.CapabilitiesPtr;
+ break;
+
-Index: stall/stall.inf
-===================================================================
---- stall/stall.inf (revision 64)
-+++ stall/stall.inf (working copy)
-@@ -40,24 +40,24 @@
++ default:
++ Status = EFI_UNSUPPORTED;
+ }
+ //
+ // If Status bit4 is 1, dump or explain capability structure
+@@ -1956,7 +1959,7 @@ Returns:
+ INDEX_OF (&(CardBus->IoBase0)),
+ Io32Bit ? L" 32 bit" : L" 16 bit",
+ CardBus->IoBase0 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
+- CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff) | 0x00000003
++ (CardBus->IoLimit0 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
+ );
+ Io32Bit = (BOOLEAN) (CardBus->IoBase1 & PCI_BIT_0);
+@@ -1966,7 +1969,7 @@ Returns:
+ INDEX_OF (&(CardBus->IoBase1)),
+ Io32Bit ? L" 32 bit" : L" 16 bit",
+ CardBus->IoBase1 & (Io32Bit ? 0xfffffffc : 0x0000fffc),
+- CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff) | 0x00000003
++ (CardBus->IoLimit1 & (Io32Bit ? 0xffffffff : 0x0000ffff)) | 0x00000003
+ );
+
+ //
+diff --git a/pci/pci.h b/pci/pci.h
+index 0716bee..42a5870 100644
+--- a/pci/pci.h
++++ b/pci/pci.h
+@@ -30,7 +30,7 @@ Revision History
+ 0x388da6c3, 0x3447, 0x4b1f, 0xa0, 0xba, 0xa9, 0xe8, 0xa2, 0x87, 0xf1, 0x76 \
+ }
+
+-#include "TIANO.h"
++#include "Tiano.h"
+
+ typedef enum {
+ PciDevice,
+@@ -477,3 +477,4 @@ typedef struct {
+ #pragma pack()
+
+ #endif // _PCI_H_
++
+diff --git a/pci/pci.inf b/pci/pci.inf
+index d4499d6..2c559a5 100644
+--- a/pci/pci.inf
++++ b/pci/pci.inf
+@@ -41,7 +41,7 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
+ PciStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- stallStrings.uni
- stall.c
- stall.h
+ pci.c
+ pci.h
+ pci_class.h
+@@ -49,17 +49,17 @@ COMPONENT_TYPE = APPLICATION
[includes.common]
.
@@ -3746,20 +8033,54 @@ Index: stall/stall.inf
[libraries.common]
EfiShellLib
-Index: DeviceTree/devicetree.c
-===================================================================
---- DeviceTree/devicetree.c (revision 64)
-+++ DeviceTree/devicetree.c (working copy)
-@@ -36,7 +36,7 @@
+@@ -74,7 +74,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=PciDump
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/pci/pci_class.c b/pci/pci_class.c
+index caffe6d..14aa88d 100644
+--- a/pci/pci_class.c
++++ b/pci/pci_class.c
+@@ -30,7 +30,7 @@ Revision History
//
// Global Variables
//
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDevicetreeGuid = EFI_DEVICETREE_GUID;
- SHELL_VAR_CHECK_ITEM DevicetreeCheckList[] = {
- {
-@@ -67,7 +67,7 @@
+
+ PCI_CLASS_ENTRY gClassStringList[];
+
+diff --git a/pci/pci_class.h b/pci/pci_class.h
+index c7fff0c..0d6bea6 100644
+--- a/pci/pci_class.h
++++ b/pci/pci_class.h
+@@ -24,7 +24,7 @@ Revision History
+ #ifndef _PCI_CLASS_H_
+ #define _PCI_CLASS_H_
+
+-#include "TIANO.h" // for UINT32 etc.
++#include "Tiano.h" // for UINT32 etc.
+ #define PCI_CLASS_STRING_LIMIT 54
+ //
+ // Printable strings for Pci class code
+@@ -58,3 +58,4 @@ PciPrintClassCode (
+ );
+
+ #endif // _PCI_CLASS_H_
++
+diff --git a/reset/reset.c b/reset/reset.c
+index 497b693..a5208b9 100644
+--- a/reset/reset.c
++++ b/reset/reset.c
+@@ -61,7 +61,7 @@ SHELL_VAR_CHECK_ITEM ResetCheckList[] = {
NULL,
0,
0,
@@ -3768,29 +8089,29 @@ Index: DeviceTree/devicetree.c
}
};
-Index: DeviceTree/devicetree.h
-===================================================================
---- DeviceTree/devicetree.h (revision 64)
-+++ DeviceTree/devicetree.h (working copy)
-@@ -32,3 +32,4 @@
- 0xf21044af, 0xeef6, 0x4d58, 0xb4, 0x56, 0x32, 0x86, 0xa0, 0x2b, 0x7c, 0x49 \
+diff --git a/reset/reset.h b/reset/reset.h
+index 737fa11..e81c69a 100644
+--- a/reset/reset.h
++++ b/reset/reset.h
+@@ -32,3 +32,4 @@ Revision History
}
+
#endif
+
-Index: DeviceTree/devicetree.inf
-===================================================================
---- DeviceTree/devicetree.inf (revision 64)
-+++ DeviceTree/devicetree.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/reset/reset.inf b/reset/reset.inf
+index 3af6b2c..5d36446 100644
+--- a/reset/reset.inf
++++ b/reset/reset.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- DevicetreeStrings.uni
- devicetree.c
- devicetree.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ ResetStrings.uni
+ Reset.c
+ Reset.h
+
[includes.common]
.
- ..\Inc
@@ -3818,60 +8139,52 @@ Index: DeviceTree/devicetree.inf
[libraries.common]
EfiShellLib
-Index: TelnetMgmt/TelnetMgmt.c
-===================================================================
---- TelnetMgmt/TelnetMgmt.c (revision 64)
-+++ TelnetMgmt/TelnetMgmt.c (working copy)
-@@ -32,7 +32,7 @@
- //
- #include STRING_DEFINES_FILE
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiTelnetMgmtGuid = EFI_TELNETMGMT_GUID;
- EFI_GUID mEfiTelnetServerGuid = EFI_TELNET_SERVER_PROTOCOL_GUID;
- SHELL_VAR_CHECK_ITEM TelnetmgmtCheckList[] = {
-@@ -58,7 +58,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeReset
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/rm/rm.c b/rm/rm.c
+index 792a5dc..7d0c2c8 100644
+--- a/rm/rm.c
++++ b/rm/rm.c
+@@ -54,7 +54,7 @@ SHELL_VAR_CHECK_ITEM RmCheckList[] = {
NULL,
0,
0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
+- FALSE
++ (SHELL_VAR_CHECK_FLAG_TYPE) FALSE
}
};
-Index: TelnetMgmt/TelnetMgmt.h
-===================================================================
---- TelnetMgmt/TelnetMgmt.h (revision 64)
-+++ TelnetMgmt/TelnetMgmt.h (working copy)
-@@ -29,4 +29,4 @@
- 0x55d41b9a, 0x954d, 0x4fbb, 0x8d, 0x6d, 0x24, 0x75, 0xf5, 0x30, 0x9d, 0x37 \
- }
-
--#endif
-\ No newline at end of file
-+#endif
-Index: TelnetMgmt/TelnetServer.h
-===================================================================
---- TelnetMgmt/TelnetServer.h (revision 64)
-+++ TelnetMgmt/TelnetServer.h (working copy)
-@@ -81,3 +81,4 @@
- extern EFI_GUID gEfiTelnetServerGuid;
+diff --git a/rm/rm.h b/rm/rm.h
+index 837ca7c..e2d5117 100644
+--- a/rm/rm.h
++++ b/rm/rm.h
+@@ -59,3 +59,4 @@ RemoveRM (
+ );
#endif
+
-Index: TelnetMgmt/TelnetMgmt.inf
-===================================================================
---- TelnetMgmt/TelnetMgmt.inf (revision 64)
-+++ TelnetMgmt/TelnetMgmt.inf (working copy)
-@@ -25,23 +25,23 @@
- COMPONENT_TYPE = APPLICATION
+diff --git a/rm/rm.inf b/rm/rm.inf
+index 0da05e0..45b5edb 100644
+--- a/rm/rm.inf
++++ b/rm/rm.inf
+@@ -41,23 +41,23 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- TelnetMgmtStrings.uni
- TelnetMgmt.c
+ RmStrings.uni
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ rm.h
+ rm.c
[includes.common]
.
@@ -3900,47 +8213,32 @@ Index: TelnetMgmt/TelnetMgmt.inf
[libraries.common]
EfiShellLib
-Index: shellenv/if.c
-===================================================================
---- shellenv/if.c (revision 64)
-+++ shellenv/if.c (working copy)
-@@ -59,7 +59,6 @@
- BOOLEAN ExistNot;
- UINTN NotPos;
- BOOLEAN ExistI;
-- UINTN IPos;
- EFI_STATUS Status;
- CHAR16 *FileName;
- BOOLEAN FileExists;
-@@ -122,10 +121,8 @@
- //
- if ((StriCmp (SI->Argv[1], L"/i") == 0)) {
- ExistI = TRUE;
-- IPos = 1;
- } else {
- ExistI = FALSE;
-- IPos = 0;
- }
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
- NotPos = ExistI ? 2 : 1;
-Index: shellenv/init.c
-===================================================================
---- shellenv/init.c (revision 64)
-+++ shellenv/init.c (working copy)
-@@ -143,7 +143,7 @@
- Status = BS->HandleProtocol (
- mOldSEnv->Handle,
- &ShellEnvProtocol,
-- &(mOldSEnv->Interface)
-+ (VOID**)&(mOldSEnv->Interface)
- );
- ASSERT (!EFI_ERROR (Status));
- Status = BS->ReinstallProtocolInterface (
-Index: shellenv/echo.c
-===================================================================
---- shellenv/echo.c (revision 64)
-+++ shellenv/echo.c (working copy)
-@@ -52,7 +52,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeRM
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/sermode/sermode.c b/sermode/sermode.c
+index b59e801..d03c621 100644
+--- a/sermode/sermode.c
++++ b/sermode/sermode.c
+@@ -35,7 +35,7 @@ extern UINT8 STRING_ARRAY_NAME[];
+
+ #include EFI_PROTOCOL_DEFINITION (SerialIo)
+
+-EFI_HII_HANDLE HiiHandle;
++STATIC EFI_HII_HANDLE HiiHandle;
+ EFI_GUID EfiSermodeGuid = EFI_SERMODEB_GUID;
+ SHELL_VAR_CHECK_ITEM SermodeCheckList[] = {
+ {
+@@ -54,7 +54,7 @@ SHELL_VAR_CHECK_ITEM SermodeCheckList[] = {
NULL,
0,
0,
@@ -3949,128 +8247,91 @@ Index: shellenv/echo.c
}
};
-Index: shellenv/shelle.h
-===================================================================
---- shellenv/shelle.h (revision 64)
-+++ shellenv/shelle.h (working copy)
-@@ -2074,3 +2074,4 @@
- );
+@@ -104,7 +104,7 @@ iDisplaySettings (
- #endif // _SHELLE_H_
-+
-Index: shellenv/batch.c
-===================================================================
---- shellenv/batch.c (revision 64)
-+++ shellenv/batch.c (working copy)
-@@ -2388,7 +2388,6 @@
-
- --*/
- {
-- BOOLEAN EndOfFile;
- EFI_STATUS Status;
- UINTN BufSize;
- CHAR16 *CommandLine;
-@@ -2396,7 +2395,6 @@
- EFI_BATCH_STATEMENT *Stmt;
- ENV_SHELL_INTERFACE NewShell;
- UINTN GotoTargetStatus;
-- UINTN SkippedIfCount;
- BOOLEAN EchoStateValid;
- BOOLEAN EchoState;
- EFI_STATUS ExecuteResult;
-@@ -2409,7 +2407,6 @@
- // Initialize
- //
- Status = EFI_SUCCESS;
-- EndOfFile = FALSE;
- BufSize = 0;
- EchoStateValid = FALSE;
- EchoState = FALSE;
-@@ -2468,14 +2465,6 @@
- EFI_BATCH_SCRIPT_SIGNATURE
- );
+ }
-- //
-- // Iterate through the file, reading a line at a time and executing each
-- // line as a shell command. Nested shell scripts will come through
-- // this code path recursively.
-- //
-- EndOfFile = FALSE;
-- SkippedIfCount = 0;
--
- while (1) {
- //
- // Read a command line from the file
-@@ -2681,7 +2670,7 @@
- LastError = ExecuteResult;
+- Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, &SerialIo);
++ Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
+ if (!EFI_ERROR (Status)) {
+ switch (SerialIo->Mode->Parity) {
+ case DefaultParity:
+@@ -454,7 +454,7 @@ Returns:
+ continue;
}
-- if (ExecuteResult == -1) {
-+ if (ExecuteResult == (EFI_STATUS) -1) {
- SE2->DecrementShellNestingLevel ();
- if (SE2->IsRootShell ()) {
- goto Done;
-@@ -2774,7 +2763,7 @@
- Status = _ResumePreviousMode ();
+- Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, &SerialIo);
++ Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
+ if (!EFI_ERROR (Status)) {
+ Status = SerialIo->SetAttributes (
+ SerialIo,
+diff --git a/sermode/sermode.h b/sermode/sermode.h
+index 71a719b..7f38d4c 100644
+--- a/sermode/sermode.h
++++ b/sermode/sermode.h
+@@ -32,3 +32,4 @@ Revision History
}
-- if (LastError == -1) {
-+ if (LastError == (UINTN) -1) {
- return LastError;
- } else {
- return Status;
-Index: shellenv/dprot.c
-===================================================================
---- shellenv/dprot.c (revision 64)
-+++ shellenv/dprot.c (working copy)
-@@ -23,7 +23,7 @@
-
- #include "shelle.h"
- #include "shellenvguid.h"
--#include "acpi.h"
-+#include "Acpi.h"
-
- STATIC CHAR16 *SEnvDP_IlleagalStr[] = { L"Illegal" };
+ #endif
++
+diff --git a/sermode/sermode.inf b/sermode/sermode.inf
+index 71f3c66..4954400 100644
+--- a/sermode/sermode.inf
++++ b/sermode/sermode.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
-@@ -328,7 +328,6 @@
- I2O_DEVICE_PATH *I2ODevicePath;
- MAC_ADDR_DEVICE_PATH *MacAddrDevicePath;
- IPv4_DEVICE_PATH *IPv4DevicePath;
-- IPv6_DEVICE_PATH *IPv6DevicePath;
- INFINIBAND_DEVICE_PATH *InfinibandDevicePath;
- UART_DEVICE_PATH *UartDevicePath;
- VENDOR_DEVICE_PATH *VendorDevicePath;
-@@ -464,7 +463,6 @@
- break;
- case MSG_IPv6_DP:
-- IPv6DevicePath = (IPv6_DEVICE_PATH *) DevicePath;
- PrintToken (STRING_TOKEN (STR_SHELLENV_DPROT_NOT_AVAIL), HiiEnvHandle);
- break;
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ SermodeStrings.uni
+ sermode.c
+ sermode.h
+
+ [includes.common]
+ .
+- ..\Inc
+- ..\Library
+- $(EDK_SOURCE)\Foundation
+- $(EDK_SOURCE)\Foundation\Include
+- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
+- $(EDK_SOURCE)\Foundation\Efi
+- $(EDK_SOURCE)\Foundation\Efi\Include
+- $(EDK_SOURCE)\Foundation\FrameWork
+- $(EDK_SOURCE)\Foundation\FrameWork\Include
+- $(EDK_SOURCE)\Foundation\Core\Dxe
+- $(DEST_DIR)\
++ ../Inc
++ ../Library
++ $(EDK_SOURCE)/Foundation
++ $(EDK_SOURCE)/Foundation/Include
++ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
++ $(EDK_SOURCE)/Foundation/Efi
++ $(EDK_SOURCE)/Foundation/Efi/Include
++ $(EDK_SOURCE)/Foundation/FrameWork
++ $(EDK_SOURCE)/Foundation/FrameWork/Include
++ $(EDK_SOURCE)/Foundation/Core/Dxe
++ $(DEST_DIR./
-@@ -1054,6 +1052,8 @@
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
- Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
-+ } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_AARCH64) {
-+ Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
- } else {
- Magic = NtHdr->OptionalHeader.Magic;
- }
-@@ -1294,6 +1294,8 @@
- case EfiIsaAcpiResourceInterrupt:
- PrintToken (STRING_TOKEN (STR_SHELLENV_DPROT_INT), HiiEnvHandle);
- break;
-+ case EfiIsaAcpiResourceEndOfList:
-+ return;
- }
+ [libraries.common]
+ EfiShellLib
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
- if (IsaIo->ResourceList->ResourceItem[Index].StartRange == IsaIo->ResourceList->ResourceItem[Index].EndRange) {
-Index: shellenv/Connect.c
-===================================================================
---- shellenv/Connect.c (revision 64)
-+++ shellenv/Connect.c (working copy)
-@@ -51,7 +51,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeSerialMode
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/shellenv/Connect.c b/shellenv/Connect.c
+index 71ecf0b..51ec714 100644
+--- a/shellenv/Connect.c
++++ b/shellenv/Connect.c
+@@ -51,7 +51,7 @@ SHELL_VAR_CHECK_ITEM ConnectCheckList[] = {
NULL,
0,
0,
@@ -4079,7 +8340,7 @@ Index: shellenv/Connect.c
}
};
-@@ -78,7 +78,7 @@
+@@ -78,7 +78,7 @@ SHELL_VAR_CHECK_ITEM DisconnectCheckList[] = {
NULL,
0,
0,
@@ -4088,7 +8349,7 @@ Index: shellenv/Connect.c
}
};
-@@ -105,7 +105,7 @@
+@@ -105,7 +105,7 @@ SHELL_VAR_CHECK_ITEM ReconnectCheckList[] = {
NULL,
0,
0,
@@ -4097,7 +8358,7 @@ Index: shellenv/Connect.c
}
};
-@@ -333,7 +333,7 @@
+@@ -333,7 +333,7 @@ Returns:
Status = BS->HandleProtocol (
HandleBuffer[0],
&gEfiDevicePathProtocolGuid,
@@ -4106,7 +8367,7 @@ Index: shellenv/Connect.c
);
if (EFI_ERROR (Status)) {
DriverBindingHandleCount = 1;
-@@ -349,7 +349,7 @@
+@@ -349,7 +349,7 @@ Returns:
Status = BS->HandleProtocol (
HandleBuffer[0],
&gEfiDevicePathProtocolGuid,
@@ -4115,7 +8376,7 @@ Index: shellenv/Connect.c
);
if (EFI_ERROR (Status)) {
PrintToken (
-@@ -368,7 +368,7 @@
+@@ -368,7 +368,7 @@ Returns:
Status = BS->HandleProtocol (
HandleBuffer[1],
&gEfiDriverBindingProtocolGuid,
@@ -4124,7 +8385,7 @@ Index: shellenv/Connect.c
);
if (EFI_ERROR (Status)) {
PrintToken (
-@@ -407,7 +407,7 @@
+@@ -407,7 +407,7 @@ Returns:
Status = BS->HandleProtocol (
AllHandleBuffer[Index],
&gEfiDriverBindingProtocolGuid,
@@ -4133,7 +8394,7 @@ Index: shellenv/Connect.c
);
if (EFI_ERROR (Status)) {
DeviceHandleBuffer[DeviceHandleCount++] = AllHandleBuffer[Index];
-@@ -1052,7 +1052,7 @@
+@@ -1052,7 +1052,7 @@ SEnvConnectConsole (
Status = BS->HandleProtocol (
*ConsoleHandle,
ConsoleGuid,
@@ -4142,7 +8403,7 @@ Index: shellenv/Connect.c
);
}
-@@ -1079,7 +1079,7 @@
+@@ -1079,7 +1079,7 @@ SEnvConnectConsole (
Status = BS->HandleProtocol (
AllHandleBuffer[Index],
&gEfiDevicePathProtocolGuid,
@@ -4151,7 +8412,7 @@ Index: shellenv/Connect.c
);
if (!EFI_ERROR (Status)) {
ConsoleIndex = Index;
-@@ -1095,7 +1095,7 @@
+@@ -1095,7 +1095,7 @@ SEnvConnectConsole (
BS->HandleProtocol (
*ConsoleHandle,
ConsoleGuid,
@@ -4160,134 +8421,11 @@ Index: shellenv/Connect.c
);
}
-Index: shellenv/shellenvguid.h
-===================================================================
---- shellenv/shellenvguid.h (revision 64)
-+++ shellenv/shellenvguid.h (working copy)
-@@ -37,3 +37,4 @@
- extern EFI_HII_HANDLE HiiEnvHandle;
-
- #endif
-+
-Index: shellenv/protid.c
-===================================================================
---- shellenv/protid.c (revision 64)
-+++ shellenv/protid.c (working copy)
-@@ -628,7 +628,7 @@
- NULL,
- 0,
- 0,
-- FALSE
-+ (SHELL_VAR_CHECK_FLAG_TYPE) FALSE
- }
- };
-
-@@ -1183,7 +1183,7 @@
- *DriverName = LibDevicePathToStr (Image->FilePath);
- }
- } else {
-- LibGetDriverName (DriverBindingHandle, Language, DriverName);
-+ LibGetDriverName (DriverBindingHandle, (CHAR8*)Language, DriverName);
- }
-
- return EFI_SUCCESS;
-@@ -1539,7 +1539,7 @@
-
- DevicePath = NULL;
- BestDeviceName = NULL;
-- Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, &DevicePath);
-+ Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath);
-
- Print (L"\n");
- PrintToken (STRING_TOKEN (STR_SHELLENV_PROTID_CONTROLLER_NAME), HiiEnvHandle);
-@@ -1598,14 +1598,14 @@
- Image = FALSE;
- Status = GetDriverName (
- DriverBindingHandleBuffer[Index],
-- Language,
-+ (UINT8*)Language,
- FALSE,
- &DriverName
- );
- if (DriverName == NULL) {
- Status = GetDriverName (
- DriverBindingHandleBuffer[Index],
-- Language,
-+ (UINT8*)Language,
- TRUE,
- &DriverName
- );
-@@ -1792,7 +1792,7 @@
-
- Status = GetDriverName (
- Handle,
-- Language,
-+ (UINT8*)Language,
- FALSE,
- &DriverName
- );
-@@ -1806,7 +1806,7 @@
-
- Status = GetDriverName (
- Handle,
-- Language,
-+ (UINT8*)Language,
- TRUE,
- &DriverName
- );
-@@ -1979,7 +1979,7 @@
-
- if (Prot->Handles[Index] == Handle) {
- Dump = Verbose ? Prot->DumpInfo : Prot->DumpToken;
-- Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, &Interface);
-+ Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, (VOID**)&Interface);
- if (!EFI_ERROR (Status)) {
- if (Verbose) {
- for (Index1 = 0; Index1 < ProtocolBufferCount; Index1++) {
-@@ -2027,7 +2027,7 @@
- goto Done;
- }
-
-- Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], &Interface);
-+ Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], (VOID**)&Interface);
- if (!EFI_ERROR (Status)) {
- PrintToken (
- STRING_TOKEN (STR_SHELLENV_PROTID_TWO_VARS_HG_NEW),
-@@ -2660,8 +2660,6 @@
-
- --*/
- {
-- EFI_STATUS Status;
--
- DEVICEPATH_INFO *DevicePathInfo;
-
- UINTN Index;
-@@ -2688,7 +2686,7 @@
- //
- // Establish current device path info list
- //
-- Status = LibLocateHandle (
-+ LibLocateHandle (
- ByProtocol,
- Protocol,
- NULL,
-Index: shellenv/parsecmd.h
-===================================================================
---- shellenv/parsecmd.h (revision 64)
-+++ shellenv/parsecmd.h (working copy)
-@@ -103,4 +103,5 @@
- IN OUT SHELL_PARSED_ARGS *args
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-Index: shellenv/ConsoleProxy.c
-===================================================================
---- shellenv/ConsoleProxy.c (revision 64)
-+++ shellenv/ConsoleProxy.c (working copy)
-@@ -1483,7 +1483,7 @@
+diff --git a/shellenv/ConsoleProxy.c b/shellenv/ConsoleProxy.c
+index 15e6bfe..0978251 100644
+--- a/shellenv/ConsoleProxy.c
++++ b/shellenv/ConsoleProxy.c
+@@ -1483,7 +1483,7 @@ ProxyConInFlashState (
if (!EFI_ERROR (TimerStatus)) {
mConInProxy.InputState = INPUT_STATE_DEFAULT;
@@ -4296,7 +8434,7 @@ Index: shellenv/ConsoleProxy.c
mConInProxy.TwoSecondTimeOut,
TimerCancel,
0
-@@ -1496,9 +1496,11 @@
+@@ -1496,9 +1496,11 @@ ProxyConInFlashState (
(UINT64) 20000000
);
mConInProxy.InputState = INPUT_STATE_ESC;
@@ -4309,11 +8447,72 @@ Index: shellenv/ConsoleProxy.c
}
EFI_STATUS
-Index: shellenv/conio.c
-===================================================================
---- shellenv/conio.c (revision 64)
-+++ shellenv/conio.c (working copy)
-@@ -889,7 +889,7 @@
+diff --git a/shellenv/batch.c b/shellenv/batch.c
+index 24fef35..f725630 100644
+--- a/shellenv/batch.c
++++ b/shellenv/batch.c
+@@ -2388,7 +2388,6 @@ Returns:
+
+ --*/
+ {
+- BOOLEAN EndOfFile;
+ EFI_STATUS Status;
+ UINTN BufSize;
+ CHAR16 *CommandLine;
+@@ -2396,7 +2395,6 @@ Returns:
+ EFI_BATCH_STATEMENT *Stmt;
+ ENV_SHELL_INTERFACE NewShell;
+ UINTN GotoTargetStatus;
+- UINTN SkippedIfCount;
+ BOOLEAN EchoStateValid;
+ BOOLEAN EchoState;
+ EFI_STATUS ExecuteResult;
+@@ -2409,7 +2407,6 @@ Returns:
+ // Initialize
+ //
+ Status = EFI_SUCCESS;
+- EndOfFile = FALSE;
+ BufSize = 0;
+ EchoStateValid = FALSE;
+ EchoState = FALSE;
+@@ -2468,14 +2465,6 @@ Returns:
+ EFI_BATCH_SCRIPT_SIGNATURE
+ );
+
+- //
+- // Iterate through the file, reading a line at a time and executing each
+- // line as a shell command. Nested shell scripts will come through
+- // this code path recursively.
+- //
+- EndOfFile = FALSE;
+- SkippedIfCount = 0;
+-
+ while (1) {
+ //
+ // Read a command line from the file
+@@ -2681,7 +2670,7 @@ Returns:
+ LastError = ExecuteResult;
+ }
+
+- if (ExecuteResult == -1) {
++ if (ExecuteResult == (EFI_STATUS) -1) {
+ SE2->DecrementShellNestingLevel ();
+ if (SE2->IsRootShell ()) {
+ goto Done;
+@@ -2774,7 +2763,7 @@ Done:
+ Status = _ResumePreviousMode ();
+ }
+
+- if (LastError == -1) {
++ if (LastError == (UINTN) -1) {
+ return LastError;
+ } else {
+ return Status;
+diff --git a/shellenv/conio.c b/shellenv/conio.c
+index 2c963f5..8da67a1 100644
+--- a/shellenv/conio.c
++++ b/shellenv/conio.c
+@@ -889,7 +889,7 @@ Returns:
//
// If we need to update the output do so now
//
@@ -4322,76 +8521,58 @@ Index: shellenv/conio.c
if ((ConOut->Mode->CursorColumn != (INT32) Column) || (ConOut->Mode->CursorRow != (INT32) Row)) {
PrintAt (Column, Row, L"%s%.*s", Str + Update, Delete, L"");
} else {
-Index: shellenv/map.c
-===================================================================
---- shellenv/map.c (revision 64)
-+++ shellenv/map.c (working copy)
-@@ -185,7 +185,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+diff --git a/shellenv/dprot.c b/shellenv/dprot.c
+index 91faa50..9042b72 100644
+--- a/shellenv/dprot.c
++++ b/shellenv/dprot.c
+@@ -23,7 +23,7 @@ Revision History
-@@ -206,7 +206,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+ #include "shelle.h"
+ #include "shellenvguid.h"
+-#include "acpi.h"
++#include "Acpi.h"
-@@ -2038,13 +2038,13 @@
- goto Done;
- }
+ STATIC CHAR16 *SEnvDP_IlleagalStr[] = { L"Illegal" };
-- Status = BS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, &BlockIo);
-+ Status = BS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlockIo);
- //
- // This is just for NT32, because fsntx has no block io protocol installed
- // but fsntx has installed simple file system protocol
- //
- if (EFI_ERROR (Status)) {
-- Status = BS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, &BlockIo);
-+ Status = BS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&BlockIo);
- }
+@@ -328,7 +328,6 @@ Returns:
+ I2O_DEVICE_PATH *I2ODevicePath;
+ MAC_ADDR_DEVICE_PATH *MacAddrDevicePath;
+ IPv4_DEVICE_PATH *IPv4DevicePath;
+- IPv6_DEVICE_PATH *IPv6DevicePath;
+ INFINIBAND_DEVICE_PATH *InfinibandDevicePath;
+ UART_DEVICE_PATH *UartDevicePath;
+ VENDOR_DEVICE_PATH *VendorDevicePath;
+@@ -464,7 +463,6 @@ Returns:
+ break;
- if (EFI_ERROR (Status)) {
-@@ -2630,7 +2630,6 @@
- UINTN Index;
- UINTN HandleNo;
- BOOLEAN EchoStatus;
-- BOOLEAN Same;
- CHAR16 MapStr[8];
- EFI_LIST_ENTRY *Link;
- EFI_LIST_ENTRY *Head;
-@@ -2729,11 +2728,6 @@
- }
+ case MSG_IPv6_DP:
+- IPv6DevicePath = (IPv6_DEVICE_PATH *) DevicePath;
+ PrintToken (STRING_TOKEN (STR_SHELLENV_DPROT_NOT_AVAIL), HiiEnvHandle);
+ break;
+
+@@ -1054,6 +1052,8 @@ Returns:
+ Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
+ } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_X64) {
+ Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
++ } else if (NtHdr->FileHeader.Machine == EFI_IMAGE_MACHINE_AARCH64) {
++ Magic = EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
+ } else {
+ Magic = NtHdr->OptionalHeader.Magic;
+ }
+@@ -1294,6 +1294,8 @@ Returns:
+ case EfiIsaAcpiResourceInterrupt:
+ PrintToken (STRING_TOKEN (STR_SHELLENV_DPROT_INT), HiiEnvHandle);
+ break;
++ case EfiIsaAcpiResourceEndOfList:
++ return;
}
- }
-- //
-- // New code, try to make mapping list sequence unchanged if current device
-- // paths and original device paths are the same
-- //
-- Same = FALSE;
- //
- // Load handle table and handle protocol info so that we can get
-@@ -3410,4 +3404,4 @@
- FreePool (HistoryNode->DevicePath);
- FreePool (HistoryNode);
- }
--}
-\ No newline at end of file
-+}
-Index: shellenv/pause.c
-===================================================================
---- shellenv/pause.c (revision 64)
-+++ shellenv/pause.c (working copy)
-@@ -47,7 +47,7 @@
+ if (IsaIo->ResourceList->ResourceItem[Index].StartRange == IsaIo->ResourceList->ResourceItem[Index].EndRange) {
+diff --git a/shellenv/echo.c b/shellenv/echo.c
+index 52b5464..9cf3482 100644
+--- a/shellenv/echo.c
++++ b/shellenv/echo.c
+@@ -52,7 +52,7 @@ SHELL_VAR_CHECK_ITEM EchoCheckList[] = {
NULL,
0,
0,
@@ -4400,11 +8581,11 @@ Index: shellenv/pause.c
}
};
-Index: shellenv/exec.c
-===================================================================
---- shellenv/exec.c (revision 64)
-+++ shellenv/exec.c (working copy)
-@@ -105,7 +105,7 @@
+diff --git a/shellenv/exec.c b/shellenv/exec.c
+index a6c1b73..5e4ea8e 100644
+--- a/shellenv/exec.c
++++ b/shellenv/exec.c
+@@ -105,7 +105,7 @@ SHELL_VAR_CHECK_ITEM RedirCheckList[] = {
NULL,
0,
0,
@@ -4413,7 +8594,7 @@ Index: shellenv/exec.c
}
};
-@@ -126,7 +126,7 @@
+@@ -126,7 +126,7 @@ SHELL_VAR_CHECK_ITEM ExitCheckList[] = {
NULL,
0,
0,
@@ -4422,7 +8603,7 @@ Index: shellenv/exec.c
}
};
-@@ -1270,7 +1270,6 @@
+@@ -1270,7 +1270,6 @@ Returns:
SHELLENV_INTERNAL_COMMAND InternalCommand;
EFI_HANDLE NewImage;
EFI_FILE_HANDLE Script;
@@ -4430,7 +8611,7 @@ Index: shellenv/exec.c
BOOLEAN ConsoleContextSaved;
EFI_HANDLE SavedConsoleInHandle;
EFI_HANDLE SavedConsoleOutHandle;
-@@ -1292,7 +1291,6 @@
+@@ -1292,7 +1291,6 @@ Returns:
//
Status = EFI_SUCCESS;
ParentShell = NULL;
@@ -4438,7 +8619,7 @@ Index: shellenv/exec.c
ConsoleContextSaved = FALSE;
SavedConIn = NULL;
SavedConOut = NULL;
-@@ -1557,7 +1555,7 @@
+@@ -1557,7 +1555,7 @@ Returns:
);
EFI_SHELL_APP_INIT (ParentImageHandle, ParentSystemTable);
@@ -4447,7 +8628,7 @@ Index: shellenv/exec.c
//
// if status = -2 we assume that a nested shell has just exited.
//
-@@ -1613,7 +1611,9 @@
+@@ -1613,7 +1611,9 @@ Returns:
Done:
DEBUG_CODE (
if (EFI_ERROR (Status) && Output) {
@@ -4458,7 +8639,7 @@ Index: shellenv/exec.c
|| (Status == EFI_REDIRECTION_SAME)) {
} else {
PrintToken (STRING_TOKEN (STR_SHELLENV_EXEC_EXIT_STATUS_CODE), HiiEnvHandle, Status);
-@@ -1674,7 +1674,7 @@
+@@ -1674,7 +1674,7 @@ Done:
PrintToken (STRING_TOKEN (STR_SHELLENV_REDIR_NOT_ALLOWED), HiiEnvHandle);
}
@@ -4467,7 +8648,7 @@ Index: shellenv/exec.c
//
// Don't Print on a "Disconnect All" exit. The ConOut device may not exist
//
-@@ -1872,7 +1872,7 @@
+@@ -1872,7 +1872,7 @@ Returns:
return Status;
}
//
@@ -4476,7 +8657,7 @@ Index: shellenv/exec.c
//
if (PathPos != -1 && Ptr1 == NULL) {
return Status;
-@@ -2638,7 +2638,6 @@
+@@ -2638,7 +2638,6 @@ Returns:
EFI_STATUS Status;
CHAR16 *Alias;
CHAR16 *SubstituteStr;
@@ -4484,7 +8665,7 @@ Index: shellenv/exec.c
BOOLEAN Literal;
BOOLEAN Comment;
BOOLEAN IsVariable;
-@@ -2735,7 +2734,6 @@
+@@ -2735,7 +2734,6 @@ Returns:
// Try to find a shell enviroment variable
//
QuoteCount = 0;
@@ -4492,11 +8673,11 @@ Index: shellenv/exec.c
SubstituteStr = Str + 1;
while (*SubstituteStr != '%' && *SubstituteStr != 0 && (!IsWhiteSpace (*SubstituteStr) || ParseState->Quote)) {
if (*SubstituteStr == '"') {
-Index: shellenv/for.c
-===================================================================
---- shellenv/for.c (revision 64)
-+++ shellenv/for.c (working copy)
-@@ -24,7 +24,7 @@
+diff --git a/shellenv/for.c b/shellenv/for.c
+index 99664ad..93ab1f2 100644
+--- a/shellenv/for.c
++++ b/shellenv/for.c
+@@ -24,7 +24,7 @@ Revision History
#include "shelle.h"
#include "shellenvguid.h"
@@ -4505,7 +8686,7 @@ Index: shellenv/for.c
BOOLEAN
CheckInterValue (
IN CHAR16 *wszValueStr,
-@@ -190,7 +190,7 @@
+@@ -190,7 +190,7 @@ Arguments:
Returns:
EFI_SUCCESS The function finished sucessfully
@@ -4514,7 +8695,7 @@ Index: shellenv/for.c
{
EFI_BATCH_STATEMENT *Stmt;
EFI_LIST_ENTRY FileList;
-@@ -326,7 +326,8 @@
+@@ -326,7 +326,8 @@ Done:
return Status;
}
@@ -4524,11 +8705,11 @@ Index: shellenv/for.c
EFI_STATUS
SEnvCmdForRun (
IN EFI_HANDLE hImageHandle,
-Index: shellenv/help.c
-===================================================================
---- shellenv/help.c (revision 64)
-+++ shellenv/help.c (working copy)
-@@ -52,7 +52,7 @@
+diff --git a/shellenv/help.c b/shellenv/help.c
+index b5e1673..ecb52fd 100644
+--- a/shellenv/help.c
++++ b/shellenv/help.c
+@@ -52,7 +52,7 @@ SHELL_VAR_CHECK_ITEM HelpCheckList[] = {
NULL,
0,
0,
@@ -4537,48 +8718,47 @@ Index: shellenv/help.c
}
};
-Index: shellenv/var.c
-===================================================================
---- shellenv/var.c (revision 64)
-+++ shellenv/var.c (working copy)
-@@ -110,7 +110,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-@@ -144,7 +144,6 @@
- EFI_LIST_ENTRY *ListHead;
- VARIABLE_ID *Var;
- EFI_STATUS Status;
-- BOOLEAN IsString;
- UINT32 Attributes;
-
- //
-@@ -175,15 +174,12 @@
- // See if it's a shellenv variable
+diff --git a/shellenv/if.c b/shellenv/if.c
+index c6f0f51..766e6fb 100644
+--- a/shellenv/if.c
++++ b/shellenv/if.c
+@@ -59,7 +59,6 @@ Returns:
+ BOOLEAN ExistNot;
+ UINTN NotPos;
+ BOOLEAN ExistI;
+- UINTN IPos;
+ EFI_STATUS Status;
+ CHAR16 *FileName;
+ BOOLEAN FileExists;
+@@ -122,10 +121,8 @@ Returns:
//
- ListHead = NULL;
-- IsString = FALSE;
- if (CompareGuid (&Id, &SEnvEnvId) == 0) {
- ListHead = &SEnvEnv;
-- IsString = TRUE;
- }
-
- if (CompareGuid (&Id, &SEnvAliasId) == 0) {
- ListHead = &SEnvAlias;
-- IsString = TRUE;
+ if ((StriCmp (SI->Argv[1], L"/i") == 0)) {
+ ExistI = TRUE;
+- IPos = 1;
+ } else {
+ ExistI = FALSE;
+- IPos = 0;
}
- if (ListHead) {
-Index: reset/reset.c
-===================================================================
---- reset/reset.c (revision 64)
-+++ reset/reset.c (working copy)
-@@ -61,7 +61,7 @@
+ NotPos = ExistI ? 2 : 1;
+diff --git a/shellenv/init.c b/shellenv/init.c
+index dad9002..458c6eb 100644
+--- a/shellenv/init.c
++++ b/shellenv/init.c
+@@ -143,7 +143,7 @@ Returns:
+ Status = BS->HandleProtocol (
+ mOldSEnv->Handle,
+ &ShellEnvProtocol,
+- &(mOldSEnv->Interface)
++ (VOID**)&(mOldSEnv->Interface)
+ );
+ ASSERT (!EFI_ERROR (Status));
+ Status = BS->ReinstallProtocolInterface (
+diff --git a/shellenv/map.c b/shellenv/map.c
+index 3ebf2b4..a595c41 100644
+--- a/shellenv/map.c
++++ b/shellenv/map.c
+@@ -185,7 +185,7 @@ SHELL_VAR_CHECK_ITEM MapCheckList[] = {
NULL,
0,
0,
@@ -4587,532 +8767,7 @@ Index: reset/reset.c
}
};
-Index: reset/reset.h
-===================================================================
---- reset/reset.h (revision 64)
-+++ reset/reset.h (working copy)
-@@ -32,3 +32,4 @@
- }
-
- #endif
-+
-Index: reset/reset.inf
-===================================================================
---- reset/reset.inf (revision 64)
-+++ reset/reset.inf (working copy)
-@@ -40,24 +40,24 @@
-
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- ResetStrings.uni
- Reset.c
- Reset.h
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: touch/touch.c
-===================================================================
---- touch/touch.c (revision 64)
-+++ touch/touch.c (working copy)
-@@ -64,7 +64,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiTouchGuid = EFI_TOUCH_GUID;
- SHELL_VAR_CHECK_ITEM TouchCheckList[] = {
- {
-Index: touch/touch.h
-===================================================================
---- touch/touch.h (revision 64)
-+++ touch/touch.h (working copy)
-@@ -29,4 +29,4 @@
- 0xa16a4695, 0x5815, 0x4d4f, 0xb8, 0xe, 0x6a, 0xf, 0x88, 0xac, 0xdb, 0x6c \
- }
-
--#endif
-\ No newline at end of file
-+#endif
-Index: touch/touch.inf
-===================================================================
---- touch/touch.inf (revision 64)
-+++ touch/touch.inf (working copy)
-@@ -39,23 +39,23 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- TouchStrings.uni
- touch.c
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: Shell.inf
-===================================================================
---- Shell.inf (revision 64)
-+++ Shell.inf (working copy)
-@@ -25,179 +25,189 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- Library\ShellDebug.c
-- Library\DPath.c
-- Library\Init.c
-- Library\Lock.c
-- Library\Str.c
-- Library\IO.c
-- Library\Mem.c
-- Library\Misc.c
-- Library\Data.c
-- Library\RtData.c
-- Library\ShellEnvInt.c
-- Library\Handle.c
-- Library\FileIO.c
-- Library\ConsistMapping.c
-- Library\CRC.c
-- Library\Event.c
-- Library\Perf.c
-- Library\VarCheck.c
-- Library\HiiSupport.c
-+ Library/ShellDebug.c
-+ Library/DPath.c
-+ Library/Init.c
-+ Library/Lock.c
-+ Library/Str.c
-+ Library/IO.c
-+ Library/Mem.c
-+ Library/Misc.c
-+ Library/Data.c
-+ Library/RtData.c
-+ Library/ShellEnvInt.c
-+ Library/Handle.c
-+ Library/FileIO.c
-+ Library/ConsistMapping.c
-+ Library/CRC.c
-+ Library/Event.c
-+ Library/Perf.c
-+ Library/VarCheck.c
-+ Library/HiiSupport.c
-
-- newshell\NshellStrings.uni
-- newshell\init.c
-- newshell\nshell.h
-- newshell\fakehii.c
-+ newshell/NshellStrings.uni
-+ newshell/init.c
-+ newshell/nshell.h
-+ newshell/fakehii.c
-
- ShCommonStrings.uni
-- shellenv\ShellenvHelpStrings.uni
-- shellenv\ShellenvStrings.uni
-- shellenv\ScriptCmdStrings.uni
-- shellenv\ConnectStrings.uni
-- shellenv\EchoStrings.uni
-- shellenv\HelpStrings.uni
-- shellenv\MapStrings.uni
-- shellenv\CdStrings.uni
-- shellenv\DhStrings.uni
-+ shellenv/ShellenvHelpStrings.uni
-+ shellenv/ShellenvStrings.uni
-+ shellenv/ScriptCmdStrings.uni
-+ shellenv/ConnectStrings.uni
-+ shellenv/EchoStrings.uni
-+ shellenv/HelpStrings.uni
-+ shellenv/MapStrings.uni
-+ shellenv/CdStrings.uni
-+ shellenv/DhStrings.uni
-
-- shellenv\cmddisp.c
-- shellenv\connect.c
-- shellenv\data.c
-- shellenv\exec.c
-- shellenv\init.c
-- shellenv\protid.c
-- shellenv\var.c
-- shellenv\conio.c
-- shellenv\consoleproxy.c
-- shellenv\handle.c
-- shellenv\dprot.c
-- shellenv\map.c
-- shellenv\marg.c
-- shellenv\batch.c
-- shellenv\if.c
-- shellenv\goto.c
-- shellenv\echo.c
-- shellenv\pause.c
-- shellenv\for.c
-- shellenv\wait.c
-- shellenv\help.c
-- shellenv\shelle.h
-- shellenv\shellenvguid.h
-- shellenv\parsecmd.c
-- shellenv\shift.c
-+ shellenv/cmddisp.c
-+ shellenv/connect.c
-+ shellenv/data.c
-+ shellenv/exec.c
-+ shellenv/init.c
-+ shellenv/protid.c
-+ shellenv/var.c
-+ shellenv/conio.c
-+ shellenv/consoleproxy.c
-+ shellenv/handle.c
-+ shellenv/dprot.c
-+ shellenv/map.c
-+ shellenv/marg.c
-+ shellenv/batch.c
-+ shellenv/if.c
-+ shellenv/goto.c
-+ shellenv/echo.c
-+ shellenv/pause.c
-+ shellenv/for.c
-+ shellenv/wait.c
-+ shellenv/help.c
-+ shellenv/shelle.h
-+ shellenv/shellenvguid.h
-+ shellenv/parsecmd.c
-+ shellenv/shift.c
-
-- unload\UnloadStrings.uni
-- unload\unload.c
-+ unload/UnloadStrings.uni
-+ unload/unload.c
-
-- attrib\AttribStrings.uni
-- attrib\attrib.c
-- attrib\attrib.h
-+ attrib/AttribStrings.uni
-+ attrib/attrib.c
-+ attrib/attrib.h
-
-- cls\clsstrings.uni
-- cls\cls.c
-+ cls/clsstrings.uni
-+ cls/cls.c
-
-- cp\CpStrings.uni
-- cp\cp.h
-- cp\cp.c
-+ cp/CpStrings.uni
-+ cp/cp.h
-+ cp/cp.c
-
-- date\DateStrings.uni
-- date\date.c
-- date\date.h
-+ date/DateStrings.uni
-+ date/date.c
-+ date/date.h
-
-- load\LoadStrings.uni
-- load\load.c
-- load\load.h
-+ load/LoadStrings.uni
-+ load/load.c
-+ load/load.h
-
-- ls\LsStrings.uni
-- ls\ls.h
-- ls\ls.c
-+ ls/LsStrings.uni
-+ ls/ls.h
-+ ls/ls.c
-
-- mkdir\MkdirStrings.uni
-- mkdir\mkdir.c
-- mkdir\mkdir.h
-+ mkdir/MkdirStrings.uni
-+ mkdir/mkdir.c
-+ mkdir/mkdir.h
-
-- mv\MvStrings.uni
-- mv\mv.c
-- mv\mv.h
-+ mv/MvStrings.uni
-+ mv/mv.c
-+ mv/mv.h
-
-- reset\ResetStrings.uni
-- reset\reset.c
-- reset\reset.h
-+ reset/ResetStrings.uni
-+ reset/reset.c
-+ reset/reset.h
-
-- rm\RmStrings.uni
-- rm\rm.h
-- rm\rm.c
-+ rm/RmStrings.uni
-+ rm/rm.h
-+ rm/rm.c
-
-- type\TypeStrings.uni
-- type\type.c
-- type\type.h
-- time\TimeStrings.uni
-- time\time.c
-- time\time.h
-+ type/TypeStrings.uni
-+ type/type.c
-+ type/type.h
-+ time/TimeStrings.uni
-+ time/time.c
-+ time/time.h
-
-- touch\TouchStrings.uni
-- touch\touch.c
-- touch\touch.h
-+ touch/TouchStrings.uni
-+ touch/touch.c
-+ touch/touch.h
-
-- vol\VolStrings.uni
-- vol\vol.c
-- vol\vol.h
-+ vol/VolStrings.uni
-+ vol/vol.c
-+ vol/vol.h
-
-- ver\VerStrings.uni
-- ver\ver.c
-- ver\ver.h
-+ ver/VerStrings.uni
-+ ver/ver.c
-+ ver/ver.h
-
-- drivers\driversStrings.uni
-- drivers\drivers.c
-- drivers\drivers.h
-+ drivers/driversStrings.uni
-+ drivers/drivers.c
-+ drivers/drivers.h
-
-- drvcfg\DrvcfgStrings.uni
-- drvcfg\drvcfg.c
-- drvcfg\drvcfg.h
-+ drvcfg/DrvcfgStrings.uni
-+ drvcfg/drvcfg.c
-+ drvcfg/drvcfg.h
-
-- drvdiag\DrvdiagStrings.uni
-- drvdiag\drvdiag.c
-- drvdiag\drvdiag.h
-+ drvdiag/DrvdiagStrings.uni
-+ drvdiag/drvdiag.c
-+ drvdiag/drvdiag.h
-
-
-
- [sources.ia32]
-- ver\ia32\ver32.c
-- Library\ia32\math.c
-- Library\ia32\initplat.c
-+ ver/IA32/ver32.c
-+ Library/IA32/math.c
-+ Library/IA32/initplat.c
-
-
- [sources.ipf]
-- ver\ipf\ver64.c
-- Library\ipf\math.c
-- Library\ipf\initplat.c
-- Library\ipf\palproc.s
-- Library\ipf\salpal.c
-+ ver/IPF/ver64.c
-+ Library/IPF/math.c
-+ Library/IPF/initplat.c
-+ Library/IPF/palproc.s
-+ Library/IPF/salpal.c
-
- [sources.EBC]
-- ver\ebc\verEbc.c
-- Library\EBC\math.c
-- Library\EBC\initplat.c
-+ ver/ebc/verEbc.c
-+ Library/Ebc/math.c
-+ Library/Ebc/initplat.c
-
- [sources.x64]
-- ver\ia32\ver32.c
-- Library\ipf\math.c
-- Library\ia32\initplat.c
-+ ver/IA32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-
-+[sources.ARM]
-+ ver/ia32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-+
-+[sources.AARCH64]
-+ ver/ia32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-+
- [includes.common]
- .
-- .\Inc
-- .\ver
-- .\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-+ ./Inc
-+ ./ver
-+ ./Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
- $(DEST_DIR)
-
- [libraries.common]
-@@ -229,4 +239,4 @@
-
-
-
--
-\ No newline at end of file
-+
-Index: IfConfig/IfConfig.inf
-===================================================================
---- IfConfig/IfConfig.inf (revision 64)
-+++ IfConfig/IfConfig.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- IfConfigStrings.uni
- IfConfig.c
- IfConfig.h
-@@ -33,25 +33,24 @@
- ShellNetHelper.h
-
- [includes.common]
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
- EdkProtocolLib
- EfiProtocolLib
- EdkGuidLib
-- EfiDriverLib
-
- [nmake.common]
- C_PROJ_FLAGS = $(C_PROJ_FLAGS)
-Index: IfConfig/ShellNetHelper.h
-===================================================================
---- IfConfig/ShellNetHelper.h (revision 64)
-+++ IfConfig/ShellNetHelper.h (working copy)
-@@ -87,3 +87,4 @@
- IN EFI_HANDLE ChildHandle
- );
- #endif
-+
-Index: IfConfig/IfConfig.c
-===================================================================
---- IfConfig/IfConfig.c (revision 64)
-+++ IfConfig/IfConfig.c (working copy)
-@@ -29,7 +29,7 @@
- //
- #define NIC_ITEM_CONFIG_SIZE sizeof (NIC_IP4_CONFIG_INFO) + sizeof (EFI_IP4_ROUTE_TABLE) * 16
-
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
-
- EFI_GUID EfiIfConfigGuid = EFI_IFCONFIG_GUID;
-
-@@ -75,7 +75,7 @@
+@@ -206,7 +206,7 @@ SHELL_VAR_CHECK_ITEM CdCheckList[] = {
NULL,
0,
0,
@@ -5121,424 +8776,66 @@ Index: IfConfig/IfConfig.c
}
};
-@@ -669,7 +669,7 @@
- Status = BS->LocateProtocol (
- &gEfiHiiConfigRoutingProtocolGuid,
- NULL,
-- &mHiiConfigRouting
-+ (VOID**)&mHiiConfigRouting
- );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
-Index: IfConfig/IfConfig.h
-===================================================================
---- IfConfig/IfConfig.h (revision 64)
-+++ IfConfig/IfConfig.h (working copy)
-@@ -60,3 +60,4 @@
- } ARP_REQUEST;
-
- #endif
-+
-Index: edit/libStatusBar.c
-===================================================================
---- edit/libStatusBar.c (revision 64)
-+++ edit/libStatusBar.c (working copy)
-@@ -157,11 +157,15 @@
- // back up the screen attributes
- //
- Orig = MainEditor.ColorAttributes;
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
- Out->EnableCursor (Out, FALSE);
-- Out->SetAttribute (Out, New.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
-+ );
-
- //
- // clear status bar
-@@ -191,7 +195,10 @@
- //
- // restore the old screen attributes
- //
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
-
- //
- // restore position in edit area
-Index: edit/libFileBuffer.c
-===================================================================
---- edit/libFileBuffer.c (revision 64)
-+++ edit/libFileBuffer.c (working copy)
-@@ -196,8 +196,9 @@
- // backup the old screen attributes
- //
- Orig = MainEditor.ColorAttributes;
-- New.Colors.Foreground = Orig.Colors.Background;
-- New.Colors.Background = Orig.Colors.Foreground;
-+ New.Data = 0;
-+ New.Colors.Foreground = Orig.Colors.Foreground;
-+ New.Colors.Background = Orig.Colors.Background;
-
- //
- // clear the old mouse position
-@@ -235,10 +236,14 @@
- Value
- );
- }
-+
- //
- // set the new mouse position
- //
-- Out->SetAttribute (Out, New.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (New.Colors.Background, New.Colors.Foreground)
-+ );
-
- //
- // clear the old mouse position
-@@ -278,7 +283,10 @@
- //
- // end of HasCharacter
- //
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
- }
- //
- // end of MouseNeedRefresh
-@@ -768,7 +776,7 @@
- Handle = NULL;
- FileSize = 0;
- UnicodeBuffer = NULL;
-- Type = 0;
-+ Type = DEFAULT_TYPE;
-
- //
- // in this function, when you return error ( except EFI_OUT_OF_RESOURCES )
-@@ -2624,15 +2632,9 @@
- VOID
- )
- {
-- EFI_EDITOR_LINE *Line;
- UINTN FRow;
- UINTN FCol;
-
-- //
-- // go to the first column of the line
-- //
-- Line = FileBuffer.CurrentLine;
--
- FRow = FileBuffer.FilePosition.Row;
- FCol = 1;
-
-Index: edit/libtitlebar.h
-===================================================================
---- edit/libtitlebar.h (revision 64)
-+++ edit/libtitlebar.h (working copy)
-@@ -46,3 +46,4 @@
- );
-
- #endif
-+
-Index: edit/libstatusbar.h
-===================================================================
---- edit/libstatusbar.h (revision 64)
-+++ edit/libstatusbar.h (working copy)
-@@ -53,3 +53,4 @@
- );
-
- #endif
-+
-Index: edit/libfilebuffer.h
-===================================================================
---- edit/libfilebuffer.h (revision 64)
-+++ edit/libfilebuffer.h (working copy)
-@@ -209,3 +209,4 @@
- );
-
- #endif
-+
-Index: edit/libInputBar.c
-===================================================================
---- edit/libInputBar.c (revision 64)
-+++ edit/libInputBar.c (working copy)
-@@ -141,8 +141,6 @@
- UINTN Size;
- EFI_STATUS Status;
- BOOLEAN NoDisplay;
-- UINTN Limit;
-- UINTN PromptLen;
-
- //
- // variable initialization
-@@ -162,10 +160,14 @@
- // back up the old screen attributes
- //
- Orig = MainEditor.ColorAttributes;
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
-- Out->SetAttribute (Out, New.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
-+ );
-
- //
- // clear input bar
-@@ -173,22 +175,19 @@
- EditorClearLine (INPUT_BAR_LOCATION);
-
- Out->SetCursorPosition (Out, 0, INPUT_BAR_LOCATION - 1);
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBINPUTBAR_MAININPUTBAR), HiiHandle, MainInputBar.Prompt);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gEditHiiHandle, MainInputBar.Prompt);
-
- //
-- // that's the maximum input length that can be displayed on screen
-- //
-- PromptLen = StrLen (MainInputBar.Prompt);
-- Limit = MainEditor.ScreenSize.Column - PromptLen;
--
-- //
- // this is a selection prompt, cursor will stay in edit area
- // actually this is for search , search/replace
- //
- if (StrStr (MainInputBar.Prompt, L"Yes/No")) {
- NoDisplay = TRUE;
- FileBufferRestorePosition ();
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
- } else {
- NoDisplay = FALSE;
- }
-@@ -265,7 +264,10 @@
- //
- // restore screen attributes
- //
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
-
- StatusBarNeedRefresh = TRUE;
-
-Index: edit/libEditor.c
-===================================================================
---- edit/libEditor.c (revision 64)
-+++ edit/libEditor.c (working copy)
-@@ -123,7 +123,7 @@
- Status = BS->HandleProtocol (
- In,
- &gEfiSimplePointerProtocolGuid,
-- &MainEditor.MouseInterface
-+ (VOID**)&MainEditor.MouseInterface
- );
- if (EFI_ERROR (Status)) {
- //
-@@ -146,7 +146,7 @@
- Status = BS->HandleProtocol (
- HandleBuffer[Index],
- &gEfiSimplePointerProtocolGuid,
-- &MainEditor.MouseInterface
-+ (VOID**)&MainEditor.MouseInterface
- );
- if (!EFI_ERROR (Status)) {
- break;
-@@ -169,31 +169,31 @@
- //
- Status = MainTitleBarInit ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TITLEBAR), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TITLEBAR), gEditHiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = MainMenuBarInit ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MAINMENU), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MAINMENU), gEditHiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = MainStatusBarInit ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR), gEditHiiHandle);
- return EFI_LOAD_ERROR;
- }
-
- Status = MainInputBarInit ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR), gEditHiiHandle);
- return EFI_LOAD_ERROR;
+@@ -2038,13 +2038,13 @@ Returns:
+ goto Done;
}
- Status = FileBufferInit ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER), gEditHiiHandle);
- return EFI_LOAD_ERROR;
- }
+- Status = BS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, &BlockIo);
++ Status = BS->HandleProtocol (Handle, &gEfiBlockIoProtocolGuid, (VOID**)&BlockIo);
//
-@@ -234,27 +234,27 @@
+ // This is just for NT32, because fsntx has no block io protocol installed
+ // but fsntx has installed simple file system protocol
//
- Status = MainTitleBarCleanup ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TILEBAR_CLEANUP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_TILEBAR_CLEANUP), gEditHiiHandle);
- }
-
- Status = MainMenuBarCleanup ();
if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_MENUBAR_CLEANUP), gEditHiiHandle);
- }
-
- Status = MainStatusBarCleanup ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_STATUSBAR_CLEANUP), gEditHiiHandle);
+- Status = BS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, &BlockIo);
++ Status = BS->HandleProtocol (Handle, &gEfiSimpleFileSystemProtocolGuid, (VOID**)&BlockIo);
}
- Status = MainInputBarCleanup ();
if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_INPUTBAR_CLEANUP), gEditHiiHandle);
- }
-
- Status = FileBufferCleanup ();
- if (EFI_ERROR (Status)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_LIBEDITOR_FILEBUFFER_CLEANUP), gEditHiiHandle);
+@@ -2630,7 +2630,6 @@ Returns:
+ UINTN Index;
+ UINTN HandleNo;
+ BOOLEAN EchoStatus;
+- BOOLEAN Same;
+ CHAR16 MapStr[8];
+ EFI_LIST_ENTRY *Link;
+ EFI_LIST_ENTRY *Head;
+@@ -2729,11 +2728,6 @@ Returns:
+ }
+ }
}
- //
- // restore old mode
-Index: edit/edit.inf
-===================================================================
---- edit/edit.inf (revision 64)
-+++ edit/edit.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- EditStrings.uni
- editor.h
- editortype.h
-@@ -41,17 +41,17 @@
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: edit/libMenuBar.c
-===================================================================
---- edit/libMenuBar.c (revision 64)
-+++ edit/libMenuBar.c (working copy)
-@@ -189,7 +189,6 @@
- CHAR16 *NameString;
- CHAR16 *FunctionKeyString;
- UINTN BufferSize;
-- EFI_STATUS Status;
+- //
+- // New code, try to make mapping list sequence unchanged if current device
+- // paths and original device paths are the same
+- //
+- Same = FALSE;
//
- // variable initialization
-@@ -220,9 +219,9 @@
- FunctionKeyString = AllocatePool (BufferSize);
-
- #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-- Status = Hii->GetString (Hii, HiiHandle, Item->NameToken, FALSE, NULL, &BufferSize, NameString);
-+ Hii->GetString (Hii, gEditHiiHandle, Item->NameToken, FALSE, NULL, &BufferSize, NameString);
- #else
-- Status = LibGetString (HiiHandle, Item->NameToken, NameString, &BufferSize);
-+ LibGetString (gEditHiiHandle, Item->NameToken, NameString, &BufferSize);
- #endif
-
- Width = max ((StrLen (NameString) + 6), 20);
-@@ -232,9 +231,9 @@
- }
-
- #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
-- Status = Hii->GetString (Hii, HiiHandle, Item->FunctionKeyToken, FALSE, NULL, &BufferSize, FunctionKeyString);
-+ Hii->GetString (Hii, gEditHiiHandle, Item->FunctionKeyToken, FALSE, NULL, &BufferSize, FunctionKeyString);
- #else
-- Status = LibGetString (HiiHandle, Item->FunctionKeyToken, FunctionKeyString, &BufferSize);
-+ LibGetString (gEditHiiHandle, Item->FunctionKeyToken, FunctionKeyString, &BufferSize);
- #endif
- PrintAt (Col - 1, Row - 1, L"%E%s%N %H%s%N ", FunctionKeyString, NameString);
-
-Index: edit/libinputbar.h
-===================================================================
---- edit/libinputbar.h (revision 64)
-+++ edit/libinputbar.h (working copy)
-@@ -44,3 +44,4 @@
- );
-
- #endif
-+
-Index: edit/libeditor.h
-===================================================================
---- edit/libeditor.h (revision 64)
-+++ edit/libeditor.h (working copy)
-@@ -52,3 +52,4 @@
+ // Load handle table and handle protocol info so that we can get
+@@ -3410,4 +3404,4 @@ ClearHistoryMapping (
+ FreePool (HistoryNode->DevicePath);
+ FreePool (HistoryNode);
+ }
+-}
+\ No newline at end of file
++}
+diff --git a/shellenv/parsecmd.h b/shellenv/parsecmd.h
+index b14fb80..494e127 100644
+--- a/shellenv/parsecmd.h
++++ b/shellenv/parsecmd.h
+@@ -103,4 +103,5 @@ DeleteHeadArg (
+ IN OUT SHELL_PARSED_ARGS *args
);
- #endif
+-#endif
+\ No newline at end of file
++#endif
+
-Index: edit/main.c
-===================================================================
---- edit/main.c (revision 64)
-+++ edit/main.c (working copy)
-@@ -34,7 +34,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+EFI_HII_HANDLE gEditHiiHandle;
- #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
- EFI_HII_PROTOCOL *Hii;
- #endif
-@@ -56,7 +56,7 @@
+diff --git a/shellenv/pause.c b/shellenv/pause.c
+index ca67cd3..9088ca6 100644
+--- a/shellenv/pause.c
++++ b/shellenv/pause.c
+@@ -47,7 +47,7 @@ SHELL_VAR_CHECK_ITEM PauseCheckList[] = {
NULL,
0,
0,
@@ -5547,510 +8844,199 @@ Index: edit/main.c
}
};
-@@ -121,13 +121,13 @@
- //
- // There should only be one HII protocol
- //
-- Status = LibLocateProtocol (&gEfiHiiProtocolGuid, &Hii);
-+ Status = LibLocateProtocol (&gEfiHiiProtocolGuid, (VOID**)&Hii);
- if (EFI_ERROR (Status) || NULL == Hii) {
- return EFI_ABORTED;
- }
- #endif
-
-- Status = LibInitializeStrings (&HiiHandle, STRING_ARRAY_NAME, &EfiEditGuid);
-+ Status = LibInitializeStrings (&gEditHiiHandle, STRING_ARRAY_NAME, &EfiEditGuid);
-
- if (EFI_ERROR (Status)) {
- return Status;
-@@ -137,7 +137,7 @@
- if (VarCheckOk != RetCode) {
- switch (RetCode) {
- case VarCheckUnknown:
-- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_UNKNOWN_FLAG), HiiHandle, L"edit", Useful);
-+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_UNKNOWN_FLAG), gEditHiiHandle, L"edit", Useful);
- break;
-
- default:
-@@ -161,10 +161,10 @@
- ChkPck.FlagCount > 2 ||
- (ChkPck.FlagCount == 2 && LibCheckVarGetFlag (&ChkPck, L"-b") == NULL)
- ) {
-- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), HiiHandle, L"edit");
-+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), gEditHiiHandle, L"edit");
- Status = EFI_INVALID_PARAMETER;
- } else {
-- PrintToken (STRING_TOKEN (STR_EDIT_VERBOSE_HELP), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_VERBOSE_HELP), gEditHiiHandle);
- Status = EFI_SUCCESS;
- }
-
-@@ -172,21 +172,21 @@
- }
-
- if (ChkPck.ValueCount > 1) {
-- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), HiiHandle, L"edit");
-+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_TOO_MANY), gEditHiiHandle, L"edit");
- Status = EFI_INVALID_PARAMETER;
- goto done;
+diff --git a/shellenv/protid.c b/shellenv/protid.c
+index 3edca2c..88ebb39 100644
+--- a/shellenv/protid.c
++++ b/shellenv/protid.c
+@@ -628,7 +628,7 @@ SHELL_VAR_CHECK_ITEM DHCheckList[] = {
+ NULL,
+ 0,
+ 0,
+- FALSE
++ (SHELL_VAR_CHECK_FLAG_TYPE) FALSE
}
+ };
- if (ChkPck.ValueCount == 1) {
- if (!IsValidFileName (ChkPck.VarList->VarStr)) {
-- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INVALID_FILE_NAME), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INVALID_FILE_NAME), gEditHiiHandle);
- Status = EFI_INVALID_PARAMETER;
- goto done;
+@@ -1183,7 +1183,7 @@ GetDriverName (
+ *DriverName = LibDevicePathToStr (Image->FilePath);
}
- }
-
- if (SI->RedirArgc != 0) {
-- PrintToken (STRING_TOKEN (STR_EDIT_NOREDIRECT), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_NOREDIRECT), gEditHiiHandle);
- Status = EFI_INVALID_PARAMETER;
- goto done;
- }
-@@ -195,7 +195,7 @@
- if (EFI_ERROR (Status)) {
- Out->ClearScreen (Out);
- Out->EnableCursor (Out, TRUE);
-- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INIT_FAILED), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_INIT_FAILED), gEditHiiHandle);
- goto done;
- }
-
-@@ -240,19 +240,19 @@
- //
- if (Status == EFI_SUCCESS) {
- } else if (Status == EFI_OUT_OF_RESOURCES) {
-- PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), HiiHandle, L"edit");
-+ PrintToken (STRING_TOKEN (STR_SHELLENV_GNC_OUT_RESOURCE), gEditHiiHandle, L"edit");
} else {
- if (Buffer != NULL) {
- if (StrCmp (Buffer, L"") != 0) {
- //
- // print out the status string
- //
-- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_BUFFER), HiiHandle, Buffer);
-+ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_BUFFER), gEditHiiHandle, Buffer);
- } else {
-- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gEditHiiHandle);
- }
- } else {
-- PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), HiiHandle);
-+ PrintToken (STRING_TOKEN (STR_EDIT_MAIN_UNKNOWN_EDITOR_ERR), gEditHiiHandle);
- }
- }
-
-Index: edit/libmenubar.h
-===================================================================
---- edit/libmenubar.h (revision 64)
-+++ edit/libmenubar.h (working copy)
-@@ -85,3 +85,4 @@
- );
-
- #endif
-+
-Index: edit/libMisc.h
-===================================================================
---- edit/libMisc.h (revision 64)
-+++ edit/libMisc.h (working copy)
-@@ -96,3 +96,4 @@
- ) ;
-
- #endif
-+
-Index: edit/editor.h
-===================================================================
---- edit/editor.h (revision 64)
-+++ edit/editor.h (working copy)
-@@ -33,7 +33,7 @@
- #include "libstatusbar.h"
- #include "libinputbar.h"
- #include "libmenubar.h"
--#include "libmisc.h"
-+#include "libMisc.h"
- //
- // This is the generated header file which includes whatever needs to be exported (strings + IFR)
- //
-@@ -43,9 +43,10 @@
- extern BOOLEAN EditorFirst;
- extern BOOLEAN EditorExit;
-
--extern EFI_HII_HANDLE HiiHandle;
-+extern EFI_HII_HANDLE gEditHiiHandle;
- #if (EFI_SPECIFICATION_VERSION < 0x0002000A)
- extern EFI_HII_PROTOCOL *Hii;
- #endif
-
- #endif // _EFI_EDITOR_H_
-+
-Index: edit/libTitleBar.c
-===================================================================
---- edit/libTitleBar.c (revision 64)
-+++ edit/libTitleBar.c (working copy)
-@@ -120,10 +120,15 @@
- // backup the old screen attributes
- //
- Orig = MainEditor.ColorAttributes;
-+
-+ New.Data = 0;
- New.Colors.Foreground = Orig.Colors.Background;
- New.Colors.Background = Orig.Colors.Foreground;
-
-- Out->SetAttribute (Out, New.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (New.Colors.Foreground, New.Colors.Background)
-+ );
-
- //
- // clear the old title bar
-@@ -142,7 +147,10 @@
- );
-
- if (MainEditor.FileBuffer->FileName == NULL) {
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
- FileBufferRestorePosition ();
- return EFI_SUCCESS;
+- LibGetDriverName (DriverBindingHandle, Language, DriverName);
++ LibGetDriverName (DriverBindingHandle, (CHAR8*)Language, DriverName);
}
-@@ -204,7 +212,10 @@
- //
- // restore the old attribute
- //
-- Out->SetAttribute (Out, Orig.Data);
-+ Out->SetAttribute (
-+ Out,
-+ EFI_TEXT_ATTR (Orig.Colors.Foreground, Orig.Colors.Background)
-+ );
- //
- // restore edit area cursor position
-Index: edit/editortype.h
-===================================================================
---- edit/editortype.h (revision 64)
-+++ edit/editortype.h (working copy)
-@@ -28,7 +28,7 @@
- #define EDITOR_NAME L"EFI Editor\0"
- #define EDITOR_VERSION L"0.99\0"
-
--#define EFI_EDITOR_LINE_LIST 'eell'
-+#define EFI_EDITOR_LINE_LIST EFI_SIGNATURE_32 ('e','e','l','l')
-
- #define INSERT_MODE_STR L"INS"
- #define OVERWR_MODE_STR L"OVR"
-@@ -149,8 +149,8 @@
- } EFI_EDITOR_MENU_ITEM;
-
- typedef struct {
-- UINT32 Foreground : 4;
-- UINT32 Background : 4;
-+ UINT8 Foreground : 4;
-+ UINT8 Background : 4;
- } EFI_EDITOR_COLOR_ATTRIBUTES;
-
- typedef union {
-@@ -223,3 +223,4 @@
- } EFI_EDITOR_GLOBAL_EDITOR;
-
- #endif
-+
-Index: SmbiosView/EventLogInfo.c
-===================================================================
---- SmbiosView/EventLogInfo.c (revision 64)
-+++ SmbiosView/EventLogInfo.c (working copy)
-@@ -25,7 +25,7 @@
- #include "PrintInfo.h"
- #include "QueryTable.h"
- #include "EventLogInfo.h"
--#include "smbios.h"
-+#include "Smbios.h"
- #include STRING_DEFINES_FILE
-
- VOID
-Index: SmbiosView/Smbios.h
-===================================================================
---- SmbiosView/Smbios.h (revision 64)
-+++ SmbiosView/Smbios.h (working copy)
-@@ -37,3 +37,4 @@
+ return EFI_SUCCESS;
+@@ -1539,7 +1539,7 @@ Returns:
+ DevicePath = NULL;
+ BestDeviceName = NULL;
+- Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, &DevicePath);
++ Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath);
- #endif
-+
-Index: SmbiosView/EventLogInfo.h
-===================================================================
---- SmbiosView/EventLogInfo.h (revision 64)
-+++ SmbiosView/EventLogInfo.h (working copy)
-@@ -85,3 +85,4 @@
- );
+ Print (L"\n");
+ PrintToken (STRING_TOKEN (STR_SHELLENV_PROTID_CONTROLLER_NAME), HiiEnvHandle);
+@@ -1598,14 +1598,14 @@ Returns:
+ Image = FALSE;
+ Status = GetDriverName (
+ DriverBindingHandleBuffer[Index],
+- Language,
++ (UINT8*)Language,
+ FALSE,
+ &DriverName
+ );
+ if (DriverName == NULL) {
+ Status = GetDriverName (
+ DriverBindingHandleBuffer[Index],
+- Language,
++ (UINT8*)Language,
+ TRUE,
+ &DriverName
+ );
+@@ -1792,7 +1792,7 @@ Returns:
- #endif
-+
-Index: SmbiosView/PrintInfo.c
-===================================================================
---- SmbiosView/PrintInfo.c (revision 64)
-+++ SmbiosView/PrintInfo.c (working copy)
-@@ -26,7 +26,7 @@
- #include "LibSmbiosView.h"
- #include "QueryTable.h"
- #include "EventLogInfo.h"
--#include "smbios.h"
-+#include "Smbios.h"
- #include STRING_DEFINES_FILE
+ Status = GetDriverName (
+ Handle,
+- Language,
++ (UINT8*)Language,
+ FALSE,
+ &DriverName
+ );
+@@ -1806,7 +1806,7 @@ Returns:
- //
-Index: SmbiosView/PrintInfo.h
-===================================================================
---- SmbiosView/PrintInfo.h (revision 64)
-+++ SmbiosView/PrintInfo.h (working copy)
-@@ -199,3 +199,4 @@
- );
+ Status = GetDriverName (
+ Handle,
+- Language,
++ (UINT8*)Language,
+ TRUE,
+ &DriverName
+ );
+@@ -1979,7 +1979,7 @@ Returns:
- #endif
-+
-Index: SmbiosView/QueryTable.c
-===================================================================
---- SmbiosView/QueryTable.c (revision 64)
-+++ SmbiosView/QueryTable.c (working copy)
-@@ -23,7 +23,7 @@
- #include "EfiShellLib.h"
- #include "QueryTable.h"
- #include "PrintInfo.h"
--#include "smbios.h"
-+#include "Smbios.h"
+ if (Prot->Handles[Index] == Handle) {
+ Dump = Verbose ? Prot->DumpInfo : Prot->DumpToken;
+- Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, &Interface);
++ Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, (VOID**)&Interface);
+ if (!EFI_ERROR (Status)) {
+ if (Verbose) {
+ for (Index1 = 0; Index1 < ProtocolBufferCount; Index1++) {
+@@ -2027,7 +2027,7 @@ Returns:
+ goto Done;
+ }
- #include STRING_DEFINES_FILE
+- Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], &Interface);
++ Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], (VOID**)&Interface);
+ if (!EFI_ERROR (Status)) {
+ PrintToken (
+ STRING_TOKEN (STR_SHELLENV_PROTID_TWO_VARS_HG_NEW),
+@@ -2660,8 +2660,6 @@ Returns:
-Index: SmbiosView/LibSmbiosView.c
-===================================================================
---- SmbiosView/LibSmbiosView.c (revision 64)
-+++ SmbiosView/LibSmbiosView.c (working copy)
-@@ -22,10 +22,10 @@
--*/
+ {
+- EFI_STATUS Status;
+-
+ DEVICEPATH_INFO *DevicePathInfo;
- #include "EfiShellLib.h"
--#include "LIbSmbios.h"
-+#include "LibSmbios.h"
- #include "LibSmbiosView.h"
- #include "smbiosview.h"
--#include "smbios.h"
-+#include "Smbios.h"
- #include STRING_DEFINES_FILE
-
- STATIC UINT8 mInit = 0;
-@@ -62,7 +62,7 @@
+ UINTN Index;
+@@ -2688,7 +2686,7 @@ Returns:
//
- // Get SMBIOS table from System Configure table
+ // Establish current device path info list
//
-- Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &mSmbiosTable);
-+ Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID**)&mSmbiosTable);
-
- if (mSmbiosTable == NULL) {
- PrintToken (STRING_TOKEN (STR_SMBIOSVIEW_LIBSMBIOSVIEW_CANNOT_GET_TABLE), HiiHandle);
-Index: SmbiosView/Smbiosview.inf
-===================================================================
---- SmbiosView/Smbiosview.inf (revision 64)
-+++ SmbiosView/Smbiosview.inf (working copy)
-@@ -25,7 +25,7 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- SmBiosViewStrings.uni
- QueryTable.c
- QueryTable.h
-@@ -43,19 +43,19 @@
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-- $(EFI_SOURCE)\Application\Shell\Inc
-- $(EFI_SOURCE)\Application\Shell\Library
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-+ $(EFI_SOURCE)/Applicatio./Shels/Inc
-+ $(EFI_SOURCE)/Applicatio./Shels/Library
-
- [libraries.common]
- EfiShellLib
-Index: SmbiosView/QueryTable.h
-===================================================================
---- SmbiosView/QueryTable.h (revision 64)
-+++ SmbiosView/QueryTable.h (working copy)
-@@ -437,3 +437,4 @@
+- Status = LibLocateHandle (
++ LibLocateHandle (
+ ByProtocol,
+ Protocol,
+ NULL,
+diff --git a/shellenv/shelle.h b/shellenv/shelle.h
+index 4338a21..88cebd5 100644
+--- a/shellenv/shelle.h
++++ b/shellenv/shelle.h
+@@ -2074,3 +2074,4 @@ SEnvDriverEFIVersionTok (
);
- #endif
+ #endif // _SHELLE_H_
+
-Index: SmbiosView/LibSmbiosView.h
-===================================================================
---- SmbiosView/LibSmbiosView.h (revision 64)
-+++ SmbiosView/LibSmbiosView.h (working copy)
-@@ -128,3 +128,4 @@
- );
+diff --git a/shellenv/shellenvguid.h b/shellenv/shellenvguid.h
+index 6766662..f1a1720 100644
+--- a/shellenv/shellenvguid.h
++++ b/shellenv/shellenvguid.h
+@@ -37,3 +37,4 @@ Revision History
+ extern EFI_HII_HANDLE HiiEnvHandle;
#endif
+
-Index: SmbiosView/smbiosview.c
-===================================================================
---- SmbiosView/smbiosview.c (revision 64)
-+++ SmbiosView/smbiosview.c (working copy)
-@@ -26,7 +26,7 @@
- #include "smbiosview.h"
- #include "PrintInfo.h"
- #include "QueryTable.h"
--#include "smbios.h"
-+#include "Smbios.h"
-
- extern UINT8 STRING_ARRAY_NAME[];
-
-@@ -88,7 +88,7 @@
+diff --git a/shellenv/var.c b/shellenv/var.c
+index cd86769..ae37344 100644
+--- a/shellenv/var.c
++++ b/shellenv/var.c
+@@ -110,7 +110,7 @@ SHELL_VAR_CHECK_ITEM VarCheckList[] = {
NULL,
0,
0,
- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE)0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
}
};
-Index: SmbiosView/LibSmbios.h
-===================================================================
---- SmbiosView/LibSmbios.h (revision 64)
-+++ SmbiosView/LibSmbios.h (working copy)
-@@ -642,3 +642,4 @@
+@@ -144,7 +144,6 @@ Returns:
+ EFI_LIST_ENTRY *ListHead;
+ VARIABLE_ID *Var;
+ EFI_STATUS Status;
+- BOOLEAN IsString;
+ UINT32 Attributes;
+ //
+@@ -175,15 +174,12 @@ Returns:
+ // See if it's a shellenv variable
+ //
+ ListHead = NULL;
+- IsString = FALSE;
+ if (CompareGuid (&Id, &SEnvEnvId) == 0) {
+ ListHead = &SEnvEnv;
+- IsString = TRUE;
+ }
- #endif
-+
-Index: SmbiosView/smbiosview.h
-===================================================================
---- SmbiosView/smbiosview.h (revision 64)
-+++ SmbiosView/smbiosview.h (working copy)
-@@ -84,3 +84,4 @@
- extern UINT8 gShowType;
+ if (CompareGuid (&Id, &SEnvAliasId) == 0) {
+ ListHead = &SEnvAlias;
+- IsString = TRUE;
+ }
- #endif
-+
-Index: guid/guid.inf
-===================================================================
---- guid/guid.inf (revision 64)
-+++ guid/guid.inf (working copy)
-@@ -37,23 +37,23 @@
- FILE_GUID = CBEB01F8-0912-4d87-8A6B-45D02847A405
- COMPONENT_TYPE = APPLICATION
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- GuidStrings.uni
- guid.c
- guid.h
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
- [libraries.common]
- EfiShellLib
- EdkProtocolLib
-Index: guid/guid.c
-===================================================================
---- guid/guid.c (revision 64)
-+++ guid/guid.c (working copy)
-@@ -36,7 +36,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiGuidGuid = EFI_GUID_GUID;
- SHELL_VAR_CHECK_ITEM GuidCheckList[] = {
- {
-@@ -55,7 +55,7 @@
+ if (ListHead) {
+diff --git a/stall/stall.c b/stall/stall.c
+index ccf7451..b05c3a9 100644
+--- a/stall/stall.c
++++ b/stall/stall.c
+@@ -50,7 +50,7 @@ SHELL_VAR_CHECK_ITEM StallCheckList[] = {
NULL,
0,
0,
- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE)0
++ (SHELL_VAR_CHECK_FLAG_TYPE) 0
}
};
-Index: guid/guid.h
-===================================================================
---- guid/guid.h (revision 64)
-+++ guid/guid.h (working copy)
-@@ -31,4 +31,4 @@
- 0x425bff44, 0x1cae, 0x4c27, 0x98, 0x2c, 0x25, 0xc8, 0x74, 0x59, 0xdf, 0xd6 \
- }
-
--#endif
-\ No newline at end of file
-+#endif
-Index: LoadPciRom/LoadPciRom.h
-===================================================================
---- LoadPciRom/LoadPciRom.h (revision 64)
-+++ LoadPciRom/LoadPciRom.h (working copy)
-@@ -30,3 +30,4 @@
+diff --git a/stall/stall.h b/stall/stall.h
+index a326e41..22e2fc1 100644
+--- a/stall/stall.h
++++ b/stall/stall.h
+@@ -30,3 +30,4 @@ Revision History
}
#endif
+
-Index: LoadPciRom/LoadPciRom.inf
-===================================================================
---- LoadPciRom/LoadPciRom.inf (revision 64)
-+++ LoadPciRom/LoadPciRom.inf (working copy)
-@@ -41,23 +41,23 @@
+diff --git a/stall/stall.inf b/stall/stall.inf
+index 58545a5..5b08420 100644
+--- a/stall/stall.inf
++++ b/stall/stall.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
+
[sources.common]
- LoadPciRomStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- LoadPciRom.c
- LoadPciRom.h
-
+ stallStrings.uni
+ stall.c
+ stall.h
+
[includes.common]
.
- ..\Inc
@@ -6078,29 +9064,23 @@ Index: LoadPciRom/LoadPciRom.inf
[libraries.common]
EfiShellLib
-Index: LoadPciRom/LoadPciRom.c
-===================================================================
---- LoadPciRom/LoadPciRom.c (revision 64)
-+++ LoadPciRom/LoadPciRom.c (working copy)
-@@ -24,7 +24,7 @@
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
- #include "EfiShellLib.h"
- #include "LoadPciRom.h"
--#include "Pci22.h"
-+#include "pci22.h"
-
- extern UINT8 STRING_ARRAY_NAME[];
-
-@@ -56,7 +56,7 @@
- );
-
- EFI_HANDLE gMyImageHandle;
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiLoadPciRomGuid = EFI_LOADPCIROM_GUID;
- SHELL_VAR_CHECK_ITEM LPRCheckList[] = {
- {
-@@ -81,7 +81,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeStall
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/time/time.c b/time/time.c
+index 00dd586..6309963 100644
+--- a/time/time.c
++++ b/time/time.c
+@@ -49,7 +49,7 @@ SHELL_VAR_CHECK_ITEM TimeCheckList[] = {
NULL,
0,
0,
@@ -6109,50 +9089,50 @@ Index: LoadPciRom/LoadPciRom.c
}
};
-@@ -377,7 +377,7 @@
- }
-
- if (EfiRomHeader->CompressionType == EFI_PCI_EXPANSION_ROM_HEADER_COMPRESSED) {
-- Status = BS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, &Decompress);
-+ Status = BS->LocateProtocol (&gEfiDecompressProtocolGuid, NULL, (VOID**)&Decompress);
- if (EFI_ERROR (Status)) {
- PrintToken (STRING_TOKEN (STR_LOADPCIROM_DECOMP_NOT_FOUND), HiiHandle);
- SkipImage = TRUE;
-Index: ver/ver.h
-===================================================================
---- ver/ver.h (revision 64)
-+++ ver/ver.h (working copy)
-@@ -37,3 +37,4 @@
- IN EFI_SYSTEM_TABLE *SystemTable
+@@ -64,8 +64,8 @@ STATIC
+ BOOLEAN
+ GetNumber (
+ IN CHAR16 *Str,
+- IN OUT INTN *Offset,
+- IN OUT INTN *number,
++ IN OUT UINTN *Offset,
++ IN OUT UINTN *number,
+ IN BOOLEAN GetSecond
);
+
+@@ -296,8 +296,8 @@ STATIC
+ BOOLEAN
+ GetNumber (
+ IN CHAR16 *Str,
+- IN OUT INTN *Offset,
+- IN OUT INTN *Number,
++ IN OUT UINTN *Offset,
++ IN OUT UINTN *Number,
+ IN BOOLEAN GetSecond
+ )
+ {
+diff --git a/time/time.h b/time/time.h
+index e9ff6c9..c273c4f 100644
+--- a/time/time.h
++++ b/time/time.h
+@@ -32,3 +32,4 @@ Revision History
+ }
+
#endif
+
-Index: ver/Ver.inf
-===================================================================
---- ver/Ver.inf (revision 64)
-+++ ver/Ver.inf (working copy)
-@@ -40,33 +40,33 @@
+diff --git a/time/time.inf b/time/time.inf
+index 5181280..ab71d0e 100644
+--- a/time/time.inf
++++ b/time/time.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- VerStrings.uni
- Ver.c
- Ver.h
-
--[sources.ia32,sources.x64]
-- ia32\ver32.c
-+[sources.ia32,sources.x64,sources.ARM,sources.AARCH64]
-+ ia32/ver32.c
-
- [sources.ipf]
-- ipf\ver64.c
-+ IPF/ver64.c
-
- [sources.ebc]
-- ebc\verEbc.c
-+ eb./verEbc.c
+ TimeStrings.uni
+ Time.c
+ Time.h
[includes.common]
.
@@ -6181,213 +9161,55 @@ Index: ver/Ver.inf
[libraries.common]
EfiShellLib
-Index: ver/Ebc/verEbc.c
-===================================================================
---- ver/Ebc/verEbc.c (revision 64)
-+++ ver/Ebc/verEbc.c (working copy)
-@@ -45,7 +45,7 @@
- Status = BS->LocateProtocol (
- &gEfiEbcProtocolGuid,
- NULL,
-- &Ebc
-+ (VOID**)&Ebc
- );
- if (EFI_ERROR (Status)) {
- return ;
-Index: ver/ver.c
-===================================================================
---- ver/ver.c (revision 64)
-+++ ver/ver.c (working copy)
-@@ -57,7 +57,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-Index: dmpstore/dmpstore.h
-===================================================================
---- dmpstore/dmpstore.h (revision 64)
-+++ dmpstore/dmpstore.h (working copy)
-@@ -40,3 +40,4 @@
- } DMPSTORE_VARIABLE;
-
- #endif
-+
-Index: dmpstore/dmpstore.inf
-===================================================================
---- dmpstore/dmpstore.inf (revision 64)
-+++ dmpstore/dmpstore.inf (working copy)
-@@ -25,24 +25,24 @@
- COMPONENT_TYPE = APPLICATION
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- DmpstoreStrings.uni
- dmpstore.c
- dmpstore.h
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: dmpstore/dmpstore.c
-===================================================================
---- dmpstore/dmpstore.c (revision 64)
-+++ dmpstore/dmpstore.c (working copy)
-@@ -95,7 +95,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDmpstoreGuid = EFI_DMPSTORE_GUID;
- SHELL_VAR_CHECK_ITEM DmpstoreCheckList[] = {
- {
-@@ -132,7 +132,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-Index: comp/comp.c
-===================================================================
---- comp/comp.c (revision 64)
-+++ comp/comp.c (working copy)
-@@ -50,7 +50,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-Index: comp/comp.h
-===================================================================
---- comp/comp.h (revision 64)
-+++ comp/comp.h (working copy)
-@@ -29,4 +29,4 @@
- 0x7761e2c2, 0x7297, 0x434d, 0xb6, 0x52, 0xa9, 0x76, 0x91, 0xb8, 0x66, 0xf3 \
- }
-
--#endif
-\ No newline at end of file
-+#endif
-Index: comp/comp.inf
-===================================================================
---- comp/comp.inf (revision 64)
-+++ comp/comp.inf (working copy)
-@@ -28,21 +28,21 @@
- CompStrings.uni
- comp.c
- comp.h
--..\ShCommonStrings.uni
-+../ShCommonStrings.uni
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
- [libraries.common]
- EfiShellLib
-Index: IpConfig/IpConfig.c
-===================================================================
---- IpConfig/IpConfig.c (revision 64)
-+++ IpConfig/IpConfig.c (working copy)
-@@ -39,7 +39,7 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeTime
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/touch/touch.c b/touch/touch.c
+index 0938d34..a5f61b8 100644
+--- a/touch/touch.c
++++ b/touch/touch.c
+@@ -64,7 +64,7 @@ TouchFreeFileArg (
//
// Global Variables
//
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiIpConfigGuid = EFI_IPCONFIG_GUID;
- SHELL_VAR_CHECK_ITEM IpconfigCheckList[] = {
+ EFI_GUID EfiTouchGuid = EFI_TOUCH_GUID;
+ SHELL_VAR_CHECK_ITEM TouchCheckList[] = {
{
-@@ -76,7 +76,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-Index: IpConfig/IpConfig.h
-===================================================================
---- IpConfig/IpConfig.h (revision 64)
-+++ IpConfig/IpConfig.h (working copy)
-@@ -29,4 +29,4 @@
- 0x8252915c, 0xf1e9, 0x435c, 0x81, 0x91, 0xad, 0x2f, 0x82, 0x62, 0x23, 0x73 \
+diff --git a/touch/touch.h b/touch/touch.h
+index 402e7dc..6aceaf5 100644
+--- a/touch/touch.h
++++ b/touch/touch.h
+@@ -29,4 +29,4 @@ Revision History
+ 0xa16a4695, 0x5815, 0x4d4f, 0xb8, 0xe, 0x6a, 0xf, 0x88, 0xac, 0xdb, 0x6c \
}
-#endif
\ No newline at end of file
+#endif
-Index: IpConfig/IpConfig.inf
-===================================================================
---- IpConfig/IpConfig.inf (revision 64)
-+++ IpConfig/IpConfig.inf (working copy)
-@@ -25,24 +25,24 @@
+diff --git a/touch/touch.inf b/touch/touch.inf
+index 5382ff6..8d67f41 100644
+--- a/touch/touch.inf
++++ b/touch/touch.inf
+@@ -39,23 +39,23 @@ FILE_GUID = 2EBB94E8-3792-47bb-8843-4D5ED5B98F28
COMPONENT_TYPE = APPLICATION
[sources.common]
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- IpConfigStrings.uni
- IpConfig.c
- IpConfig.h
-
+ TouchStrings.uni
+ touch.c
+
[includes.common]
.
- ..\Inc
@@ -6415,20 +9237,32 @@ Index: IpConfig/IpConfig.inf
[libraries.common]
EfiShellLib
-Index: sermode/sermode.c
-===================================================================
---- sermode/sermode.c (revision 64)
-+++ sermode/sermode.c (working copy)
-@@ -35,7 +35,7 @@
+@@ -70,6 +70,11 @@ COMPONENT_TYPE = APPLICATION
- #include EFI_PROTOCOL_DEFINITION (SerialIo)
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeTouch
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/type/type.c b/type/type.c
+index 129f911..a4cf59d 100644
+--- a/type/type.c
++++ b/type/type.c
+@@ -59,7 +59,7 @@ BOOLEAN TypeAscii;
+ BOOLEAN TypeUnicode;
+ BOOLEAN TypeAuto;
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiSermodeGuid = EFI_SERMODEB_GUID;
- SHELL_VAR_CHECK_ITEM SermodeCheckList[] = {
+ EFI_GUID EfiTypeGuid = EFI_TYPE_GUID;
+ SHELL_VAR_CHECK_ITEM TypeCheckList[] = {
{
-@@ -54,7 +54,7 @@
+@@ -90,7 +90,7 @@ SHELL_VAR_CHECK_ITEM TypeCheckList[] = {
NULL,
0,
0,
@@ -6437,47 +9271,29 @@ Index: sermode/sermode.c
}
};
-@@ -104,7 +104,7 @@
-
- }
-
-- Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, &SerialIo);
-+ Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
- if (!EFI_ERROR (Status)) {
- switch (SerialIo->Mode->Parity) {
- case DefaultParity:
-@@ -454,7 +454,7 @@
- continue;
- }
-
-- Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, &SerialIo);
-+ Status = BS->HandleProtocol (Handles[Index], &gEfiSerialIoProtocolGuid, (VOID**)&SerialIo);
- if (!EFI_ERROR (Status)) {
- Status = SerialIo->SetAttributes (
- SerialIo,
-Index: sermode/sermode.h
-===================================================================
---- sermode/sermode.h (revision 64)
-+++ sermode/sermode.h (working copy)
-@@ -32,3 +32,4 @@
+diff --git a/type/type.h b/type/type.h
+index b3c170c..f22e566 100644
+--- a/type/type.h
++++ b/type/type.h
+@@ -30,3 +30,4 @@ Revision History
}
#endif
+
-Index: sermode/sermode.inf
-===================================================================
---- sermode/sermode.inf (revision 64)
-+++ sermode/sermode.inf (working copy)
-@@ -40,24 +40,24 @@
+diff --git a/type/type.inf b/type/type.inf
+index efb0a82..0a8e7eb 100644
+--- a/type/type.inf
++++ b/type/type.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
[sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- SermodeStrings.uni
- sermode.c
- sermode.h
-
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ TypeStrings.uni
+ type.c
+ type.h
+
[includes.common]
.
- ..\Inc
@@ -6505,40 +9321,23 @@ Index: sermode/sermode.inf
[libraries.common]
EfiShellLib
-Index: tzone/tzone.c
-===================================================================
---- tzone/tzone.c (revision 64)
-+++ tzone/tzone.c (working copy)
-@@ -65,7 +65,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
-@@ -258,7 +258,6 @@
- BOOLEAN bList;
- BOOLEAN bSet;
- INT16 nValue;
-- UINTN uValueSize;
- SHELL_VAR_CHECK_CODE RetCode;
- CHAR16 *Useful;
- SHELL_VAR_CHECK_PACKAGE ChkPck;
-@@ -269,7 +268,6 @@
- bList = FALSE;
- bSet = FALSE;
- nValue = 0;
-- uValueSize = sizeof (INTN);
- ZeroMem (&ChkPck, sizeof (SHELL_VAR_CHECK_PACKAGE));
- ZeroMem (&Time, sizeof (EFI_TIME));
- //
-Index: tzone/timezone.inf
-===================================================================
---- tzone/timezone.inf (revision 64)
-+++ tzone/timezone.inf (working copy)
-@@ -25,24 +25,24 @@
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeType
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/tzone/timezone.inf b/tzone/timezone.inf
+index 57834c6..f0e8c1d 100644
+--- a/tzone/timezone.inf
++++ b/tzone/timezone.inf
+@@ -25,24 +25,24 @@ FILE_GUID = E27B12B9-2647-4af3-ADBC-B5AB5FB50421
COMPONENT_TYPE = APPLICATION
[sources.common]
@@ -6575,29 +9374,29 @@ Index: tzone/timezone.inf
[libraries.common]
EfiShellLib
-Index: tzone/tzone.h
-===================================================================
---- tzone/tzone.h (revision 64)
-+++ tzone/tzone.h (working copy)
-@@ -35,3 +35,4 @@
- }
-
- #endif
+@@ -62,11 +62,13 @@ COMPONENT_TYPE = APPLICATION
+ # we will specify some additional DEFINEs on the compile command line.
+ #
+ [nmake.common]
+- C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ IMAGE_ENTRY_POINT=InitializeTZone
+
-Index: vol/vol.c
-===================================================================
---- vol/vol.c (revision 64)
-+++ vol/vol.c (working copy)
-@@ -32,7 +32,7 @@
- //
- #include STRING_DEFINES_FILE
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
++ C_PROJ_FLAGS = $(C_PROJ_FLAGS) /Zm500
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiVolGuid = EFI_VOL_GUID;
- SHELL_VAR_CHECK_ITEM VolCheckList[] = {
- {
-@@ -63,7 +63,7 @@
+-
+-
+\ No newline at end of file
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/tzone/tzone.c b/tzone/tzone.c
+index 30cc513..2b6ccdd 100644
+--- a/tzone/tzone.c
++++ b/tzone/tzone.c
+@@ -65,7 +65,7 @@ SHELL_VAR_CHECK_ITEM TzoneCheckList[] = {
NULL,
0,
0,
@@ -6606,61 +9405,36 @@ Index: vol/vol.c
}
};
-Index: vol/vol.h
-===================================================================
---- vol/vol.h (revision 64)
-+++ vol/vol.h (working copy)
-@@ -32,3 +32,4 @@
+@@ -258,7 +258,6 @@ InitializeTZone (
+ BOOLEAN bList;
+ BOOLEAN bSet;
+ INT16 nValue;
+- UINTN uValueSize;
+ SHELL_VAR_CHECK_CODE RetCode;
+ CHAR16 *Useful;
+ SHELL_VAR_CHECK_PACKAGE ChkPck;
+@@ -269,7 +268,6 @@ InitializeTZone (
+ bList = FALSE;
+ bSet = FALSE;
+ nValue = 0;
+- uValueSize = sizeof (INTN);
+ ZeroMem (&ChkPck, sizeof (SHELL_VAR_CHECK_PACKAGE));
+ ZeroMem (&Time, sizeof (EFI_TIME));
+ //
+diff --git a/tzone/tzone.h b/tzone/tzone.h
+index 08e049f..1cc0c2b 100644
+--- a/tzone/tzone.h
++++ b/tzone/tzone.h
+@@ -35,3 +35,4 @@ Revision History
}
#endif
+
-Index: vol/Vol.inf
-===================================================================
---- vol/Vol.inf (revision 64)
-+++ vol/Vol.inf (working copy)
-@@ -40,24 +40,24 @@
-
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- VolStrings.uni
- Vol.c
- Vol.h
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: cp/cp.c
-===================================================================
---- cp/cp.c (revision 64)
-+++ cp/cp.c (working copy)
-@@ -66,7 +66,7 @@
+diff --git a/unload/unload.c b/unload/unload.c
+index 100f16b..5aee387 100644
+--- a/unload/unload.c
++++ b/unload/unload.c
+@@ -66,7 +66,7 @@ SHELL_VAR_CHECK_ITEM UnloadCheckList[] = {
NULL,
0,
0,
@@ -6669,1671 +9443,99 @@ Index: cp/cp.c
}
};
-@@ -578,7 +578,7 @@
- //
- if (SrcArg->Status == EFI_SUCCESS &&
- (SrcArg->Info->Attribute & EFI_FILE_DIRECTORY) &&
-- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstMustDir && DstHandle)
-+ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstMustDir && DstHandle)))
- ) {
- if (StrCmp (SrcFilePath, DstFilePath) == 0) {
- PrintToken (STRING_TOKEN (STR_CP_CANNOT_COPY_ITSELF), HiiCpyHandle, L"cp/copy", SrcArg->FullName);
-@@ -592,7 +592,7 @@
- // we need to compose a full name of dir\file for the source
- //
- if (SrcArg->Status == EFI_SUCCESS &&
-- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstMustDir && DstHandle)) {
-+ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstMustDir && DstHandle)))) {
- if (DstFullName) {
- FreePool (DstFullName);
- }
-@@ -869,7 +869,6 @@
- EFI_STATUS Status;
- EFI_FILE_INFO *SrcInfo;
- EFI_FILE_INFO *DstInfo;
-- EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *DstVol;
- EFI_FILE_SYSTEM_INFO *DstFsInfo;
- CHAR16 InputString[10];
- UINTN BufSize;
-@@ -894,7 +893,6 @@
- SrcInfo = NULL;
- DstInfo = NULL;
- FileInfo = NULL;
-- DstVol = NULL;
- DstFsInfo = NULL;
- InputString[0] = 0;
- BufSize = 0;
-@@ -1789,7 +1787,7 @@
- //
- if (SrcArg->Status == EFI_SUCCESS &&
- !(SrcArg->Info->Attribute & EFI_FILE_DIRECTORY) &&
-- (DstArg->Status == EFI_SUCCESS && (DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || DstDir && DstHandle)
-+ (DstArg->Status == EFI_SUCCESS && ((DstArg->Info->Attribute & EFI_FILE_DIRECTORY) || (DstDir && DstHandle)))
- ) {
- if (DstFullName) {
- FreePool (DstFullName);
-Index: cp/cp.h
-===================================================================
---- cp/cp.h (revision 64)
-+++ cp/cp.h (working copy)
-@@ -67,4 +67,5 @@
- IN EFI_SYSTEM_TABLE *SystemTable
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-Index: cp/cp.inf
-===================================================================
---- cp/cp.inf (revision 64)
-+++ cp/cp.inf (working copy)
-@@ -41,23 +41,23 @@
-
- [sources.common]
- CpStrings.uni
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- cp.h
- cp.c
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
-Index: Library/EfiPart.h
-===================================================================
---- Library/EfiPart.h (revision 64)
-+++ Library/EfiPart.h (working copy)
-@@ -56,3 +56,4 @@
- #pragma pack()
-
- #endif
-+
-Index: Library/X64/efilibplat.h
-===================================================================
---- Library/X64/efilibplat.h (revision 64)
-+++ Library/X64/efilibplat.h (working copy)
-@@ -35,3 +35,4 @@
- #define MIN_ALIGNMENT_SIZE 8
-
- #endif
-+
-Index: Library/ShellEnvInt.h
-===================================================================
---- Library/ShellEnvInt.h (revision 64)
-+++ Library/ShellEnvInt.h (working copy)
-@@ -196,4 +196,6 @@
- VOID
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/LinkedList.h
-===================================================================
---- Library/LinkedList.h (revision 64)
-+++ Library/LinkedList.h (working copy)
-@@ -77,11 +77,10 @@
- }
-
- #define SwapListEntries(Entry1, Entry2) { \
-- EFI_LIST_ENTRY *Entry1Flink, *Entry1Blink; \
-+ EFI_LIST_ENTRY *Entry1Blink; \
- EFI_LIST_ENTRY *Entry2Flink, *Entry2Blink; \
- Entry2Flink = (Entry2)->Flink; \
- Entry2Blink = (Entry2)->Blink; \
-- Entry1Flink = (Entry1)->Flink; \
- Entry1Blink = (Entry1)->Blink; \
- Entry2Blink->Flink = Entry2Flink; \
- Entry2Flink->Blink = Entry2Blink; \
-@@ -100,3 +99,4 @@
- // A lock structure
- //
- #endif
-+
-Index: Library/IO.c
-===================================================================
---- Library/IO.c (revision 64)
-+++ Library/IO.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- #define PRINT_STRING_LEN 1024
- #define PRINT_ITEM_BUFFER_LEN 100
-@@ -86,8 +86,8 @@
- typedef struct {
- BOOLEAN PageBreak;
- BOOLEAN AutoWrap;
-- INTN MaxRow;
-- INTN MaxColumn;
-+ UINTN MaxRow;
-+ UINTN MaxColumn;
- INTN InitRow;
- INTN Row;
- INTN Column;
-@@ -1575,7 +1575,7 @@
- {
- BOOLEAN Done;
- UINTN Column;
-- INTN Row;
-+ UINTN Row;
- UINTN StartColumn;
- UINTN Update;
- UINTN Delete;
-@@ -1769,7 +1769,7 @@
- //
- // If we need to update the output do so now
- //
-- if (Update != -1) {
-+ if (Update != (UINTN) -1) {
- PrintAt (Column, Row, L"%s%.*s", InStr + Update, Delete, L"");
- Len = StrLen (InStr);
-
-@@ -1928,8 +1928,8 @@
- return mPrintMode.PageBreak;
- }
-
-+#if 0
- STATIC
--
- BOOLEAN
- GetOutputPause (
- VOID
-@@ -1937,6 +1937,7 @@
- {
- return mPrintMode.OutputPause;
- }
-+#endif
-
- INTN
- DbgPrint (
-Index: Library/FileIO.c
-===================================================================
---- Library/FileIO.c (revision 64)
-+++ Library/FileIO.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- typedef struct _PATH_COMPONENTS {
- CHAR16 *Name;
-@@ -719,7 +719,6 @@
- IN OUT CHAR16 **Path
- )
- {
-- EFI_STATUS Status;
- CHAR16 *p;
- UINTN Size;
-
-@@ -728,7 +727,6 @@
-
- *Fs = NULL;
- *Path = NULL;
-- Status = EFI_SUCCESS;
-
- p = AbPath;
- while (*p) {
-@@ -1017,13 +1015,11 @@
- EFI_LIST_ENTRY SrcList;
- EFI_LIST_ENTRY DstList;
- EFI_STATUS Status;
-- EFI_LIST_ENTRY *Link;
- SHELL_FILE_ARG *SrcArg;
- SHELL_FILE_ARG *DstArg;
-
- ASSERT (IsSame != NULL);
-
-- Link = NULL;
- SrcArg = NULL;
- DstArg = NULL;
- InitializeListHead (&SrcList);
-Index: Library/Aarch64/efilibplat.h
-===================================================================
---- Library/Aarch64/efilibplat.h (revision 0)
-+++ Library/Aarch64/efilibplat.h (revision 0)
-@@ -0,0 +1,38 @@
-+/*++
-+
-+Copyright (c) 2005, 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:
-+
-+ efilibplat.h
-+
-+Abstract:
-+
-+ EFI to compile bindings
-+
-+
-+
-+Revision History
-+
-+--*/
-+
-+#ifndef _EFI_LIB_PLAT_H
-+#define _EFI_LIB_PLAT_H
-+
-+VOID
-+InitializeLibPlatform (
-+ IN EFI_HANDLE ImageHandle,
-+ IN EFI_SYSTEM_TABLE *SystemTable
-+ );
-+
-+#define MIN_ALIGNMENT_SIZE 8
-+
-+#endif
-+
-Index: Library/Ebc/EfiLibPlat.h
-===================================================================
---- Library/Ebc/EfiLibPlat.h (revision 64)
-+++ Library/Ebc/EfiLibPlat.h (working copy)
-@@ -44,3 +44,4 @@
- ;
-
- #define MIN_ALIGNMENT_SIZE 8
-+
-Index: Library/Str.c
-===================================================================
---- Library/Str.c (revision 64)
-+++ Library/Str.c (working copy)
-@@ -22,7 +22,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- INTN
- StrCmp (
-@@ -421,7 +421,7 @@
- return (UINTN) -1;
- }
-
-- u = u << 4 | c - (c >= 'A' ? 'A' - 10 : '0');
-+ u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
- } else {
- break;
+@@ -110,7 +110,7 @@ _UnloadGetDriverName (
+ *DriverName = LibDevicePathToStr (Image->FilePath);
}
-@@ -472,7 +472,7 @@
- c = *(str++);
- while (c) {
- if (c >= '0' && c <= '9') {
-- if (u > m || u == m && c - '0' > (INTN) n) {
-+ if ((u > m) || ((u == m) && (c - '0' > (INTN) n))) {
- return (UINTN) -1;
- }
-
-Index: Library/Data.c
-===================================================================
---- Library/Data.c (revision 64)
-+++ Library/Data.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- //
- // ShellLibInitialized - TRUE once InitializeShellLib() is called for the first time
-Index: Library/IO.h
-===================================================================
---- Library/IO.h (revision 64)
-+++ Library/IO.h (working copy)
-@@ -157,4 +157,6 @@
- );
-
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/FileIO.h
-===================================================================
---- Library/FileIO.h (revision 64)
-+++ Library/FileIO.h (working copy)
-@@ -208,4 +208,6 @@
- IN SIMPLE_READ_FILE SimpleReadHandle
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/Str.h
-===================================================================
---- Library/Str.h (revision 64)
-+++ Library/Str.h (working copy)
-@@ -248,3 +248,4 @@
- );
-
- #endif
-+
-Index: Library/Mem.c
-===================================================================
---- Library/Mem.c (revision 64)
-+++ Library/Mem.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- VOID
- SetMem (
-Index: Library/RtData.c
-===================================================================
---- Library/RtData.c (revision 64)
-+++ Library/RtData.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- //
- // RT - pointer to the runtime table
-Index: Library/Event.c
-===================================================================
---- Library/Event.c (revision 64)
-+++ Library/Event.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- EFI_EVENT
- LibCreateProtocolNotifyEvent (
-Index: Library/Mem.h
-===================================================================
---- Library/Mem.h (revision 64)
-+++ Library/Mem.h (working copy)
-@@ -73,4 +73,6 @@
- IN UINTN Size
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/Event.h
-===================================================================
---- Library/Event.h (revision 64)
-+++ Library/Event.h (working copy)
-@@ -50,4 +50,6 @@
- OUT EFI_INPUT_KEY *Key
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/EfiShellLib.h
-===================================================================
---- Library/EfiShellLib.h (revision 64)
-+++ Library/EfiShellLib.h (working copy)
-@@ -25,7 +25,7 @@
- #define _EFI_SHELL_LIB_INCLUDE_
-
- #include "Tiano.h"
--#include "ShellEnv.h"
-+#include "shellenv.h"
- #include "pci22.h"
-
- #include EFI_ARCH_PROTOCOL_DEFINITION (Bds)
-@@ -51,7 +51,7 @@
- #include EFI_GUID_DEFINITION (PrimaryConsoleOutDevice)
- #include EFI_GUID_DEFINITION (PrimaryStandardErrorDevice)
- #include EFI_GUID_DEFINITION (SalSystemTable)
--#include EFI_GUID_DEFINITION (Smbios)
-+#include EFI_GUID_DEFINITION (SmBios)
- #include EFI_GUID_DEFINITION (StandardErrorDevice)
- #include EFI_GUID_DEFINITION (FrameworkDevicePath)
- #include EFI_PROTOCOL_DEFINITION (AbsolutePointer)
-@@ -67,7 +67,7 @@
- #include EFI_PROTOCOL_DEFINITION (DebugPort)
- #include EFI_PROTOCOL_DEFINITION (DebugSupport)
- #include EFI_PROTOCOL_DEFINITION (Decompress)
--#include EFI_PROTOCOL_DEFINITION (DeviceIO)
-+#include EFI_PROTOCOL_DEFINITION (DeviceIo)
- #include EFI_PROTOCOL_DEFINITION (DevicePath)
- #include EFI_PROTOCOL_DEFINITION (DevicePathFromText)
- #include EFI_PROTOCOL_DEFINITION (DevicePathToText)
-@@ -111,7 +111,7 @@
- #include EFI_PROTOCOL_DEFINITION (PciRootBridgeIo)
- #include EFI_PROTOCOL_DEFINITION (PlatformDriverOverride)
- #include EFI_PROTOCOL_DEFINITION (PxeBaseCode)
--#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallback)
-+#include EFI_PROTOCOL_DEFINITION (PxeBaseCodeCallBack)
- #include EFI_PROTOCOL_DEFINITION (ScsiIo)
- #include EFI_PROTOCOL_DEFINITION (ScsiPassThru)
- #include EFI_PROTOCOL_DEFINITION (SectionExtraction)
-@@ -152,7 +152,7 @@
- #include EFI_PROTOCOL_DEFINITION (PlatformToDriverConfiguration)
-
- #include "efilibplat.h"
--#include "efipart.h"
-+#include "EfiPart.h"
- #include "ShellDebug.h"
- #include "CRC.h"
- #include "DPath.h"
-@@ -358,3 +358,4 @@
- );
-
- #endif
-+
-Index: Library/Handle.c
-===================================================================
---- Library/Handle.c (revision 64)
-+++ Library/Handle.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- EFI_STATUS
- LibLocateHandle (
-@@ -131,7 +131,6 @@
- EFI_HANDLE *BlockIoBuffer;
- EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- UINTN Index;
-- EFI_DEVICE_PATH_PROTOCOL *Start;
- EFI_DEVICE_PATH_PROTOCOL *Next;
- EFI_DEVICE_PATH_PROTOCOL *DevPath;
- HARDDRIVE_DEVICE_PATH *HardDriveDevicePath;
-@@ -204,7 +203,6 @@
- PreviousNodeIsHardDriveDevicePath = FALSE;
-
- DevPath = DevicePath;
-- Start = DevPath;
- //
- // Check for end of device path type
- //
-@@ -796,14 +794,12 @@
- UINTN OpenInfoIndex;
- UINTN ChildIndex;
- BOOLEAN DriverBindingHandleIndexValid;
-- BOOLEAN ControllerHandleIndexValid;
-
- DriverBindingHandleIndexValid = FALSE;
- if (DriverBindingHandleIndex != NULL) {
- *DriverBindingHandleIndex = 0xffffffff;
+ } else {
+- LibGetDriverName(DriverBindingHandle, Language, DriverName);
++ LibGetDriverName(DriverBindingHandle, (CHAR8*)Language, DriverName);
}
-- ControllerHandleIndexValid = FALSE;
- if (ControllerHandleIndex != NULL) {
- *ControllerHandleIndex = 0xffffffff;
- }
-@@ -847,7 +843,6 @@
+ return EFI_SUCCESS;
+@@ -184,7 +184,7 @@ Returns:
- if (ControllerHandle != NULL && ControllerHandleIndex != NULL && (*HandleBuffer)[HandleIndex] == ControllerHandle) {
- *ControllerHandleIndex = (UINT32) HandleIndex;
-- ControllerHandleIndexValid = TRUE;
- }
+ DevicePath = NULL;
+ BestDeviceName = NULL;
+- Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, &DevicePath);
++ Status = BS->HandleProtocol (Handle, &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath);
- }
-@@ -1305,7 +1300,7 @@
- Status = BS->HandleProtocol (
- Handles[Index],
- ProtocolGuid,
-- Interface
-+ (VOID**)Interface
+ Print (L"\n");
+ PrintToken (STRING_TOKEN (STR_UNLOAD_CONTROLLER_NAME), HiiUnloadHandle);
+@@ -242,14 +242,14 @@ Returns:
+ Image = FALSE;
+ Status = _UnloadGetDriverName (
+ DriverBindingHandleBuffer[Index],
+- Language,
++ (UINT8*)Language,
+ FALSE,
+ &DriverName
);
-
- if (!EFI_ERROR (Status)) {
-Index: Library/Misc.c
-===================================================================
---- Library/Misc.c (revision 64)
-+++ Library/Misc.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- #if (PLATFORM == NT32)
- #define LOCAL_EFI_WIN_NT_THUNK_PROTOCOL_GUID \
-@@ -348,7 +348,7 @@
- ASSERT (Buffer != NULL);
-
- if (mShellEnv == NULL) {
-- Status = LibLocateProtocol (&ShellEnvProtocol, &mShellEnv);
-+ Status = LibLocateProtocol (&ShellEnvProtocol, (VOID**)&mShellEnv);
- if (EFI_ERROR (Status)) {
- mShellEnv = NULL;
- }
-@@ -1171,7 +1171,7 @@
- Status = BS->HandleProtocol (
- Image->DeviceHandle,
- &gEfiFirmwareVolumeProtocolGuid,
-- &FV
-+ (VOID**)&FV
+ if (DriverName == NULL) {
+ Status = _UnloadGetDriverName (
+ DriverBindingHandleBuffer[Index],
+- Language,
++ (UINT8*)Language,
+ TRUE,
+ &DriverName
);
- if (!EFI_ERROR (Status)) {
- Status = FV->ReadSection (
-@@ -1192,7 +1192,7 @@
- Status = BS->HandleProtocol (
- Image->DeviceHandle,
- &gEfiFirmwareVolume2ProtocolGuid,
-- &FV2
-+ (VOID**)&FV2
- );
- if (!EFI_ERROR (Status)) {
- Status = FV2->ReadSection (
-@@ -1339,7 +1339,7 @@
- {
- EFI_STATUS Status;
- CHAR16 *String;
-- EFI_HII_HANDLE HiiHandle;
-+ STATIC EFI_HII_HANDLE HiiHandle;
-
- ASSERT (Str);
-
-@@ -1730,6 +1730,8 @@
- return L"X64";
- case EFI_IMAGE_MACHINE_IA64:
- return L"IA64";
-+ case EFI_IMAGE_MACHINE_AARCH64:
-+ return L"AARCH64";
- default:
- return L"UNKNOWN";
- }
-@@ -2544,4 +2546,5 @@
- }
-
- return Status;
--}
-\ No newline at end of file
-+}
-+
-Index: Library/Perf.c
-===================================================================
---- Library/Perf.c (revision 64)
-+++ Library/Perf.c (working copy)
-@@ -19,7 +19,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- #include EFI_PROTOCOL_DEFINITION (Performance)
-
-Index: Library/IPF/efilibplat.h
-===================================================================
---- Library/IPF/efilibplat.h (revision 64)
-+++ Library/IPF/efilibplat.h (working copy)
-@@ -35,3 +35,4 @@
- #define MIN_ALIGNMENT_SIZE 8
-
- #endif
-+
-Index: Library/IPF/palproc.h
-===================================================================
---- Library/IPF/palproc.h (revision 64)
-+++ Library/IPF/palproc.h (working copy)
-@@ -58,3 +58,4 @@
- #define PAL_MC_REGISTER_MEM 0x001b
-
- #endif // _PALPROC_H
-+
-Index: Library/IPF/libsalpal.h
-===================================================================
---- Library/IPF/libsalpal.h (revision 64)
-+++ Library/IPF/libsalpal.h (working copy)
-@@ -74,4 +74,4 @@
- IN UINT64 Arg8
- );
-
--#endif
-\ No newline at end of file
-+#endif
-Index: Library/Arm/efilibplat.h
-===================================================================
---- Library/Arm/efilibplat.h (revision 0)
-+++ Library/Arm/efilibplat.h (revision 0)
-@@ -0,0 +1,39 @@
-+/*++
-+
-+Copyright (c) 2005, 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:
-+
-+ efilibplat.h
-+
-+Abstract:
-+
-+ EFI to compile bindings
-+
-+
-+
-+
-+Revision History
-+
-+--*/
-+#ifndef _EFI_LIB_PLAT_H_
-+#define _EFI_LIB_PLAT_H_
-+
-+VOID
-+InitializeLibPlatform (
-+ IN EFI_HANDLE ImageHandle,
-+ IN EFI_SYSTEM_TABLE *SystemTable
-+ );
-+
-+#define MIN_ALIGNMENT_SIZE 4
-+
-+#endif
-+
-+
-Index: Library/ConsistMapping.c
-===================================================================
---- Library/ConsistMapping.c (revision 64)
-+++ Library/ConsistMapping.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
+@@ -436,7 +436,7 @@ Returns:
- MTD_NAME mMTDName[] = {
- {
-Index: Library/DPath.c
-===================================================================
---- Library/DPath.c (revision 64)
-+++ Library/DPath.c (working copy)
-@@ -20,7 +20,7 @@
-
- --*/
+ Status = _UnloadGetDriverName (
+ Handle,
+- Language,
++ (UINT8*)Language,
+ FALSE,
+ &DriverName
+ );
+@@ -450,7 +450,7 @@ Returns:
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
+ Status = _UnloadGetDriverName (
+ Handle,
+- Language,
++ (UINT8*)Language,
+ TRUE,
+ &DriverName
+ );
+@@ -628,7 +628,7 @@ Returns:
- EFI_GUID mEfiDevicePathMessagingUartFlowControlGuid = DEVICE_PATH_MESSAGING_UART_FLOW_CONTROL;
+ if (Prot->Handles[Index] == Handle) {
+ Dump = Verbose ? Prot->DumpInfo : Prot->DumpToken;
+- Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, &Interface);
++ Status = BS->HandleProtocol (Handle, &Prot->ProtocolId, (VOID**)&Interface);
+ if (!EFI_ERROR (Status)) {
+ if (Verbose) {
+ for (Index1 = 0; Index1 < ProtocolBufferCount; Index1++) {
+@@ -676,7 +676,7 @@ Returns:
+ goto Done;
+ }
-@@ -1468,7 +1468,7 @@
-
- Status = LibLocateProtocol (
- &gEfiDevicePathToTextProtocolGuid,
-- &DevPathToText
-+ (VOID**)&DevPathToText
- );
- if (!EFI_ERROR (Status)) {
- ToText = DevPathToText->ConvertDevicePathToText (
-@@ -1766,7 +1766,7 @@
- Status = BS->HandleProtocol (
- Device,
- Protocol,
-- Interface
-+ (VOID**)Interface
- );
- }
+- Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], &Interface);
++ Status = BS->HandleProtocol (Handle, ProtocolBuffer[Index1], (VOID**)&Interface);
+ if (!EFI_ERROR (Status)) {
+ PrintToken (STRING_TOKEN (STR_UNLOAD_TWO_VARS_HG_NEW), HiiUnloadHandle, ProtocolBuffer[Index1], Interface);
+ }
+diff --git a/unload/unload.h b/unload/unload.h
+index d6da802..4c99c85 100644
+--- a/unload/unload.h
++++ b/unload/unload.h
+@@ -36,3 +36,4 @@ Revision History
}
-Index: Library/Handle.h
-===================================================================
---- Library/Handle.h (revision 64)
-+++ Library/Handle.h (working copy)
-@@ -161,3 +161,4 @@
- );
#endif
+
-Index: Library/Misc.h
-===================================================================
---- Library/Misc.h (revision 64)
-+++ Library/Misc.h (working copy)
-@@ -258,3 +258,4 @@
- );
-
- #endif
-+
-Index: Library/ConsistMapping.h
-===================================================================
---- Library/ConsistMapping.h (revision 64)
-+++ Library/ConsistMapping.h (working copy)
-@@ -79,4 +79,6 @@
- IN VOID *Buffer2
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/Init.c
-===================================================================
---- Library/Init.c (revision 64)
-+++ Library/Init.c (working copy)
-@@ -20,7 +20,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- extern EFI_UNICODE_COLLATION_PROTOCOL LibStubUnicodeInterface;
-
-Index: Library/DPath.h
-===================================================================
---- Library/DPath.h (revision 64)
-+++ Library/DPath.h (working copy)
-@@ -24,7 +24,7 @@
- #ifndef _D_PATH_H
- #define _D_PATH_H
-
--#define NextStrA(a) ((UINT8 *) (((UINT8 *) (a)) + strlena (a) + 1))
-+#define NextStrA(a) (CHAR8*)((UINT8 *) (((UINT8 *) (a)) + strlena (a) + 1))
-
- #include EFI_GUID_DEFINITION (PcAnsi)
-
-@@ -153,3 +153,4 @@
- );
-
- #endif
-+
-Index: Library/HiiSupport.c
-===================================================================
---- Library/HiiSupport.c (revision 64)
-+++ Library/HiiSupport.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
-
-@@ -56,11 +56,11 @@
- return EFI_SUCCESS;
- }
-
-- Status = LibLocateProtocol (&gEfiHiiDatabaseProtocolGuid, &gLibHiiDatabase);
-+ Status = LibLocateProtocol (&gEfiHiiDatabaseProtocolGuid, (VOID**)&gLibHiiDatabase);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-- Status = LibLocateProtocol (&gEfiHiiStringProtocolGuid, &gLibHiiString);
-+ Status = LibLocateProtocol (&gEfiHiiStringProtocolGuid, (VOID**)&gLibHiiString);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-Index: Library/CRC.c
-===================================================================
---- Library/CRC.c (revision 64)
-+++ Library/CRC.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- UINT32 CRCTable[256] = {
- 0x00000000,
-Index: Library/HiiSupport.h
-===================================================================
---- Library/HiiSupport.h (revision 64)
-+++ Library/HiiSupport.h (working copy)
-@@ -142,3 +142,4 @@
- ;
-
- #endif
-+
-Index: Library/CRC.h
-===================================================================
---- Library/CRC.h (revision 64)
-+++ Library/CRC.h (working copy)
-@@ -53,4 +53,6 @@
- UINTN Size
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: Library/EfiShellLib.inf
-===================================================================
---- Library/EfiShellLib.inf (revision 64)
-+++ Library/EfiShellLib.inf (working copy)
-@@ -45,34 +45,42 @@
- HiiSupport.c
-
- [sources.ia32]
-- ia32\math.c
-- ia32\initplat.c
-+ IA32/math.c
-+ IA32/initplat.c
-
- [sources.ipf]
-- ipf\math.c
-- ipf\initplat.c
-- ipf\palproc.s
-- ipf\salpal.c
-+ IPF/math.c
-+ IPF/initplat.c
-+ IPF/palproc.s
-+ IPF/salpal.c
-
- [sources.EBC]
-- EBC\math.c
-- EBC\initplat.c
--
-+ Ebc/math.c
-+ Ebc/initplat.c
-+
- [sources.x64]
-- ipf\math.c
-- ia32\initplat.c
-+ IPF/math.c
-+ IA32/initplat.c
-
-+[sources.ARM]
-+ IPF/math.c
-+ IA32/initplat.c
-+
-+[sources.AARCH64]
-+ IPF/math.c
-+ IA32/initplat.c
-+
- [includes.common]
- .
-- ..\Inc
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-+ ../Inc
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-
- [libraries.common]
- EdkFrameworkProtocolLib
-@@ -81,4 +89,11 @@
- EfiGuidLib
- EdkGuidLib
-
-+[libraries.ARM]
-+ CompilerIntrinsicsLib
-+
-+[libraries.AARCH64]
-+ CompilerIntrinsicsLib
-+
-+
- [nmake.common]
-Index: Library/IA32/efilibplat.h
-===================================================================
---- Library/IA32/efilibplat.h (revision 64)
-+++ Library/IA32/efilibplat.h (working copy)
-@@ -34,4 +34,4 @@
-
- #define MIN_ALIGNMENT_SIZE 4
-
--#endif
-\ No newline at end of file
-+#endif
-Index: Library/ShellDebug.c
-===================================================================
---- Library/ShellDebug.c (revision 64)
-+++ Library/ShellDebug.c (working copy)
-@@ -19,7 +19,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
- #include EFI_PROTOCOL_DEFINITION (DebugAssert)
-
- EFI_DEBUG_ASSERT_PROTOCOL *mDebugAssert = NULL;
-Index: Library/ShellDebug.h
-===================================================================
---- Library/ShellDebug.h (revision 64)
-+++ Library/ShellDebug.h (working copy)
-@@ -99,3 +99,4 @@
- );
- #endif
-
-+
-Index: Library/VarCheck.c
-===================================================================
---- Library/VarCheck.c (revision 64)
-+++ Library/VarCheck.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- VOID
- LibCheckVarFreeVarList (
-Index: Library/Lock.c
-===================================================================
---- Library/Lock.c (revision 64)
-+++ Library/Lock.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- VOID
- InitializeLock (
-Index: Library/ShellEnvInt.c
-===================================================================
---- Library/ShellEnvInt.c (revision 64)
-+++ Library/ShellEnvInt.c (working copy)
-@@ -21,7 +21,7 @@
-
- --*/
-
--#include "EfiShelllib.h"
-+#include "EfiShellLib.h"
-
- EFI_STATUS
- ShellExecute (
-Index: Library/VarCheck.h
-===================================================================
---- Library/VarCheck.h (revision 64)
-+++ Library/VarCheck.h (working copy)
-@@ -41,7 +41,7 @@
- ARG_PARTIALLY_QUOTED = 0x2,
- ARG_FIRST_HALF_QUOTED = 0x4,
- ARG_FIRST_CHAR_IS_ESC = 0x8
--};
-+} SHELL_ARG_EXPR;
-
- typedef struct {
- CHAR16 *FlagStr;
-@@ -116,3 +116,4 @@
- );
-
- #endif
-+
-Index: Library/Lock.h
-===================================================================
---- Library/Lock.h (revision 64)
-+++ Library/Lock.h (working copy)
-@@ -45,4 +45,6 @@
- IN FLOCK *Lock
- );
-
--#endif
-\ No newline at end of file
-+#endif
-+
-+
-Index: ShellFull.inf
-===================================================================
---- ShellFull.inf (revision 64)
-+++ ShellFull.inf (working copy)
-@@ -20,300 +20,310 @@
- #--*/
-
- [defines]
--BASE_NAME = Shell
--FILE_GUID = c57ad6b7-0515-40a8-9d21-551652854e37
-+BASE_NAME = ShellFull
-+FILE_GUID = 1903FB23-E526-4BDA-85E4-D68F2EEF0C20
+diff --git a/unload/unload.inf b/unload/unload.inf
+index e91869e..fbc0fb3 100644
+--- a/unload/unload.inf
++++ b/unload/unload.inf
+@@ -39,23 +39,23 @@ FILE_GUID = 409060F4-3E7B-44cc-9DFD-A8E807474888
COMPONENT_TYPE = APPLICATION
[sources.common]
-- Library\ShellDebug.c
-- Library\DPath.c
-- Library\Init.c
-- Library\Lock.c
-- Library\Str.c
-- Library\IO.c
-- Library\Mem.c
-- Library\Misc.c
-- Library\Data.c
-- Library\RtData.c
-- Library\ShellEnvInt.c
-- Library\Handle.c
-- Library\FileIO.c
-- Library\ConsistMapping.c
-- Library\CRC.c
-- Library\Event.c
-- Library\Perf.c
-- Library\VarCheck.c
-- Library\HiiSupport.c
-+ Library/ShellDebug.c
-+ Library/DPath.c
-+ Library/Init.c
-+ Library/Lock.c
-+ Library/Str.c
-+ Library/IO.c
-+ Library/Mem.c
-+ Library/Misc.c
-+ Library/Data.c
-+ Library/RtData.c
-+ Library/ShellEnvInt.c
-+ Library/Handle.c
-+ Library/FileIO.c
-+ Library/ConsistMapping.c
-+ Library/CRC.c
-+ Library/Event.c
-+ Library/Perf.c
-+ Library/VarCheck.c
-+ Library/HiiSupport.c
-
-- newshell\NshellStrings.uni
-- newshell\init.c
-- newshell\nshell.h
-- newshell\fakehii.c
-+ newshell/NshellStrings.uni
-+ newshell/init.c
-+ newshell/nshell.h
-+ newshell/fakehii.c
-
- ShCommonStrings.uni
-- shellenv\ShellenvHelpStrings.uni
-- shellenv\ShellenvStrings.uni
-- shellenv\ScriptCmdStrings.uni
-- shellenv\ConnectStrings.uni
-- shellenv\EchoStrings.uni
-- shellenv\HelpStrings.uni
-- shellenv\MapStrings.uni
-- shellenv\CdStrings.uni
-- shellenv\DhStrings.uni
-+ shellenv/ShellenvHelpStrings.uni
-+ shellenv/ShellenvStrings.uni
-+ shellenv/ScriptCmdStrings.uni
-+ shellenv/ConnectStrings.uni
-+ shellenv/EchoStrings.uni
-+ shellenv/HelpStrings.uni
-+ shellenv/MapStrings.uni
-+ shellenv/CdStrings.uni
-+ shellenv/DhStrings.uni
-
-- shellenv\cmddisp.c
-- shellenv\connect.c
-- shellenv\data.c
-- shellenv\exec.c
-- shellenv\init.c
-- shellenv\protid.c
-- shellenv\var.c
-- shellenv\conio.c
-- shellenv\consoleproxy.c
-- shellenv\handle.c
-- shellenv\dprot.c
-- shellenv\map.c
-- shellenv\marg.c
-- shellenv\batch.c
-- shellenv\if.c
-- shellenv\goto.c
-- shellenv\echo.c
-- shellenv\pause.c
-- shellenv\for.c
-- shellenv\wait.c
-- shellenv\help.c
-- shellenv\shelle.h
-- shellenv\shellenvguid.h
-- shellenv\parsecmd.c
-- shellenv\shift.c
-+ shellenv/cmddisp.c
-+ shellenv/connect.c
-+ shellenv/data.c
-+ shellenv/exec.c
-+ shellenv/init.c
-+ shellenv/protid.c
-+ shellenv/var.c
-+ shellenv/conio.c
-+ shellenv/consoleproxy.c
-+ shellenv/handle.c
-+ shellenv/dprot.c
-+ shellenv/map.c
-+ shellenv/marg.c
-+ shellenv/batch.c
-+ shellenv/if.c
-+ shellenv/goto.c
-+ shellenv/echo.c
-+ shellenv/pause.c
-+ shellenv/for.c
-+ shellenv/wait.c
-+ shellenv/help.c
-+ shellenv/shelle.h
-+ shellenv/shellenvguid.h
-+ shellenv/parsecmd.c
-+ shellenv/shift.c
-
-- unload\UnloadStrings.uni
-- unload\unload.c
-+ unload/UnloadStrings.uni
-+ unload/unload.c
-
-- attrib\AttribStrings.uni
-- attrib\attrib.c
-- attrib\attrib.h
-+ attrib/AttribStrings.uni
-+ attrib/attrib.c
-+ attrib/attrib.h
-
-- cls\clsstrings.uni
-- cls\cls.c
-+ cls/clsstrings.uni
-+ cls/cls.c
-
-- cp\CpStrings.uni
-- cp\cp.h
-- cp\cp.c
-+ cp/CpStrings.uni
-+ cp/cp.h
-+ cp/cp.c
-
-- date\DateStrings.uni
-- date\date.c
-- date\date.h
-+ date/DateStrings.uni
-+ date/date.c
-+ date/date.h
-
-- load\LoadStrings.uni
-- load\load.c
-- load\load.h
-+ load/LoadStrings.uni
-+ load/load.c
-+ load/load.h
-
-- ls\LsStrings.uni
-- ls\ls.h
-- ls\ls.c
-+ ls/LsStrings.uni
-+ ls/ls.h
-+ ls/ls.c
-
-- mkdir\MkdirStrings.uni
-- mkdir\mkdir.c
-- mkdir\mkdir.h
-+ mkdir/MkdirStrings.uni
-+ mkdir/mkdir.c
-+ mkdir/mkdir.h
-
-- mv\MvStrings.uni
-- mv\mv.c
-- mv\mv.h
-+ mv/MvStrings.uni
-+ mv/mv.c
-+ mv/mv.h
-
-- reset\ResetStrings.uni
-- reset\reset.c
-- reset\reset.h
-+ reset/ResetStrings.uni
-+ reset/reset.c
-+ reset/reset.h
-
-- rm\RmStrings.uni
-- rm\rm.h
-- rm\rm.c
-+ rm/RmStrings.uni
-+ rm/rm.h
-+ rm/rm.c
-
-- type\TypeStrings.uni
-- type\type.c
-- type\type.h
-- time\TimeStrings.uni
-- time\time.c
-- time\time.h
-+ type/TypeStrings.uni
-+ type/type.c
-+ type/type.h
-+ time/TimeStrings.uni
-+ time/time.c
-+ time/time.h
-
-- touch\TouchStrings.uni
-- touch\touch.c
-- touch\touch.h
-+ touch/TouchStrings.uni
-+ touch/touch.c
-+ touch/touch.h
-
-- vol\VolStrings.uni
-- vol\vol.c
-- vol\vol.h
-+ vol/VolStrings.uni
-+ vol/vol.c
-+ vol/vol.h
-
-- ver\VerStrings.uni
-- ver\ver.c
-- ver\ver.h
-+ ver/VerStrings.uni
-+ ver/ver.c
-+ ver/ver.h
-
-- drivers\driversStrings.uni
-- drivers\drivers.c
-- drivers\drivers.h
-+ drivers/driversStrings.uni
-+ drivers/drivers.c
-+ drivers/drivers.h
-
-- drvcfg\DrvcfgStrings.uni
-- drvcfg\drvcfg.c
-- drvcfg\drvcfg.h
-+ drvcfg/DrvcfgStrings.uni
-+ drvcfg/drvcfg.c
-+ drvcfg/drvcfg.h
-
-- drvdiag\DrvdiagStrings.uni
-- drvdiag\drvdiag.c
-- drvdiag\drvdiag.h
-+ drvdiag/DrvdiagStrings.uni
-+ drvdiag/drvdiag.c
-+ drvdiag/drvdiag.h
-
-- comp\CompStrings.uni
-- comp\comp.c
-+ comp/CompStrings.uni
-+ comp/comp.c
-
-- dblk\dblkStrings.uni
-- dblk\dblk.c
-- dblk\efidump.c
-+ dblk/dblkStrings.uni
-+ dblk/dblk.c
-+ dblk/efidump.c
-
-- devices\DevicesStrings.uni
-- devices\devices.c
-+ devices/DevicesStrings.uni
-+ devices/devices.c
-
-- devicetree\DevicetreeStrings.uni
-- devicetree\devicetree.c
-+ devicetree/DevicetreeStrings.uni
-+ devicetree/devicetree.c
-
-- dmem\MemStrings.uni
-- dmem\DebugStrings.uni
-- dmem\mem.c
-- dmem\MemCommonPart.c
-- dmem\efidump.c
-+ dmem/MemStrings.uni
-+ dmem/DebugStrings.uni
-+ dmem/mem.c
-+ dmem/MemCommonPart.c
-+ dmem/efidump.c
-
-- dmpstore\DmpstoreStrings.uni
-- dmpstore\dmpstore.c
-+ dmpstore/DmpstoreStrings.uni
-+ dmpstore/dmpstore.c
-
-- edit\EditStrings.uni
-- edit\main.c
-- edit\libFileBuffer.c
-- edit\libEditor.c
-- edit\libTitleBar.c
-- edit\libStatusBar.c
-- edit\libInputBar.c
-- edit\libMenuBar.c
-- edit\libMisc.c
-+ edit/EditStrings.uni
-+ edit/main.c
-+ edit/libFileBuffer.c
-+ edit/libEditor.c
-+ edit/libTitleBar.c
-+ edit/libStatusBar.c
-+ edit/libInputBar.c
-+ edit/libMenuBar.c
-+ edit/libMisc.c
-
-- eficompress\CompressStrings.uni
-- eficompress\compressMain.c
-- eficompress\compress.c
-+ eficompress/CompressStrings.uni
-+ eficompress/compressMain.c
-+ eficompress/compress.c
-
-- efidecompress\DecompressStrings.uni
-- efidecompress\decompress.c
-+ efidecompress/DecompressStrings.uni
-+ efidecompress/decompress.c
-
-- err\ErrStrings.uni
-- err\err.c
-+ err/ErrStrings.uni
-+ err/err.c
-
-- guid\GuidStrings.uni
-- guid\guid.c
-+ guid/GuidStrings.uni
-+ guid/guid.c
-
-- hexedit\HexeditStrings.uni
-- hexedit\main.c
-- hexedit\libBufferImage.c
-- hexedit\libFileImage.c
-- hexedit\libDiskImage.c
-- hexedit\libMemImage.c
-- hexedit\libEditor.c
-- hexedit\libTitleBar.c
-- hexedit\libStatusBar.c
-- hexedit\libInputBar.c
-- hexedit\libMenuBar.c
-- hexedit\libClipBoard.c
-- hexedit\libMisc.c
-+ hexedit/HexeditStrings.uni
-+ hexedit/main.c
-+ hexedit/libBufferImage.c
-+ hexedit/libFileImage.c
-+ hexedit/libDiskImage.c
-+ hexedit/libMemImage.c
-+ hexedit/libEditor.c
-+ hexedit/libTitleBar.c
-+ hexedit/libStatusBar.c
-+ hexedit/libInputBar.c
-+ hexedit/libMenuBar.c
-+ hexedit/libClipBoard.c
-+ hexedit/libMisc.c
-
-- IfConfig\IfConfigStrings.uni
-- IfConfig\IfConfig.c
-- IfConfig\IfConfig.h
-- IfConfig\ShellNetHelper.c
-+ IfConfig/IfConfigStrings.uni
-+ IfConfig/IfConfig.c
-+ IfConfig/IfConfig.h
-+ IfConfig/ShellNetHelper.c
-
-- ipconfig\IpConfigStrings.uni
-- ipconfig\IpConfig.c
-+ IpConfig/IpConfigStrings.uni
-+ IpConfig/IpConfig.c
-
-- loadpcirom\LoadPciRomStrings.uni
-- loadpcirom\LoadPciRom.c
-+ loadpcirom/LoadPciRomStrings.uni
-+ loadpcirom/LoadPciRom.c
-
-- mem\MemStrings.uni
-- mem\DebugStrings.uni
-- mem\mm.c
-- mem\MemCommonPart.c
-- mem\efidump.c
-+ mem/MemStrings.uni
-+ mem/DebugStrings.uni
-+ mem/mm.c
-+ mem/MemCommonPart.c
-+ mem/efidump.c
-
-- memmap\memmapStrings.uni
-- memmap\memmap.c
-+ memmap/memmapStrings.uni
-+ memmap/memmap.c
-
-- mm\MmStrings.uni
-- mm\mm.c
-+ mm/MmStrings.uni
-+ mm/mm.c
-
-- mode\ModeStrings.uni
-- mode\mode.c
-+ mode/ModeStrings.uni
-+ mode/mode.c
-
-- mount\MountStrings.uni
-- mount\mount.c
-+ mount/MountStrings.uni
-+ mount/mount.c
-
-- openinfo\OPeninfoStrings.uni
-- openinfo\openinfo.c
-+ openinfo/OPeninfoStrings.uni
-+ openinfo/openinfo.c
-
-- Ping\PingStrings.uni
-- Ping\Ping.c
-+ Ping/PingStrings.uni
-+ Ping/Ping.c
-
-- pci\PciStrings.uni
-- pci\pci.c
-- pci\pci_class.c
-+ pci/PciStrings.uni
-+ pci/pci.c
-+ pci/pci_class.c
-
-- sermode\SermodeStrings.uni
-- sermode\sermode.c
-+ sermode/SermodeStrings.uni
-+ sermode/sermode.c
-
-- smbiosview\SmBiosViewStrings.uni
-- smbiosview\QueryTable.c
-- smbiosview\EventLogInfo.c
-- smbiosview\PrintInfo.c
-- smbiosview\LibSmbiosView.c
-- smbiosview\smbiosview.c
-- smbiosview\smbios.c
-+ smbiosview/SmBiosViewStrings.uni
-+ smbiosview/QueryTable.c
-+ smbiosview/EventLogInfo.c
-+ smbiosview/PrintInfo.c
-+ smbiosview/LibSmbiosView.c
-+ smbiosview/smbiosview.c
-+ smbiosview/smbios.c
-
-- stall\stallStrings.uni
-- stall\stall.c
-+ stall/stallStrings.uni
-+ stall/stall.c
-
-- telnetmgmt\TelnetMgmtStrings.uni
-- telnetmgmt\TelnetMgmt.c
-+ telnetmgmt/TelnetMgmtStrings.uni
-+ telnetmgmt/TelnetMgmt.c
-
-- tzone\TZoneStrings.uni
-- tzone\tzone.c
-+ tzone/TZoneStrings.uni
-+ tzone/tzone.c
-
- [sources.ia32]
-- ver\ia32\ver32.c
-- Library\ia32\math.c
-- Library\ia32\initplat.c
-+ ver/IA32/ver32.c
-+ Library/IA32/math.c
-+ Library/IA32/initplat.c
-
- [sources.ipf]
-- ver\ipf\ver64.c
-- Library\ipf\math.c
-- Library\ipf\initplat.c
-- Library\ipf\palproc.s
-- Library\ipf\salpal.c
-+ ver/IPF/ver64.c
-+ Library/IPF/math.c
-+ Library/IPF/initplat.c
-+ Library/IPF/palproc.s
-+ Library/IPF/salpal.c
-
- [sources.EBC]
-- ver\ebc\verEbc.c
-- Library\EBC\math.c
-- Library\EBC\initplat.c
-+ ver/ebc/verEbc.c
-+ Library/Ebc/math.c
-+ Library/Ebc/initplat.c
-
- [sources.x64]
-- ver\ia32\ver32.c
-- Library\ipf\math.c
-- Library\ia32\initplat.c
-+ ver/IA32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-
-+[sources.ARM]
-+ ver/ia32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-+
-+[sources.AARCH64]
-+ ver/ia32/ver32.c
-+ Library/IPF/math.c
-+ Library/IA32/initplat.c
-+
- [includes.common]
- .
-- .\Inc
-- .\ver
-- .\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(EDK_SOURCE)\Foundation\Library\Dxe\Include
-+ ./Inc
-+ ./ver
-+ ./Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(EDK_SOURCE)/Foundation/Library/Dxe/Include
- $(DEST_DIR)
-
- [libraries.common]
-@@ -353,4 +363,4 @@
- EBC_C_STD_FLAGS = $(EBC_C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
-
-
--
-\ No newline at end of file
-+
-Index: inc/shelltypes.h
-===================================================================
---- inc/shelltypes.h (revision 64)
-+++ inc/shelltypes.h (working copy)
-@@ -36,7 +36,7 @@
- #endif
-
- #include "Tiano.h"
--#include "linkedlist.h"
-+#include "LinkedList.h"
-
- #include EFI_PROTOCOL_DEFINITION (FileInfo)
- #include EFI_PROTOCOL_DEFINITION (SimpleFileSystem)
-@@ -183,3 +183,4 @@
- #endif
-
- #endif
-+
-Index: inc/shellenv.h
-===================================================================
---- inc/shellenv.h (revision 64)
-+++ inc/shellenv.h (working copy)
-@@ -492,3 +492,4 @@
- #endif
-
- #endif // _SHELLENV_H_
-+
-Index: mm/mm.h
-===================================================================
---- mm/mm.h (revision 64)
-+++ mm/mm.h (working copy)
-@@ -33,3 +33,4 @@
- }
-
- #endif
-+
-Index: mm/mm.inf
-===================================================================
---- mm/mm.inf (revision 64)
-+++ mm/mm.inf (working copy)
-@@ -41,23 +41,23 @@
-
- [sources.common]
- MmStrings.uni
- ..\ShCommonStrings.uni
+ ../ShCommonStrings.uni
- mm.c
- mm.h
-
+ UnloadStrings.uni
+ unload.c
+
[includes.common]
.
- ..\Inc
@@ -8361,190 +9563,58 @@ Index: mm/mm.inf
[libraries.common]
EfiShellLib
-Index: mm/mm.c
-===================================================================
---- mm/mm.c (revision 64)
-+++ mm/mm.c (working copy)
-@@ -49,18 +49,18 @@
-
- VOID
- ReadMem (
-- IN EFI_IO_WIDTH Width,
-- IN UINT64 Address,
-- IN UINTN Size,
-- IN VOID *Buffer
-+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
-+ IN UINT64 Address,
-+ IN UINTN Size,
-+ IN VOID *Buffer
- );
-
- VOID
- WriteMem (
-- IN EFI_IO_WIDTH Width,
-- IN UINT64 Address,
-- IN UINTN Size,
-- IN VOID *Buffer
-+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
-+ IN UINT64 Address,
-+ IN UINTN Size,
-+ IN VOID *Buffer
- );
-
- STATIC
-@@ -73,7 +73,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiIomodGuid = EFI_IOMOD_GUID;
- SHELL_VAR_CHECK_ITEM IomodCheckList[] = {
- {
-@@ -134,7 +134,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
-
-@@ -146,13 +146,13 @@
-
- EFI_STATUS
- OldShellParserMM (
-- OUT EFI_IO_WIDTH *Width,
-- OUT EFI_ACCESS_TYPE *AccessType,
-- OUT UINT64 *Address,
-- OUT UINT64 *Value,
-- OUT UINTN *Size,
-- OUT BOOLEAN *Interactive,
-- OUT CHAR16 **ValueStr
-+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH *Width,
-+ OUT EFI_ACCESS_TYPE *AccessType,
-+ OUT UINT64 *Address,
-+ OUT UINT64 *Value,
-+ OUT UINTN *Size,
-+ OUT BOOLEAN *Interactive,
-+ OUT CHAR16 **ValueStr
- );
-
- EFI_STATUS
-@@ -207,12 +207,11 @@
- UINT64 PciEAddress;
- UINT64 Value;
- UINT32 SegmentNumber;
-- EFI_IO_WIDTH Width;
-+ EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width;
- EFI_ACCESS_TYPE AccessType;
- UINT64 Buffer;
- UINTN Index;
- UINTN Size;
-- CHAR16 *AddressStr;
- CHAR16 *ValueStr;
- BOOLEAN Complete;
- CHAR16 InputStr[80];
-@@ -261,7 +260,7 @@
- if (IS_OLD_SHELL) {
- Status = OldShellParserMM (&Width, &AccessType, &Address, &Value, &Size, &Interactive, &ValueStr);
- if (EFI_ERROR (Status)) {
-- if (-1 == Status) {
-+ if ((EFI_STATUS)-1 == Status) {
- PrintToken (STRING_TOKEN (STR_HELPINFO_MM_VERBOSEHELP), HiiHandle);
- Status = EFI_SUCCESS;
- }
-@@ -274,7 +273,6 @@
- Width = EfiPciWidthUint8;
- Size = 1;
- AccessType = EfiMemory;
-- AddressStr = NULL;
- ValueStr = NULL;
- Interactive = TRUE;
-
-@@ -662,10 +660,10 @@
-
- VOID
- ReadMem (
-- IN EFI_IO_WIDTH Width,
-- IN UINT64 Address,
-- IN UINTN Size,
-- IN VOID *Buffer
-+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
-+ IN UINT64 Address,
-+ IN UINTN Size,
-+ IN VOID *Buffer
- )
- {
- do {
-@@ -694,10 +692,10 @@
-
- VOID
- WriteMem (
-- IN EFI_IO_WIDTH Width,
-- IN UINT64 Address,
-- IN UINTN Size,
-- IN VOID *Buffer
-+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
-+ IN UINT64 Address,
-+ IN UINTN Size,
-+ IN VOID *Buffer
- )
- {
- do {
-@@ -750,7 +748,7 @@
- }
-
- if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
-- u = u << 4 | c - (c >= 'A' ? 'A' - 10 : '0');
-+ u = (u << 4) | (c - (c >= 'A' ? 'A' - 10 : '0'));
-
- Find = TRUE;
- } else {
-@@ -766,13 +764,13 @@
+@@ -70,6 +70,11 @@ COMPONENT_TYPE = APPLICATION
- EFI_STATUS
- OldShellParserMM (
-- OUT EFI_IO_WIDTH *Width,
-- OUT EFI_ACCESS_TYPE *AccessType,
-- OUT UINT64 *Address,
-- OUT UINT64 *Value,
-- OUT UINTN *Size,
-- OUT BOOLEAN *Interactive,
-- OUT CHAR16 **ValueStr
-+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH *Width,
-+ OUT EFI_ACCESS_TYPE *AccessType,
-+ OUT UINT64 *Address,
-+ OUT UINT64 *Value,
-+ OUT UINTN *Size,
-+ OUT BOOLEAN *Interactive,
-+ OUT CHAR16 **ValueStr
- )
- /*++
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeUnload
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
++
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/ver/Ebc/verEbc.c b/ver/Ebc/verEbc.c
+index 1d7368d..9518e14 100644
+--- a/ver/Ebc/verEbc.c
++++ b/ver/Ebc/verEbc.c
+@@ -45,7 +45,7 @@ DisplayExtendedVersionInfo (
+ Status = BS->LocateProtocol (
+ &gEfiEbcProtocolGuid,
+ NULL,
+- &Ebc
++ (VOID**)&Ebc
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+diff --git a/ver/Ver.inf b/ver/Ver.inf
+index 56a135d..12ec23e 100644
+--- a/ver/Ver.inf
++++ b/ver/Ver.inf
+@@ -40,33 +40,33 @@ COMPONENT_TYPE = APPLICATION
-Index: drvcfg/drvcfg.h
-===================================================================
---- drvcfg/drvcfg.h (revision 64)
-+++ drvcfg/drvcfg.h (working copy)
-@@ -33,3 +33,4 @@
- }
- #endif
-+
-Index: drvcfg/drvcfg.inf
-===================================================================
---- drvcfg/drvcfg.inf (revision 64)
-+++ drvcfg/drvcfg.inf (working copy)
-@@ -40,24 +40,24 @@
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ VerStrings.uni
+ Ver.c
+ Ver.h
+
+-[sources.ia32,sources.x64]
+- ia32\ver32.c
++[sources.ia32,sources.x64,sources.ARM,sources.AARCH64]
++ ia32/ver32.c
+ [sources.ipf]
+- ipf\ver64.c
++ IPF/ver64.c
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- DrvcfgStrings.uni
- drvcfg.c
- drvcfg.h
-
+ [sources.ebc]
+- ebc\verEbc.c
++ eb./verEbc.c
+
[includes.common]
.
- ..\Inc
@@ -8572,20 +9642,23 @@ Index: drvcfg/drvcfg.inf
[libraries.common]
EfiShellLib
-Index: drvcfg/drvcfg.c
-===================================================================
---- drvcfg/drvcfg.c (revision 64)
-+++ drvcfg/drvcfg.c (working copy)
-@@ -38,7 +38,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDrvcfgGuid = EFI_DRVCFG_GUID;
- SHELL_VAR_CHECK_ITEM DrvcfgCheckList[] = {
- {
-@@ -87,7 +87,7 @@
+@@ -82,7 +82,11 @@ COMPONENT_TYPE = APPLICATION
+
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeVer
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/ver/ver.c b/ver/ver.c
+index 76d50ca..56b95d4 100644
+--- a/ver/ver.c
++++ b/ver/ver.c
+@@ -57,7 +57,7 @@ SHELL_VAR_CHECK_ITEM VerCheckList[] = {
NULL,
0,
0,
@@ -8594,29 +9667,29 @@ Index: drvcfg/drvcfg.c
}
};
-Index: openinfo/openinfo.h
-===================================================================
---- openinfo/openinfo.h (revision 64)
-+++ openinfo/openinfo.h (working copy)
-@@ -33,3 +33,4 @@
- }
-
+diff --git a/ver/ver.h b/ver/ver.h
+index 770e82f..c6adc30 100644
+--- a/ver/ver.h
++++ b/ver/ver.h
+@@ -37,3 +37,4 @@ DisplayExtendedVersionInfo (
+ IN EFI_SYSTEM_TABLE *SystemTable
+ );
#endif
+
-Index: openinfo/openinfo.inf
-===================================================================
---- openinfo/openinfo.inf (revision 64)
-+++ openinfo/openinfo.inf (working copy)
-@@ -41,24 +41,24 @@
+diff --git a/vol/Vol.inf b/vol/Vol.inf
+index 71d2cb5..cef8462 100644
+--- a/vol/Vol.inf
++++ b/vol/Vol.inf
+@@ -40,24 +40,24 @@ COMPONENT_TYPE = APPLICATION
- [sources.common]
- OPeninfoStrings.uni
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- openinfo.c
- openinfo.h
-
+ [sources.common]
+- ..\ShCommonStrings.uni
++ ../ShCommonStrings.uni
+ VolStrings.uni
+ Vol.c
+ Vol.h
+
[includes.common]
.
- ..\Inc
@@ -8644,42 +9717,32 @@ Index: openinfo/openinfo.inf
[libraries.common]
EfiShellLib
-Index: openinfo/openinfo.c
-===================================================================
---- openinfo/openinfo.c (revision 64)
-+++ openinfo/openinfo.c (working copy)
-@@ -36,7 +36,7 @@
- //
- // Global Variables
- //
--EFI_HII_HANDLE HiiHandle;
-+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiOpeninfoGuid = EFI_OPENINFO_GUID;
- SHELL_VAR_CHECK_ITEM OpeninfoCheckList[] = {
- {
-@@ -55,7 +55,7 @@
- NULL,
- 0,
- 0,
-- 0
-+ (SHELL_VAR_CHECK_FLAG_TYPE) 0
- }
- };
+@@ -72,7 +72,11 @@ COMPONENT_TYPE = APPLICATION
-Index: drivers/drivers.c
-===================================================================
---- drivers/drivers.c (revision 64)
-+++ drivers/drivers.c (working copy)
-@@ -43,7 +43,7 @@
- //
- // Global Variables
+ [nmake.common]
+ IMAGE_ENTRY_POINT=InitializeVol
++
++[nmake.IA32, nmake.EBC, nmake.X64, nmake.IPF]
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_ARRAY_NAME=$(BASE_NAME)Strings
+ C_STD_FLAGS = $(C_STD_FLAGS) /DSTRING_DEFINES_FILE=\"$(BASE_NAME)StrDefs.h\"
+ C_STD_FLAGS = $(C_STD_FLAGS) /DEFI_BOOTSHELL
+
++[nmake.ARM, nmake.AARCH64]
++ C_STD_FLAGS = $(C_STD_FLAGS) -DEFI_BOOTSHELL
+diff --git a/vol/vol.c b/vol/vol.c
+index 47a4de0..e86b298 100644
+--- a/vol/vol.c
++++ b/vol/vol.c
+@@ -32,7 +32,7 @@ extern UINT8 STRING_ARRAY_NAME[];
//
+ #include STRING_DEFINES_FILE
+
-EFI_HII_HANDLE HiiHandle;
+STATIC EFI_HII_HANDLE HiiHandle;
- EFI_GUID EfiDriversGuid = EFI_DRIVERS_GUID;
- SHELL_VAR_CHECK_ITEM DriversCheckList[] = {
+ EFI_GUID EfiVolGuid = EFI_VOL_GUID;
+ SHELL_VAR_CHECK_ITEM VolCheckList[] = {
{
-@@ -68,7 +68,7 @@
+@@ -63,7 +63,7 @@ SHELL_VAR_CHECK_ITEM VolCheckList[] = {
NULL,
0,
0,
@@ -8688,70 +9751,15 @@ Index: drivers/drivers.c
}
};
-@@ -133,7 +133,6 @@
- EFI_HANDLE *ControllerHandleBuffer;
- UINTN ChildControllerHandleCount;
- CHAR16 *ImageName;
-- BOOLEAN IsHelp;
- SHELL_VAR_CHECK_CODE RetCode;
- CHAR16 *Useful;
- SHELL_ARG_LIST *Item;
-@@ -143,7 +142,6 @@
- Language = NULL;
- DriverImageHandleCount = 0;
- DriverImageHandleBuffer = NULL;
-- IsHelp = FALSE;
- ZeroMem (&ChkPck, sizeof (SHELL_VAR_CHECK_PACKAGE));
-
- EFI_SHELL_APP_INIT (ImageHandle, SystemTable);
-Index: drivers/drivers.h
-===================================================================
---- drivers/drivers.h (revision 64)
-+++ drivers/drivers.h (working copy)
-@@ -33,3 +33,4 @@
+diff --git a/vol/vol.h b/vol/vol.h
+index 0d345dd..a9fe6d7 100644
+--- a/vol/vol.h
++++ b/vol/vol.h
+@@ -32,3 +32,4 @@ Revision History
}
#endif
+
-Index: drivers/drivers.inf
-===================================================================
---- drivers/drivers.inf (revision 64)
-+++ drivers/drivers.inf (working copy)
-@@ -40,7 +40,7 @@
-
-
- [sources.common]
-- ..\ShCommonStrings.uni
-+ ../ShCommonStrings.uni
- DriversStrings.uni
- drivers.c
- drivers.h
-@@ -48,17 +48,17 @@
-
- [includes.common]
- .
-- ..\Inc
-- ..\Library
-- $(EDK_SOURCE)\Foundation
-- $(EDK_SOURCE)\Foundation\Include
-- $(EDK_SOURCE)\Foundation\Include\IndustryStandard
-- $(EDK_SOURCE)\Foundation\Efi
-- $(EDK_SOURCE)\Foundation\Efi\Include
-- $(EDK_SOURCE)\Foundation\FrameWork
-- $(EDK_SOURCE)\Foundation\FrameWork\Include
-- $(EDK_SOURCE)\Foundation\Core\Dxe
-- $(DEST_DIR)\
-+ ../Inc
-+ ../Library
-+ $(EDK_SOURCE)/Foundation
-+ $(EDK_SOURCE)/Foundation/Include
-+ $(EDK_SOURCE)/Foundation/Include/IndustryStandard
-+ $(EDK_SOURCE)/Foundation/Efi
-+ $(EDK_SOURCE)/Foundation/Efi/Include
-+ $(EDK_SOURCE)/Foundation/FrameWork
-+ $(EDK_SOURCE)/Foundation/FrameWork/Include
-+ $(EDK_SOURCE)/Foundation/Core/Dxe
-+ $(DEST_DIR./
-
- [libraries.common]
- EfiShellLib
+--
+1.8.5
+
diff --git a/EmbeddedPkg/Include/Protocol/MmcHost.h b/EmbeddedPkg/Include/Protocol/MmcHost.h
index d04be6595..08f2ad934 100644
--- a/EmbeddedPkg/Include/Protocol/MmcHost.h
+++ b/EmbeddedPkg/Include/Protocol/MmcHost.h
@@ -1,7 +1,7 @@
/** @file
Definition of the MMC Host Protocol
- Copyright (c) 2011, ARM Limited. All rights reserved.
+ Copyright (c) 2011-2014, ARM Limited. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -64,6 +64,10 @@ typedef UINT32 MMC_CMD;
#define MMC_CMD55 (MMC_INDX(55) | MMC_CMD_WAIT_RESPONSE)
#define MMC_ACMD41 (MMC_INDX(41) | MMC_CMD_WAIT_RESPONSE | MMC_CMD_NO_CRC_RESPONSE)
+// Valid responses for CMD1 in eMMC
+#define EMMC_CMD1_CAPACITY_LESS_THAN_2GB 0x00FF8080 // Capacity <= 2GB, byte addressing used
+#define EMMC_CMD1_CAPACITY_GREATER_THAN_2GB 0x40FF8080 // Capacity > 2GB, 512-byte sector addressing used
+
typedef enum _MMC_STATE {
MmcInvalidState = 0,
MmcHwInitializationState,
diff --git a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
index 14035afb1..310b7cc82 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
+++ b/EmbeddedPkg/Universal/MmcDxe/Diagnostics.c
@@ -1,7 +1,7 @@
/** @file
Diagnostics Protocol implementation for the MMC DXE driver
- Copyright (c) 2011, ARM Limited. All rights reserved.
+ Copyright (c) 2011-2014, ARM Limited. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -205,34 +205,43 @@ MmcDriverDiagnosticsRunDiagnostics (
DiagnosticLog (L"MMC Driver Diagnostics\n");
- // For each MMC instance
+ // Find the MMC Host instance on which we have been asked to run diagnostics
+ MmcHostInstance = NULL;
CurrentLink = mMmcHostPool.ForwardLink;
while (CurrentLink != NULL && CurrentLink != &mMmcHostPool && (Status == EFI_SUCCESS)) {
- MmcHostInstance = MMC_HOST_INSTANCE_FROM_LINK (CurrentLink);
- ASSERT (MmcHostInstance != NULL);
+ MmcHostInstance = MMC_HOST_INSTANCE_FROM_LINK(CurrentLink);
+ ASSERT(MmcHostInstance != NULL);
+ if (MmcHostInstance->MmcHandle == ControllerHandle) {
+ break;
+ }
+ CurrentLink = CurrentLink->ForwardLink;
+ }
- // LBA=1 Size=BlockSize
- DiagnosticLog (L"MMC Driver Diagnostics - Test: First Block\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, 1, MmcHostInstance->BlockIo.Media->BlockSize);
+ // If we didn't find the controller, return EFI_UNSUPPORTED
+ if ((MmcHostInstance == NULL)
+ || (MmcHostInstance->MmcHandle != ControllerHandle)) {
+ return EFI_UNSUPPORTED;
+ }
- // LBA=2 Size=BlockSize
- DiagnosticLog (L"MMC Driver Diagnostics - Test: Second Block\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, 2, MmcHostInstance->BlockIo.Media->BlockSize);
+ // LBA=1 Size=BlockSize
+ DiagnosticLog (L"MMC Driver Diagnostics - Test: First Block\n");
+ Status = MmcReadWriteDataTest (MmcHostInstance, 1, MmcHostInstance->BlockIo.Media->BlockSize);
- // LBA=10 Size=BlockSize
- DiagnosticLog (L"MMC Driver Diagnostics - Test: Any Block\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, MmcHostInstance->BlockIo.Media->LastBlock >> 1, MmcHostInstance->BlockIo.Media->BlockSize);
+ // LBA=2 Size=BlockSize
+ DiagnosticLog (L"MMC Driver Diagnostics - Test: Second Block\n");
+ Status = MmcReadWriteDataTest (MmcHostInstance, 2, MmcHostInstance->BlockIo.Media->BlockSize);
- // LBA=LastBlock Size=BlockSize
- DiagnosticLog (L"MMC Driver Diagnostics - Test: Last Block\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, MmcHostInstance->BlockIo.Media->LastBlock, MmcHostInstance->BlockIo.Media->BlockSize);
+ // LBA=10 Size=BlockSize
+ DiagnosticLog (L"MMC Driver Diagnostics - Test: Any Block\n");
+ Status = MmcReadWriteDataTest (MmcHostInstance, MmcHostInstance->BlockIo.Media->LastBlock >> 1, MmcHostInstance->BlockIo.Media->BlockSize);
- // LBA=1 Size=2*BlockSize
- DiagnosticLog (L"MMC Driver Diagnostics - Test: First Block / 2 BlockSSize\n");
- Status = MmcReadWriteDataTest (MmcHostInstance, 1, 2*MmcHostInstance->BlockIo.Media->BlockSize);
+ // LBA=LastBlock Size=BlockSize
+ DiagnosticLog (L"MMC Driver Diagnostics - Test: Last Block\n");
+ Status = MmcReadWriteDataTest (MmcHostInstance, MmcHostInstance->BlockIo.Media->LastBlock, MmcHostInstance->BlockIo.Media->BlockSize);
- CurrentLink = CurrentLink->ForwardLink;
- }
+ // LBA=1 Size=2*BlockSize
+ DiagnosticLog (L"MMC Driver Diagnostics - Test: First Block / 2 BlockSSize\n");
+ Status = MmcReadWriteDataTest (MmcHostInstance, 1, 2 * MmcHostInstance->BlockIo.Media->BlockSize);
return Status;
}
diff --git a/EmbeddedPkg/Universal/MmcDxe/Mmc.h b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
index 9104f60ae..e84c3c1cd 100644
--- a/EmbeddedPkg/Universal/MmcDxe/Mmc.h
+++ b/EmbeddedPkg/Universal/MmcDxe/Mmc.h
@@ -1,7 +1,7 @@
/** @file
Main Header file for the MMC DXE driver
- Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+ Copyright (c) 2011-2014, ARM Limited. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -58,6 +58,7 @@ typedef enum {
UNKNOWN_CARD,
MMC_CARD, //MMC card
MMC_CARD_HIGH, //MMC Card with High capacity
+ EMMC_CARD, //eMMC 4.41 card
SD_CARD, //SD 1.1 card
SD_CARD_2, //SD 2.0 or above standard card
SD_CARD_2_HIGH //SD 2.0 or above high capacity card
@@ -289,8 +290,15 @@ MmcFlushBlocks (
IN EFI_BLOCK_IO_PROTOCOL *This
);
-EFI_STATUS InitializeMmcDevice (
- IN MMC_HOST_INSTANCE *MmcHost
+EFI_STATUS
+MmcNotifyState (
+ IN MMC_HOST_INSTANCE *MmcHostInstance,
+ IN MMC_STATE State
+ );
+
+EFI_STATUS
+InitializeMmcDevice (
+ IN MMC_HOST_INSTANCE *MmcHost
);
VOID
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
index 82b3e54bb..8e13e05c3 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf b/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
index 80e15bb85..069b8c766 100644
--- a/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
@@ -1,7 +1,7 @@
#/** @file
# Build file for the MMC DXE driver
#
-# Copyright (c) 2011-2013, ARM Limited. All rights reserved.
+# Copyright (c) 2011-2014, ARM Limited. All rights reserved.
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -26,6 +26,7 @@
ComponentName.c
Mmc.c
MmcBlockIo.c
+ MmcIdentification.c
MmcDebug.c
Diagnostics.c
@@ -48,4 +49,4 @@
gEfiDriverDiagnostics2ProtocolGuid
[Depex]
- TRUE \ No newline at end of file
+ TRUE
diff --git a/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
new file mode 100644
index 000000000..32efe19c3
--- /dev/null
+++ b/EmbeddedPkg/Universal/MmcDxe/MmcIdentification.c
@@ -0,0 +1,456 @@
+/** @file
+*
+* Copyright (c) 2011-2014, ARM Limited. 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 <Library/TimerLib.h>
+
+#include "Mmc.h"
+
+typedef union {
+ UINT32 Raw;
+ OCR Ocr;
+} OCR_RESPONSE;
+
+#define MAX_RETRY_COUNT 1000
+#define CMD_RETRY_COUNT 20
+#define RCA_SHIFT_OFFSET 16
+#define EMMC_CARD_SIZE 512
+#define EMMC_ECSD_SIZE_OFFSET 53
+
+UINT32 mEmmcRcaCount = 0;
+
+STATIC
+EFI_STATUS
+EFIAPI
+EmmcIdentificationMode (
+ IN MMC_HOST_INSTANCE *MmcHostInstance,
+ IN OCR_RESPONSE Response
+ )
+{
+ EFI_MMC_HOST_PROTOCOL *Host;
+ EFI_BLOCK_IO_MEDIA *Media;
+ EFI_STATUS Status;
+ UINT32 RCA;
+ UINT32 ECSD[128];
+
+ Host = MmcHostInstance->MmcHost;
+ Media = MmcHostInstance->BlockIo.Media;
+
+ // Fetch card identity register
+ Status = Host->SendCommand (Host, MMC_CMD2, 0);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD2, Status=%r.\n", Status));
+ return Status;
+ }
+
+ Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CIDData));
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CID retrieval error, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Assign a relative address value to the card
+ MmcHostInstance->CardInfo.RCA = ++mEmmcRcaCount; // TODO: might need a more sophisticated way of doing this
+ RCA = MmcHostInstance->CardInfo.RCA << RCA_SHIFT_OFFSET;
+ Status = Host->SendCommand (Host, MMC_CMD3, RCA);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): RCA set error, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Fetch card specific data
+ Status = Host->SendCommand (Host, MMC_CMD9, RCA);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Failed to send CMD9, Status=%r.\n", Status));
+ return Status;
+ }
+
+ Status = Host->ReceiveResponse (Host, MMC_RESPONSE_TYPE_R2, (UINT32 *)&(MmcHostInstance->CardInfo.CSDData));
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): CSD retrieval error, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Select the card
+ Status = Host->SendCommand (Host, MMC_CMD7, RCA);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): Card selection error, Status=%r.\n", Status));
+ }
+
+ // Fetch ECSD
+ Status = Host->SendCommand (Host, MMC_CMD8, RCA);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD fetch error, Status=%r.\n", Status));
+ }
+
+ Status = Host->ReadBlockData (Host, 0, 512, ECSD);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "EmmcIdentificationMode(): ECSD read error, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Set up media
+ Media->BlockSize = EMMC_CARD_SIZE; // 512-byte support is mandatory for eMMC cards
+ Media->MediaId = MmcHostInstance->CardInfo.CIDData.PSN;
+ Media->ReadOnly = MmcHostInstance->CardInfo.CSDData.PERM_WRITE_PROTECT;
+ Media->LogicalBlocksPerPhysicalBlock = 1;
+ Media->IoAlign = 4;
+ // Compute last block using bits [215:212] of the ECSD
+ Media->LastBlock = ECSD[EMMC_ECSD_SIZE_OFFSET] - 1; // eMMC isn't supposed to report this for
+ // Cards <2GB in size, but the model does.
+
+ // Setup card type
+ MmcHostInstance->CardInfo.CardType = EMMC_CARD;
+ return EFI_SUCCESS;
+}
+
+STATIC
+EFI_STATUS
+InitializeSdMmcDevice (
+ IN MMC_HOST_INSTANCE *MmcHostInstance
+ )
+{
+ UINT32 CmdArg;
+ UINT32 Response[4];
+ UINTN BlockSize;
+ UINTN CardSize;
+ UINTN NumBlocks;
+ EFI_STATUS Status;
+ EFI_MMC_HOST_PROTOCOL *MmcHost;
+
+ MmcHost = MmcHostInstance->MmcHost;
+
+ // Send a command to get Card specific data
+ CmdArg = MmcHostInstance->CardInfo.RCA << 16;
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD9, CmdArg);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD9): Error, Status=%r\n", Status));
+ return Status;
+ }
+
+ // Read Response
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CSD, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(): Failed to receive CSD, Status=%r\n", Status));
+ return Status;
+ }
+ PrintCSD (Response);
+
+ if (MmcHostInstance->CardInfo.CardType == SD_CARD_2_HIGH) {
+ CardSize = HC_MMC_CSD_GET_DEVICESIZE (Response);
+ NumBlocks = ((CardSize + 1) * 1024);
+ BlockSize = 1 << MMC_CSD_GET_READBLLEN (Response);
+ } else {
+ CardSize = MMC_CSD_GET_DEVICESIZE (Response);
+ NumBlocks = (CardSize + 1) * (1 << (MMC_CSD_GET_DEVICESIZEMULT (Response) + 2));
+ BlockSize = 1 << MMC_CSD_GET_READBLLEN (Response);
+ }
+
+ // For >=2G card, BlockSize may be 1K, but the transfer size is 512 bytes.
+ if (BlockSize > 512) {
+ NumBlocks = MultU64x32 (NumBlocks, BlockSize / 512);
+ BlockSize = 512;
+ }
+
+ MmcHostInstance->BlockIo.Media->LastBlock = (NumBlocks - 1);
+ MmcHostInstance->BlockIo.Media->BlockSize = BlockSize;
+ MmcHostInstance->BlockIo.Media->ReadOnly = MmcHost->IsReadOnly (MmcHost);
+ MmcHostInstance->BlockIo.Media->MediaPresent = TRUE;
+ MmcHostInstance->BlockIo.Media->MediaId++;
+
+ CmdArg = MmcHostInstance->CardInfo.RCA << 16;
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD7, CmdArg);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeSdMmcDevice(MMC_CMD7): Error and Status = %r\n", Status));
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
+STATIC
+EFI_STATUS
+EFIAPI
+MmcIdentificationMode (
+ IN MMC_HOST_INSTANCE *MmcHostInstance
+ )
+{
+ EFI_STATUS Status;
+ UINT32 Response[4];
+ UINTN Timeout;
+ UINTN CmdArg;
+ BOOLEAN IsHCS;
+ EFI_MMC_HOST_PROTOCOL *MmcHost;
+ OCR_RESPONSE OcrResponse;
+
+ MmcHost = MmcHostInstance->MmcHost;
+ CmdArg = 0;
+ IsHCS = FALSE;
+
+ if (MmcHost == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ // We can get into this function if we restart the identification mode
+ if (MmcHostInstance->State == MmcHwInitializationState) {
+ // Initialize the MMC Host HW
+ Status = MmcNotifyState (MmcHostInstance, MmcHwInitializationState);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcHwInitializationState, Status=%r.\n", Status));
+ return Status;
+ }
+ }
+
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD0, 0);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD0): Error, Status=%r.\n", Status));
+ return Status;
+ }
+ Status = MmcNotifyState (MmcHostInstance, MmcIdleState);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdleState, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Send CMD1 to get OCR (SD / MMC)
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, EMMC_CMD1_CAPACITY_GREATER_THAN_2GB);
+ if (Status == EFI_SUCCESS) {
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, (UINT32 *)&OcrResponse);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ return Status;
+ }
+
+ if (!OcrResponse.Ocr.PowerUp) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1): Card initialisation failure, Status=%r.\n", Status));
+ return EFI_DEVICE_ERROR;
+ }
+ OcrResponse.Ocr.PowerUp = 0;
+ if (OcrResponse.Raw == EMMC_CMD1_CAPACITY_GREATER_THAN_2GB) {
+ MmcHostInstance->CardInfo.OCRData.AccessMode = BIT1;
+ }
+ else {
+ MmcHostInstance->CardInfo.OCRData.AccessMode = 0x0;
+ }
+ if (OcrResponse.Raw == EMMC_CMD1_CAPACITY_GREATER_THAN_2GB ||
+ OcrResponse.Raw == EMMC_CMD1_CAPACITY_LESS_THAN_2GB) {
+ return EmmcIdentificationMode (MmcHostInstance, OcrResponse);
+ }
+ } else {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD1) : Failed to send command, Status=%r.\n", Status));
+ return Status;
+ }
+
+ // Are we using SDIO ?
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD5, 0);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD5): Error - SDIO not supported, Status=%r.\n", Status));
+ return EFI_UNSUPPORTED;
+ }
+
+ // Check which kind of card we are using. Ver2.00 or later SD Memory Card (PL180 is SD v1.1)
+ CmdArg = (0x0UL << 12 | BIT8 | 0xCEUL << 0);
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD8, CmdArg);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((EFI_D_ERROR, "Card is SD2.0 => Supports high capacity\n"));
+ IsHCS = TRUE;
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_R7, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive response to CMD8, Status=%r.\n", Status));
+ return Status;
+ }
+ PrintResponseR1 (Response[0]);
+ // Check if it is valid response
+ if (Response[0] != CmdArg) {
+ DEBUG ((EFI_D_ERROR, "The Card is not usable\n"));
+ return EFI_UNSUPPORTED;
+ }
+ } else {
+ DEBUG ((EFI_D_ERROR, "Not a SD2.0 Card\n"));
+ }
+
+ // We need to wait for the MMC or SD card is ready => (gCardInfo.OCRData.PowerUp == 1)
+ Timeout = MAX_RETRY_COUNT;
+ while (Timeout > 0) {
+ // SD Card or MMC Card ? CMD55 indicates to the card that the next command is an application specific command
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD55, 0);
+ if (Status == EFI_SUCCESS) {
+ DEBUG ((EFI_D_INFO, "Card should be SD\n"));
+ if (IsHCS) {
+ MmcHostInstance->CardInfo.CardType = SD_CARD_2;
+ } else {
+ MmcHostInstance->CardInfo.CardType = SD_CARD;
+ }
+
+ // Note: The first time CmdArg will be zero
+ CmdArg = ((UINTN *) &(MmcHostInstance->CardInfo.OCRData))[0];
+ if (IsHCS) {
+ CmdArg |= BIT30;
+ }
+ Status = MmcHost->SendCommand (MmcHost, MMC_ACMD41, CmdArg);
+ if (!EFI_ERROR (Status)) {
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ return Status;
+ }
+ ((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
+ }
+ } else {
+ DEBUG ((EFI_D_INFO, "Card should be MMC\n"));
+ MmcHostInstance->CardInfo.CardType = MMC_CARD;
+
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD1, 0x800000);
+ if (!EFI_ERROR (Status)) {
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_OCR, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive OCR, Status=%r.\n", Status));
+ return Status;
+ }
+ ((UINT32 *) &(MmcHostInstance->CardInfo.OCRData))[0] = Response[0];
+ }
+ }
+
+ if (!EFI_ERROR (Status)) {
+ if (!MmcHostInstance->CardInfo.OCRData.PowerUp) {
+ MicroSecondDelay (1);
+ Timeout--;
+ } else {
+ if ((MmcHostInstance->CardInfo.CardType == SD_CARD_2) && (MmcHostInstance->CardInfo.OCRData.AccessMode & BIT1)) {
+ MmcHostInstance->CardInfo.CardType = SD_CARD_2_HIGH;
+ DEBUG ((EFI_D_ERROR, "High capacity card.\n"));
+ }
+ break; // The MMC/SD card is ready. Continue the Identification Mode
+ }
+ } else {
+ MicroSecondDelay (1);
+ Timeout--;
+ }
+ }
+
+ if (Timeout == 0) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(): No Card\n"));
+ return EFI_NO_MEDIA;
+ } else {
+ PrintOCR (Response[0]);
+ }
+
+ Status = MmcNotifyState (MmcHostInstance, MmcReadyState);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcReadyState\n"));
+ return Status;
+ }
+
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD2, 0);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD2): Error\n"));
+ return Status;
+ }
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_CID, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive CID, Status=%r.\n", Status));
+ return Status;
+ }
+
+ PrintCID (Response);
+
+ Status = MmcHost->NotifyState (MmcHost, MmcIdentificationState);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcIdentificationState\n"));
+ return Status;
+ }
+
+ //
+ // Note, SD specifications say that "if the command execution causes a state change, it
+ // will be visible to the host in the response to the next command"
+ // The status returned for this CMD3 will be 2 - identification
+ //
+ CmdArg = 1;
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD3, CmdArg);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode(MMC_CMD3): Error\n"));
+ return Status;
+ }
+
+ Status = MmcHost->ReceiveResponse (MmcHost, MMC_RESPONSE_TYPE_RCA, Response);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Failed to receive RCA, Status=%r.\n", Status));
+ return Status;
+ }
+ PrintRCA (Response[0]);
+
+ // For MMC card, RCA is assigned by CMD3 while CMD3 dumps the RCA for SD card
+ if (MmcHostInstance->CardInfo.CardType != MMC_CARD) {
+ MmcHostInstance->CardInfo.RCA = Response[0] >> 16;
+ } else {
+ MmcHostInstance->CardInfo.RCA = CmdArg;
+ }
+ Status = MmcNotifyState (MmcHostInstance, MmcStandByState);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "MmcIdentificationMode() : Error MmcStandByState\n"));
+ return Status;
+ }
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+InitializeMmcDevice (
+ IN MMC_HOST_INSTANCE *MmcHostInstance
+ )
+{
+ EFI_STATUS Status;
+ EFI_MMC_HOST_PROTOCOL *MmcHost;
+ UINTN BlockCount;
+
+ BlockCount = 1;
+ MmcHost = MmcHostInstance->MmcHost;
+
+ Status = MmcIdentificationMode (MmcHostInstance);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error in Identification Mode, Status=%r\n", Status));
+ return Status;
+ }
+
+ Status = MmcNotifyState (MmcHostInstance, MmcTransferState);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeMmcDevice(): Error MmcTransferState, Status=%r\n", Status));
+ return Status;
+ }
+
+ if (MmcHostInstance->CardInfo.CardType != EMMC_CARD) {
+ Status = InitializeSdMmcDevice (MmcHostInstance);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+ }
+
+ // Set Block Length
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD16, MmcHostInstance->BlockIo.Media->BlockSize);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeMmcDevice(MMC_CMD16): Error MmcHostInstance->BlockIo.Media->BlockSize: %d and Error = %r\n",
+ MmcHostInstance->BlockIo.Media->BlockSize, Status));
+ return Status;
+ }
+
+ // Block Count (not used). Could return an error for SD card
+ if (MmcHostInstance->CardInfo.CardType == MMC_CARD) {
+ Status = MmcHost->SendCommand (MmcHost, MMC_CMD23, BlockCount);
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "InitializeMmcDevice(MMC_CMD23): Error, Status=%r\n", Status));
+ return Status;
+ }
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi b/FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi
index f94488fd7..2d4ac48fb 100644
--- a/FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi
+++ b/FatBinPkg/EnhancedFatDxe/Ebc/Fat.efi
Binary files differ
diff --git a/FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi b/FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi
index 878497ea5..fc91d652b 100644
--- a/FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi
+++ b/FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi
Binary files differ
diff --git a/FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi b/FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi
index e944b59a8..d462cd027 100644
--- a/FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi
+++ b/FatBinPkg/EnhancedFatDxe/Ipf/Fat.efi
Binary files differ
diff --git a/FatBinPkg/EnhancedFatDxe/X64/Fat.efi b/FatBinPkg/EnhancedFatDxe/X64/Fat.efi
index 97680767d..8197a091b 100644
--- a/FatBinPkg/EnhancedFatDxe/X64/Fat.efi
+++ b/FatBinPkg/EnhancedFatDxe/X64/Fat.efi
Binary files differ
diff --git a/FatBinPkg/FatBinPkg.dec b/FatBinPkg/FatBinPkg.dec
index 03f862104..1676086ac 100644
--- a/FatBinPkg/FatBinPkg.dec
+++ b/FatBinPkg/FatBinPkg.dec
@@ -2,7 +2,7 @@
# This package provides binary device drivers to support the FAT32 file system. This package is separated from other packages because it uses a different license.
#
# This package provides FAT drivers which are not licensed under BSD.
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this distribution.
@@ -16,5 +16,5 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = FatBinPkg
PACKAGE_GUID = EEAC1173-A27D-4c1a-958F-0A7F21C0FFA0
- PACKAGE_VERSION = 0.2
+ PACKAGE_VERSION = 0.3
diff --git a/FatBinPkg/ReadMe.txt b/FatBinPkg/ReadMe.txt
index 8b3e61143..255799baf 100644
--- a/FatBinPkg/ReadMe.txt
+++ b/FatBinPkg/ReadMe.txt
@@ -1,5 +1,5 @@
# Ebc, Ia32, Ipf, X64
- The binaries in this package currently are built from EDK2 release: MdePkg and BaseTools (head), FatPkg (r81)
+ The binaries in this package currently are built from EDK2 release: MdePkg and BaseTools (head), FatPkg (r82)
The binaries are built with no debug info (RELEASE TARGET).
The Component Name 2 Protocol and Unicode Collation 2 Protocol are supported.
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 99a76c9f2..2f48186d4 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -29,6 +29,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
LEGACY_BIOS_INSTANCE mPrivateData;
+//
+// The SMBIOS table in EfiRuntimeServicesData memory
+//
+VOID *mRuntimeSmbiosEntryPoint = NULL;
+
+//
+// The SMBIOS table in EfiReservedMemoryType memory
+//
+EFI_PHYSICAL_ADDRESS mReserveSmbiosEntryPoint = 0;
+EFI_PHYSICAL_ADDRESS mStructureTableAddress = 0;
+UINTN mStructureTablePages = 0;
+
/**
Do an AllocatePages () of type AllocateMaxAddress for EfiBootServicesCode
memory.
@@ -662,6 +674,98 @@ GetPciInterfaceVersion (
}
/**
+ Callback function to calculate SMBIOS table size, and allocate memory for SMBIOS table.
+ SMBIOS table will be copied into EfiReservedMemoryType memory in legacy boot path.
+
+ @param Event Event whose notification function is being invoked.
+ @param Context The pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+VOID
+EFIAPI
+InstallSmbiosEventCallback (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ EFI_STATUS Status;
+ SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure;
+
+ //
+ // Get SMBIOS table from EFI configuration table
+ //
+ Status = EfiGetSystemConfigurationTable (
+ &gEfiSmbiosTableGuid,
+ &mRuntimeSmbiosEntryPoint
+ );
+ if ((EFI_ERROR (Status)) || (mRuntimeSmbiosEntryPoint == NULL)) {
+ return;
+ }
+
+ EntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) mRuntimeSmbiosEntryPoint;
+
+ //
+ // Allocate memory for SMBIOS Entry Point Structure.
+ // CSM framework spec requires SMBIOS table below 4GB in EFI_TO_COMPATIBILITY16_BOOT_TABLE.
+ //
+ if (mReserveSmbiosEntryPoint == 0) {
+ //
+ // Entrypoint structure with fixed size is allocated only once.
+ //
+ mReserveSmbiosEntryPoint = SIZE_4GB - 1;
+ Status = gBS->AllocatePages (
+ AllocateMaxAddress,
+ EfiReservedMemoryType,
+ EFI_SIZE_TO_PAGES ((UINTN) (EntryPointStructure->EntryPointLength)),
+ &mReserveSmbiosEntryPoint
+ );
+ if (EFI_ERROR (Status)) {
+ mReserveSmbiosEntryPoint = 0;
+ return;
+ }
+ DEBUG ((EFI_D_INFO, "Allocate memory for Smbios Entry Point Structure\n"));
+ }
+
+ if ((mStructureTableAddress != 0) &&
+ (mStructureTablePages < (UINTN) EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength))) {
+ //
+ // If original buffer is not enough for the new SMBIOS table, free original buffer and re-allocate
+ //
+ gBS->FreePages (mStructureTableAddress, mStructureTablePages);
+ mStructureTableAddress = 0;
+ mStructureTablePages = 0;
+ DEBUG ((EFI_D_INFO, "Original size is not enough. Re-allocate the memory.\n"));
+ }
+
+ if (mStructureTableAddress == 0) {
+ //
+ // Allocate reserved memory below 4GB.
+ // Smbios spec requires the structure table is below 4GB.
+ //
+ mStructureTableAddress = SIZE_4GB - 1;
+ mStructureTablePages = EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength);
+ Status = gBS->AllocatePages (
+ AllocateMaxAddress,
+ EfiReservedMemoryType,
+ mStructureTablePages,
+ &mStructureTableAddress
+ );
+ if (EFI_ERROR (Status)) {
+ gBS->FreePages (
+ mReserveSmbiosEntryPoint,
+ EFI_SIZE_TO_PAGES ((UINTN) (EntryPointStructure->EntryPointLength))
+ );
+ mReserveSmbiosEntryPoint = 0;
+ mStructureTableAddress = 0;
+ mStructureTablePages = 0;
+ return;
+ }
+ DEBUG ((EFI_D_INFO, "Allocate memory for Smbios Structure Table\n"));
+ }
+}
+
+/**
Install Driver to produce Legacy BIOS protocol.
@param ImageHandle Handle of driver image.
@@ -697,6 +801,7 @@ LegacyBiosInstall (
EFI_GCD_MEMORY_SPACE_DESCRIPTOR Descriptor;
UINT64 Length;
UINT8 *SecureBoot;
+ EFI_EVENT InstallSmbiosEvent;
//
// Load this driver's image to memory
@@ -1009,6 +1114,24 @@ LegacyBiosInstall (
// Save EFI value
//
Private->ThunkSeg = (UINT16) (EFI_SEGMENT (IntRedirCode));
+
+ //
+ // Allocate reserved memory for SMBIOS table used in legacy boot if SMBIOS table exists
+ //
+ InstallSmbiosEventCallback (NULL, NULL);
+
+ //
+ // Create callback function to update the size of reserved memory after LegacyBiosDxe starts
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_NOTIFY,
+ InstallSmbiosEventCallback,
+ NULL,
+ &gEfiSmbiosTableGuid,
+ &InstallSmbiosEvent
+ );
+ ASSERT_EFI_ERROR (Status);
//
// Make a new handle and install the protocol
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
index a5ad0dfd2..e3084e601 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosDxe.inf
@@ -3,7 +3,7 @@
#
# This driver installs Legacy Bios Protocol to support CSM module work in EFI system.
#
-# Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions
@@ -103,6 +103,7 @@
[Guids]
gEfiDiskInfoIdeInterfaceGuid # ALWAYS_CONSUMED
+ gEfiSmbiosTableGuid # ALWAYS_CONSUMED
gEfiLegacyBiosGuid # ALWAYS_PRODUCED
[Guids.IA32]
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
index d60851a42..cc893a49a 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBiosInterface.h
@@ -19,6 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <FrameworkDxe.h>
#include <IndustryStandard/Pci.h>
+#include <IndustryStandard/SmBios.h>
#include <Guid/SmBios.h>
#include <Guid/Acpi.h>
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c
index dfdac356c..bf2760550 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBootSupport.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -33,6 +33,10 @@ UINT64 mLowWater = 0xffffffffffffffffULL;
extern BBS_TABLE *mBbsTable;
+extern VOID *mRuntimeSmbiosEntryPoint;
+extern EFI_PHYSICAL_ADDRESS mReserveSmbiosEntryPoint;
+extern EFI_PHYSICAL_ADDRESS mStructureTableAddress;
+
/**
Print the BBS Table.
@@ -777,6 +781,63 @@ LegacyGetDataOrTable (
return EFI_SUCCESS;
}
+/**
+ Copy SMBIOS table to EfiReservedMemoryType of memory for legacy boot.
+
+**/
+VOID
+CreateSmbiosTableInReservedMemory (
+ VOID
+ )
+{
+ SMBIOS_TABLE_ENTRY_POINT *EntryPointStructure;
+
+ if ((mRuntimeSmbiosEntryPoint == NULL) ||
+ (mReserveSmbiosEntryPoint == 0) ||
+ (mStructureTableAddress == 0)) {
+ return;
+ }
+
+ EntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *) mRuntimeSmbiosEntryPoint;
+
+ //
+ // Copy SMBIOS Entry Point Structure
+ //
+ CopyMem (
+ (VOID *)(UINTN) mReserveSmbiosEntryPoint,
+ EntryPointStructure,
+ EntryPointStructure->EntryPointLength
+ );
+
+ //
+ // Copy SMBIOS Structure Table into EfiReservedMemoryType memory
+ //
+ CopyMem (
+ (VOID *)(UINTN) mStructureTableAddress,
+ (VOID *)(UINTN) EntryPointStructure->TableAddress,
+ EntryPointStructure->TableLength
+ );
+
+ //
+ // Update TableAddress in Entry Point Structure
+ //
+ EntryPointStructure = (SMBIOS_TABLE_ENTRY_POINT *)(UINTN) mReserveSmbiosEntryPoint;
+ EntryPointStructure->TableAddress = (UINT32)(UINTN) mStructureTableAddress;
+
+ //
+ // Fixup checksums in the Entry Point Structure
+ //
+ EntryPointStructure->IntermediateChecksum = 0;
+ EntryPointStructure->EntryPointStructureChecksum = 0;
+
+ EntryPointStructure->IntermediateChecksum =
+ CalculateCheckSum8 (
+ (UINT8 *) EntryPointStructure + OFFSET_OF (SMBIOS_TABLE_ENTRY_POINT, IntermediateAnchorString),
+ EntryPointStructure->EntryPointLength - OFFSET_OF (SMBIOS_TABLE_ENTRY_POINT, IntermediateAnchorString)
+ );
+ EntryPointStructure->EntryPointStructureChecksum =
+ CalculateCheckSum8 ((UINT8 *) EntryPointStructure, EntryPointStructure->EntryPointLength);
+}
/**
Assign drive number to legacy HDD drives prior to booting an EFI
@@ -815,7 +876,6 @@ GenericLegacyBoot (
EFI_HANDLE IdeController;
UINTN HandleCount;
EFI_HANDLE *HandleBuffer;
- VOID *SmbiosTable;
VOID *AcpiTable;
UINTN ShadowAddress;
UINT32 Granularity;
@@ -904,21 +964,15 @@ GenericLegacyBoot (
);
Private->Legacy16Table->E820Length = (UINT32) CopySize;
}
- //
- // Get SMBIOS and ACPI table pointers
- //
- SmbiosTable = NULL;
- EfiGetSystemConfigurationTable (
- &gEfiSmbiosTableGuid,
- &SmbiosTable
- );
+
//
// We do not ASSERT if SmbiosTable not found. It is possbile that a platform does not produce SmbiosTable.
//
- if (SmbiosTable == NULL) {
+ if (mReserveSmbiosEntryPoint == 0) {
DEBUG ((EFI_D_INFO, "Smbios table is not found!\n"));
}
- EfiToLegacy16BootTable->SmbiosTable = (UINT32)(UINTN)SmbiosTable;
+ CreateSmbiosTableInReservedMemory ();
+ EfiToLegacy16BootTable->SmbiosTable = (UINT32)(UINTN)mReserveSmbiosEntryPoint;
AcpiTable = NULL;
Status = EfiGetSystemConfigurationTable (
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
index 9484b5d2c..9a5c8dbc2 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
@@ -2,7 +2,7 @@
# Intel Framework Module Package contains the definitions and module implementation
# which follows Intel EFI Framework Specification.
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -18,7 +18,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = IntelFrameworkModulePkg
PACKAGE_GUID = 88894582-7553-4822-B484-624E24B6DECF
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include # Root include for the package
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index 4f4d63dc4..4b135d9fb 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -3,7 +3,7 @@
#
# This file is used to build all modules in IntelFrameworkModulePkg.
#
-#Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+#Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#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
@@ -22,7 +22,7 @@
[Defines]
PLATFORM_NAME = IntelFrameworkModuleAll
PLATFORM_GUID = FFF87D9A-E5BB-4AFF-9ADE-8645492E8087
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/IntelFrameworkModuleAll
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
index d5016043c..f9be0308e 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootMaint.h
@@ -1,7 +1,7 @@
/** @file
Header file for boot maintenance module.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -124,8 +124,9 @@ typedef enum _FILE_EXPLORER_DISPLAY_CONTEXT {
#define FD_OPTION_OFFSET 0xC000
#define HD_OPTION_OFFSET 0xB000
#define CD_OPTION_OFFSET 0xA000
+#define FILE_OPTION_GOTO_OFFSET 0xC000
#define FILE_OPTION_OFFSET 0x8000
-#define FILE_OPTION_MASK 0x7FFF
+#define FILE_OPTION_MASK 0x3FFF
#define HANDLE_OPTION_OFFSET 0x7000
#define CONSOLE_OPTION_OFFSET 0x6000
#define TERMINAL_OPTION_OFFSET 0x5000
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
index 69e402ef9..72a5e2daa 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/FileExplorer.c
@@ -1,7 +1,7 @@
/** @file
File explorer related functions.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -75,7 +75,7 @@ UpdateFileExplorePage (
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL_STRING),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (FILE_OPTION_OFFSET + Index)
+ (UINT16) (FILE_OPTION_GOTO_OFFSET + Index)
);
}
}
@@ -320,13 +320,23 @@ FileExplorerCallback (
// Exit File Explorer formset
//
*ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ } else if (QuestionId >= FILE_OPTION_OFFSET && QuestionId < FILE_OPTION_GOTO_OFFSET) {
+ //
+ // Update forms may return TRUE or FALSE, need to check here.
+ //
+ if (UpdateFileExplorer (Private, QuestionId)) {
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ }
}
} else if (Action == EFI_BROWSER_ACTION_CHANGING) {
if (Value == NULL) {
return EFI_INVALID_PARAMETER;
}
- if (QuestionId >= FILE_OPTION_OFFSET) {
+ if (QuestionId >= FILE_OPTION_GOTO_OFFSET) {
+ //
+ // function will always return FALSE, no need to check here.
+ //
UpdateFileExplorer (Private, QuestionId);
}
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
index 1a3ec1ff8..477411377 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
@@ -2,7 +2,7 @@
Provides a way for 3rd party applications to register themselves for launch by the
Boot Manager based on hot key
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -315,6 +315,7 @@ HotkeyInsertList (
BDS_HOTKEY_OPTION *HotkeyLeft;
BDS_HOTKEY_OPTION *HotkeyRight;
UINTN Index;
+ EFI_BOOT_KEY_DATA KeyOptions;
UINT32 KeyShiftStateLeft;
UINT32 KeyShiftStateRight;
EFI_INPUT_KEY *InputKey;
@@ -327,28 +328,31 @@ HotkeyInsertList (
HotkeyLeft->Signature = BDS_HOTKEY_OPTION_SIGNATURE;
HotkeyLeft->BootOptionNumber = KeyOption->BootOption;
- HotkeyLeft->CodeCount = (UINT8) KEY_OPTION_INPUT_KEY_COUNT (KeyOption);
+
+ KeyOptions = KeyOption->KeyData;
+
+ HotkeyLeft->CodeCount = (UINT8) KeyOptions.Options.InputKeyCount;
//
// Map key shift state from KeyOptions to EFI_KEY_DATA.KeyState
//
KeyShiftStateRight = EFI_SHIFT_STATE_VALID;
- if (KEY_OPTION_SHIFT_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.ShiftPressed) {
KeyShiftStateRight |= EFI_RIGHT_SHIFT_PRESSED;
}
- if (KEY_OPTION_CONTROL_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.ControlPressed) {
KeyShiftStateRight |= EFI_RIGHT_CONTROL_PRESSED;
}
- if (KEY_OPTION_ALT_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.AltPressed) {
KeyShiftStateRight |= EFI_RIGHT_ALT_PRESSED;
}
- if (KEY_OPTION_LOGO_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.LogoPressed) {
KeyShiftStateRight |= EFI_RIGHT_LOGO_PRESSED;
}
- if (KEY_OPTION_MENU_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.MenuPressed) {
KeyShiftStateRight |= EFI_MENU_KEY_PRESSED;
}
- if (KEY_OPTION_SYS_REQ_PRESSED (KeyOption)) {
+ if (KeyOptions.Options.SysReqPressed) {
KeyShiftStateRight |= EFI_SYS_REQ_PRESSED;
}
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
index c67df160c..4ee5563a2 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
@@ -2,7 +2,7 @@
Provides a way for 3rd party applications to register themselves for launch by the
Boot Manager based on hot key
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -25,83 +25,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')
-/**
- Get the revision of the EFI_KEY_OPTION structure.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Revision.
-**/
-#define KEY_OPTION_REVISION(KeyOption) ((KeyOption)->KeyData & EFI_KEY_OPTION_REVISION_MASK)
-
-/**
- Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Actual number of entries in EFI_KEY_OPTION.Keys.
-**/
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
-
-/**
- Return whether the Shift key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE Shift key needs pressed.
- @retval FALSE Shift key needn't pressed.
-**/
-#define KEY_OPTION_SHIFT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SHIFT_PRESSED_MASK) != 0)
-
-/**
- Return whether the Control key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE Control key needs pressed.
- @retval FALSE Control key needn't pressed.
-**/
-#define KEY_OPTION_CONTROL_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_CONTROL_PRESSED_MASK) != 0)
-
-/**
- Return whether the Alt key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE Alt key needs pressed.
- @retval FALSE Alt key needn't pressed.
-**/
-#define KEY_OPTION_ALT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_ALT_PRESSED_MASK) != 0)
-
-/**
- Return whether the Logo key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE Logo key needs pressed.
- @retval FALSE Logo key needn't pressed.
-**/
-#define KEY_OPTION_LOGO_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_LOGO_PRESSED_MASK) != 0)
-
-/**
- Return whether the Menu key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE Menu key needs pressed.
- @retval FALSE Menu key needn't pressed.
-**/
-#define KEY_OPTION_MENU_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_MENU_PRESSED_MASK) != 0)
-
-/**
- Return whether the SysReq key needs pressed.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @retval TRUE SysReq key needs pressed.
- @retval FALSE SysReq key needn't pressed.
-**/
-#define KEY_OPTION_SYS_REQ_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK) != 0)
typedef struct {
UINTN Signature;
diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dec b/IntelFrameworkPkg/IntelFrameworkPkg.dec
index e949b8a62..6b8fd9441 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dec
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dec
@@ -2,7 +2,7 @@
# Intel Framework Package Reference Implementations
#
# This package provides definitions and libraries that comply to Intel Framework Specifications.
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this distribution.
@@ -16,7 +16,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = IntelFrameworkPkg
PACKAGE_GUID = 2759ded5-bb57-4b06-af4f-c398fa552719
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include # Root include for the package
diff --git a/IntelFrameworkPkg/IntelFrameworkPkg.dsc b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
index 6a0623f28..5013eddf8 100644
--- a/IntelFrameworkPkg/IntelFrameworkPkg.dsc
+++ b/IntelFrameworkPkg/IntelFrameworkPkg.dsc
@@ -3,7 +3,7 @@
#
# This DSC file is used for Package Level build.
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -23,7 +23,7 @@
[Defines]
PLATFORM_NAME = IntelFramework
PLATFORM_GUID = E76EB141-6EDB-43f3-A455-EF24A79673DD
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/IntelFramework
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index cc575b98c..c397a04cf 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -870,54 +870,18 @@ AtaAtapiPassThruStop (
Instance = ATA_PASS_THRU_PRIVATE_DATA_FROM_THIS (AtaPassThru);
- //
- // Close Non-Blocking timer and free Task list.
- //
- if (Instance->TimerEvent != NULL) {
- gBS->CloseEvent (Instance->TimerEvent);
- Instance->TimerEvent = NULL;
- }
- DestroyAsynTaskList (Instance, FALSE);
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ Controller,
+ &gEfiAtaPassThruProtocolGuid, &(Instance->AtaPassThru),
+ &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru),
+ NULL
+ );
- //
- // Disable this ATA host controller.
- //
- PciIo = Instance->PciIo;
- Status = PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationSupported,
- 0,
- &Supports
- );
- if (!EFI_ERROR (Status)) {
- Supports &= EFI_PCI_DEVICE_ENABLE;
- PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationDisable,
- Supports,
- NULL
- );
+ if (EFI_ERROR (Status)) {
+ return EFI_DEVICE_ERROR;
}
//
- // Restore original PCI attributes
- //
- Status = PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationSet,
- Instance->OriginalPciAttributes,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- gBS->UninstallMultipleProtocolInterfaces (
- Controller,
- &gEfiAtaPassThruProtocolGuid, &(Instance->AtaPassThru),
- &gEfiExtScsiPassThruProtocolGuid, &(Instance->ExtScsiPassThru),
- NULL
- );
-
- //
// Close protocols opened by AtaAtapiPassThru controller driver
//
gBS->CloseProtocol (
@@ -928,14 +892,24 @@ AtaAtapiPassThruStop (
);
//
+ // Close Non-Blocking timer and free Task list.
+ //
+ if (Instance->TimerEvent != NULL) {
+ gBS->CloseEvent (Instance->TimerEvent);
+ Instance->TimerEvent = NULL;
+ }
+ DestroyAsynTaskList (Instance, FALSE);
+ //
// Free allocated resource
//
- DestroyDeviceInfoList(Instance);
+ DestroyDeviceInfoList (Instance);
//
// If the current working mode is AHCI mode, then pre-allocated resource
// for AHCI initialization should be released.
//
+ PciIo = Instance->PciIo;
+
if (Instance->Mode == EfiAtaAhciMode) {
AhciRegisters = &Instance->AhciRegisters;
PciIo->Unmap (
@@ -966,6 +940,37 @@ AtaAtapiPassThruStop (
AhciRegisters->AhciRFis
);
}
+
+ //
+ // Disable this ATA host controller.
+ //
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSupported,
+ 0,
+ &Supports
+ );
+ if (!EFI_ERROR (Status)) {
+ Supports &= EFI_PCI_DEVICE_ENABLE;
+ PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationDisable,
+ Supports,
+ NULL
+ );
+ }
+
+ //
+ // Restore original PCI attributes
+ //
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSet,
+ Instance->OriginalPciAttributes,
+ NULL
+ );
+ ASSERT_EFI_ERROR (Status);
+
FreePool (Instance);
return Status;
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
index 3da1474ed..c9913c07c 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cBus.c
@@ -2,7 +2,7 @@
This file implements I2C IO Protocol which enables the user to manipulate a single
I2C device independent of the host controller and I2C design.
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1408,6 +1408,8 @@ I2cBusUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Get the list of all I2C Controller handles in the handle database.
@@ -1422,22 +1424,20 @@ I2cBusUnload (
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Disconnect the driver specified by Driver BindingHandle from all
- // the devices in the handle database.
- //
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- gI2cBusDriverBinding.DriverBindingHandle,
- NULL
- );
- if (EFI_ERROR (Status)) {
- goto Done;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by Driver BindingHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gI2cBusDriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto Done;
+ }
}
}
@@ -1448,14 +1448,47 @@ I2cBusUnload (
gI2cBusDriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
&gI2cBusDriverBinding,
- &gEfiComponentNameProtocolGuid,
- &gI2cBusComponentName,
- &gEfiComponentName2ProtocolGuid,
- &gI2cBusComponentName2,
NULL
);
ASSERT_EFI_ERROR (Status);
+ //
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
+ //
+ Status = gBS->HandleProtocol (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
+ );
+ }
+
+ Status = gBS->HandleProtocol (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cBusDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
+ }
+
+ Status = EFI_SUCCESS;
+
Done:
//
// Free the buffer containing the list of handles from the handle database
diff --git a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
index e153a4dc2..0cc8e3384 100644
--- a/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
+++ b/MdeModulePkg/Bus/I2c/I2cDxe/I2cHost.c
@@ -2,7 +2,7 @@
This file implements I2C Host Protocol which provides callers with the ability to
do I/O transactions to all of the devices on the I2C bus.
- Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -930,6 +930,7 @@ I2cHostQueueRequest (
I2C_HOST_CONTEXT *I2cHostContext;
BOOLEAN FirstRequest;
UINTN RequestPacketSize;
+ UINTN StartBit;
SyncEvent = NULL;
FirstRequest = FALSE;
@@ -938,6 +939,27 @@ I2cHostQueueRequest (
if (RequestPacket == NULL) {
return EFI_INVALID_PARAMETER;
}
+
+ if ((SlaveAddress & I2C_ADDRESSING_10_BIT) != 0) {
+ //
+ // 10-bit address, bits 0-9 are used for 10-bit I2C slave addresses,
+ // bits 10-30 are reserved bits and must be zero
+ //
+ StartBit = 10;
+ } else {
+ //
+ // 7-bit address, Bits 0-6 are used for 7-bit I2C slave addresses,
+ // bits 7-30 are reserved bits and must be zero
+ //
+ StartBit = 7;
+ }
+
+ if (BitFieldRead32 ((UINT32)SlaveAddress, StartBit, 30) != 0) {
+ //
+ // Reserved bit set in the SlaveAddress parameter
+ //
+ return EFI_NOT_FOUND;
+ }
I2cHostContext = I2C_HOST_CONTEXT_FROM_PROTOCOL (This);
@@ -1109,6 +1131,8 @@ I2cHostUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Get the list of all I2C Controller handles in the handle database.
@@ -1123,22 +1147,20 @@ I2cHostUnload (
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Disconnect the driver specified by ImageHandle from all
- // the devices in the handle database.
- //
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
- if (EFI_ERROR (Status)) {
- goto Done;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by ImageHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ ImageHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto Done;
+ }
}
}
@@ -1149,14 +1171,47 @@ I2cHostUnload (
gI2cHostDriverBinding.DriverBindingHandle,
&gEfiDriverBindingProtocolGuid,
&gI2cHostDriverBinding,
- &gEfiComponentNameProtocolGuid,
- &gI2cHostComponentName,
- &gEfiComponentName2ProtocolGuid,
- &gI2cHostComponentName2,
NULL
);
ASSERT_EFI_ERROR (Status);
+ //
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
+ //
+ Status = gBS->HandleProtocol (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
+ );
+ }
+
+ Status = gBS->HandleProtocol (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ gI2cHostDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
+ }
+
+ Status = EFI_SUCCESS;
+
Done:
//
// Free the buffer containing the list of handles from the handle database
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
index 59891b814..700e69e49 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/Ehci.c
@@ -2049,13 +2049,6 @@ EhcDriverBindingStop (
Ehc = EHC_FROM_THIS (Usb2Hc);
PciIo = Ehc->PciIo;
- //
- // Stop AsyncRequest Polling timer then stop the EHCI driver
- // and uninstall the EHCI protocl.
- //
- gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
- EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
-
Status = gBS->UninstallProtocolInterface (
Controller,
&gEfiUsb2HcProtocolGuid,
@@ -2066,6 +2059,13 @@ EhcDriverBindingStop (
return Status;
}
+ //
+ // Stop AsyncRequest Polling timer then stop the EHCI driver
+ // and uninstall the EHCI protocl.
+ //
+ gBS->SetTimer (Ehc->PollTimer, TimerCancel, EHC_ASYNC_POLL_INTERVAL);
+ EhcHaltHC (Ehc, EHC_GENERIC_TIMEOUT);
+
if (Ehc->PollTimer != NULL) {
gBS->CloseEvent (Ehc->PollTimer);
}
diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
index 4f187e3ab..ee40ba05c 100644
--- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
+++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpress.c
@@ -928,97 +928,102 @@ NvmExpressUnload (
EFI_HANDLE *DeviceHandleBuffer;
UINTN DeviceHandleCount;
UINTN Index;
- 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.
+ // Get the list of the device handles managed by this driver.
+ // If there is an error getting the list, then means the driver
+ // doesn't manage any device. At this way, we would only close
+ // those protocols installed at image handle.
//
+ DeviceHandleBuffer = NULL;
Status = gBS->LocateHandleBuffer (
- AllHandles,
- NULL,
+ ByProtocol,
+ &gEfiCallerIdGuid,
NULL,
&DeviceHandleCount,
&DeviceHandleBuffer
);
- if (EFI_ERROR (Status)) {
- return Status;
+ if (!EFI_ERROR (Status)) {
+ //
+ // Disconnect the driver specified by ImageHandle from all
+ // the devices in the handle database.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ ImageHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto EXIT;
+ }
+ }
}
//
- // Disconnect the driver specified by ImageHandle from all
- // the devices in the handle database.
+ // Uninstall all the protocols installed in the driver entry point
//
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid,
+ &gNvmExpressDriverBinding,
+ &gEfiDriverSupportedEfiVersionProtocolGuid,
+ &gNvmExpressDriverSupportedEfiVersion,
+ NULL
+ );
+
+ if (EFI_ERROR (Status)) {
+ goto EXIT;
}
//
- // Uninstall all the protocols installed in the driver entry point
+ // Note we have to one by one uninstall the following protocols.
+ // It's because some of them are optionally installed based on
+ // the following PCD settings.
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable
+ // gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable
+ // gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable
//
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiDriverBindingProtocolGuid,
- (VOID **) &DriverBinding
- );
-
- if (EFI_ERROR (Status)) {
- continue;
- }
-
- if (DriverBinding->ImageHandle != ImageHandle) {
- continue;
- }
-
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
gBS->UninstallProtocolInterface (
ImageHandle,
- &gEfiDriverBindingProtocolGuid,
- DriverBinding
+ &gEfiComponentNameProtocolGuid,
+ ComponentName
);
+ }
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiComponentNameProtocolGuid,
- (VOID **) &ComponentName
- );
- if (!EFI_ERROR (Status)) {
- gBS->UninstallProtocolInterface (
- ImageHandle,
- &gEfiComponentNameProtocolGuid,
- ComponentName
- );
- }
-
- Status = gBS->HandleProtocol (
- DeviceHandleBuffer[Index],
- &gEfiComponentName2ProtocolGuid,
- (VOID **) &ComponentName2
- );
- if (!EFI_ERROR (Status)) {
- gBS->UninstallProtocolInterface (
- ImageHandle,
- &gEfiComponentName2ProtocolGuid,
- ComponentName2
- );
- }
+ Status = gBS->HandleProtocol (
+ ImageHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallProtocolInterface (
+ ImageHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2
+ );
}
+ Status = EFI_SUCCESS;
+
+EXIT:
//
// Free the buffer containing the list of handles from the handle database
//
if (DeviceHandleBuffer != NULL) {
gBS->FreePool (DeviceHandleBuffer);
}
- return EFI_SUCCESS;
+ return Status;
}
/**
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
index 5afbb8229..2252235bc 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c
@@ -284,7 +284,11 @@ PciBusDriverBindingStart (
);
}
- gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+ if (PcdGetBool (PcdPciDisableBusEnumeration)) {
+ gFullEnumeration = FALSE;
+ } else {
+ gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE));
+ }
//
// Open Device Path Protocol for PCI root bridge
diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
index 34eb672df..917889ca0 100644
--- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
@@ -108,6 +108,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport
gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport
gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
# [Event]
# ##
diff --git a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
index 00a109437..a3a28f3ed 100644
--- a/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
+++ b/MdeModulePkg/Bus/Pci/UhciDxe/Uhci.c
@@ -1550,19 +1550,24 @@ UhciCleanDevUp (
)
{
USB_HC_DEV *Uhc;
+ EFI_STATUS Status;
//
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller
//
Uhc = UHC_FROM_USB2_HC_PROTO (This);
- UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
- gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- &Uhc->Usb2Hc
- );
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ &Uhc->Usb2Hc
+ );
+ if (EFI_ERROR (Status)) {
+ return ;
+ }
+
+ UhciStopHc (Uhc, UHC_GENERIC_TIMEOUT);
UhciFreeAllAsyncReq (Uhc);
UhciDestoryFrameList (Uhc);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index 5ca58fbb9..a831abe77 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -451,7 +451,7 @@ XhcGetRootHubPortStatus (
for (Index = 0; Index < MapSize; Index++) {
if (XHC_BIT_IS_SET (State, mUsbClearPortChangeMap[Index].HwState)) {
- XhcClearRootHubPortFeature (This, PortNumber, mUsbClearPortChangeMap[Index].Selector);
+ XhcClearRootHubPortFeature (This, PortNumber, (EFI_USB_PORT_FEATURE)mUsbClearPortChangeMap[Index].Selector);
}
}
@@ -2129,6 +2129,16 @@ XhcDriverBindingStop (
return Status;
}
+ Status = gBS->UninstallProtocolInterface (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ Usb2Hc
+ );
+
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
Xhc = XHC_FROM_THIS (Usb2Hc);
PciIo = Xhc->PciIo;
@@ -2154,19 +2164,6 @@ XhcDriverBindingStop (
}
}
- XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
- XhcClearBiosOwnership (Xhc);
-
- Status = gBS->UninstallProtocolInterface (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- Usb2Hc
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
if (Xhc->PollTimer != NULL) {
gBS->CloseEvent (Xhc->PollTimer);
}
@@ -2175,6 +2172,8 @@ XhcDriverBindingStop (
gBS->CloseEvent (Xhc->ExitBootServiceEvent);
}
+ XhcHaltHC (Xhc, XHC_GENERIC_TIMEOUT);
+ XhcClearBiosOwnership (Xhc);
XhciDelAllAsyncIntTransfers (Xhc);
XhcFreeSched (Xhc);
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
index a66d7cd95..a513dd958 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.c
@@ -2,7 +2,7 @@
The XHCI register operation routines.
-Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -499,7 +499,7 @@ XhcClearOpRegBit (
@param Offset The offset of the operation register.
@param Bit The bit of the register to wait for.
@param WaitToSet Wait the bit to set or clear.
- @param Timeout The time to wait before abort (in millisecond, ms).
+ @param Timeout The time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The bit successfully changed by host controller.
@retval EFI_TIMEOUT The time out occurred.
@@ -517,7 +517,7 @@ XhcWaitOpRegBit (
UINT32 Index;
UINTN Loop;
- Loop = (Timeout * XHC_1_MILLISECOND / XHC_POLL_DELAY) + 1;
+ Loop = (Timeout / XHC_POLL_DELAY) + 1;
for (Index = 0; Index < Loop; Index++) {
if (XHC_REG_BIT_IS_SET (Xhc, Offset, Bit) == WaitToSet) {
@@ -656,7 +656,7 @@ XhcIsSysError (
Reset the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The XHCI host controller is reset.
@return Others Failed to reset the XHCI before Timeout.
@@ -698,7 +698,7 @@ XhcResetHC (
Halt the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is halt.
@return EFI_TIMEOUT Failed to halt the XHCI before Timeout.
@@ -722,7 +722,7 @@ XhcHaltHC (
Set the XHCI host controller to run.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is running.
@return EFI_TIMEOUT Failed to set the XHCI to run before Timeout.
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
index dc8281198..b748c8d39 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciReg.h
@@ -198,8 +198,13 @@ typedef union {
//
// Hub Class Feature Selector for Clear Port Feature Request
+// It's the extension of hub class feature selector of USB 2.0 in USB 3.0 Spec.
+// For more details, Please refer to USB 3.0 Spec Table 10-7.
//
-#define Usb3PortBHPortResetChange 29
+typedef enum {
+ Usb3PortBHPortReset = 28,
+ Usb3PortBHPortResetChange = 29
+} XHC_PORT_FEATURE;
//
// Structure to map the hardware port states to the
@@ -394,7 +399,7 @@ XhcClearOpRegBit (
@param Offset The offset of the operational register.
@param Bit The bit of the register to wait for.
@param WaitToSet Wait the bit to set or clear.
- @param Timeout The time to wait before abort (in millisecond, ms).
+ @param Timeout The time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The bit successfully changed by host controller.
@retval EFI_TIMEOUT The time out occurred.
@@ -516,7 +521,7 @@ XhcIsSysError (
Reset the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@retval EFI_SUCCESS The XHCI host controller is reset.
@return Others Failed to reset the XHCI before Timeout.
@@ -532,7 +537,7 @@ XhcResetHC (
Halt the XHCI host controller.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is halt.
@return EFI_TIMEOUT Failed to halt the XHCI before Timeout.
@@ -548,7 +553,7 @@ XhcHaltHC (
Set the XHCI host controller to run.
@param Xhc The XHCI Instance.
- @param Timeout Time to wait before abort (in millisecond, ms).
+ @param Timeout Time to wait before abort (in microsecond, us).
@return EFI_SUCCESS The XHCI host controller is running.
@return EFI_TIMEOUT Failed to set the XHCI to run before Timeout.
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
index ff6b99c87..ef002f53b 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
@@ -1402,6 +1402,7 @@ UsbBusControllerDriverStop (
EFI_TPL OldTpl;
UINTN Index;
EFI_STATUS Status;
+ EFI_STATUS ReturnStatus;
Status = EFI_SUCCESS;
@@ -1411,6 +1412,7 @@ UsbBusControllerDriverStop (
//
OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
+ ReturnStatus = EFI_SUCCESS;
for (Index = 0; Index < NumberOfChildren; Index++) {
Status = gBS->OpenProtocol (
ChildHandleBuffer[Index],
@@ -1434,11 +1436,11 @@ UsbBusControllerDriverStop (
UsbIf = USB_INTERFACE_FROM_USBIO (UsbIo);
UsbDev = UsbIf->Device;
- UsbRemoveDevice (UsbDev);
+ ReturnStatus = UsbRemoveDevice (UsbDev);
}
gBS->RestoreTPL (OldTpl);
- return EFI_SUCCESS;
+ return ReturnStatus;
}
DEBUG (( EFI_D_INFO, "UsbBusStop: usb bus stopped on %p\n", Controller));
@@ -1471,53 +1473,60 @@ UsbBusControllerDriverStop (
RootHub = Bus->Devices[0];
RootIf = RootHub->Interfaces[0];
- mUsbRootHubApi.Release (RootIf);
-
ASSERT (Bus->MaxDevices <= 256);
+ ReturnStatus = EFI_SUCCESS;
for (Index = 1; Index < Bus->MaxDevices; Index++) {
if (Bus->Devices[Index] != NULL) {
- UsbRemoveDevice (Bus->Devices[Index]);
+ Status = UsbRemoveDevice (Bus->Devices[Index]);
+ if (EFI_ERROR (Status)) {
+ ReturnStatus = Status;
+ }
}
}
gBS->RestoreTPL (OldTpl);
- gBS->FreePool (RootIf);
- gBS->FreePool (RootHub);
- Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList);
- ASSERT (!EFI_ERROR (Status));
+ if (!EFI_ERROR (ReturnStatus)) {
+ mUsbRootHubApi.Release (RootIf);
+ gBS->FreePool (RootIf);
+ gBS->FreePool (RootHub);
- //
- // Uninstall the bus identifier and close USB_HC/USB2_HC protocols
- //
- gBS->UninstallProtocolInterface (Controller, &gEfiCallerIdGuid, &Bus->BusId);
+ Status = UsbBusFreeUsbDPList (&Bus->WantedUsbIoDPList);
+ ASSERT (!EFI_ERROR (Status));
- if (Bus->Usb2Hc != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUsb2HcProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
+ //
+ // Uninstall the bus identifier and close USB_HC/USB2_HC protocols
+ //
+ gBS->UninstallProtocolInterface (Controller, &gEfiCallerIdGuid, &Bus->BusId);
- if (Bus->UsbHc != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUsbHcProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
+ if (Bus->Usb2Hc != NULL) {
+ Status = gBS->CloseProtocol (
+ Controller,
+ &gEfiUsb2HcProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ }
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
+ if (Bus->UsbHc != NULL) {
+ Status = gBS->CloseProtocol (
+ Controller,
+ &gEfiUsbHcProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ }
- gBS->FreePool (Bus);
+ if (!EFI_ERROR (Status)) {
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiDevicePathProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+ gBS->FreePool (Bus);
+ }
+ }
return Status;
}
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 96381cd8c..3c867bfb1 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -1,7 +1,7 @@
/** @file
EFI PEI Core dispatch services
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -49,7 +49,7 @@ DiscoverPeimsAndOrderWithApriori (
UINTN PeimIndex;
UINTN PeimCount;
EFI_GUID *Guid;
- EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
+ EFI_PEI_FILE_HANDLE TempFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv) + 1];
EFI_GUID FileGuid[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];
EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;
EFI_FV_FILE_INFO FileInfo;
@@ -75,20 +75,21 @@ DiscoverPeimsAndOrderWithApriori (
//
// Go ahead to scan this Fv, and cache FileHandles within it.
//
- for (PeimCount = 0; PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
+ Status = EFI_NOT_FOUND;
+ for (PeimCount = 0; PeimCount <= FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv); PeimCount++) {
Status = FvPpi->FindFileByType (FvPpi, PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE, CoreFileHandle->FvHandle, &FileHandle);
- if (Status != EFI_SUCCESS) {
+ if (Status != EFI_SUCCESS || PeimCount == FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)) {
break;
}
Private->CurrentFvFileHandles[PeimCount] = FileHandle;
}
-
+
//
- // Check whether the count of Peims exceeds the max support PEIMs in a FV image
- // If more Peims are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
+ // Check whether the count of files exceeds the max support files in a FV image
+ // If more files are required in a FV image, PcdPeiCoreMaxPeimPerFv can be set to a larger value in DSC file.
//
- ASSERT (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv));
+ ASSERT ((Status != EFI_SUCCESS) || (PeimCount < FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)));
//
// Get Apriori File handle
@@ -660,6 +661,7 @@ PeiDispatcher (
PEIM_FILE_HANDLE_EXTENDED_DATA ExtendedData;
EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI *TemporaryRamSupportPpi;
UINT64 NewStackSize;
+ UINTN HeapTemporaryRamSize;
EFI_PHYSICAL_ADDRESS BaseOfNewHeap;
EFI_PHYSICAL_ADDRESS TopOfNewStack;
EFI_PHYSICAL_ADDRESS TopOfOldStack;
@@ -995,13 +997,21 @@ PeiDispatcher (
PeiCore (SecCoreData, NULL, Private);
} else {
//
+ // Migrate the PEI Services Table pointer from temporary RAM to permanent RAM.
+ //
+ MigratePeiServicesTablePointer ();
+
+ //
// Heap Offset
//
BaseOfNewHeap = TopOfNewStack;
HoleMemBase = TopOfNewStack;
HoleMemSize = TemporaryRamSize - PeiTemporaryRamSize - TemporaryStackSize;
if (HoleMemSize != 0) {
- BaseOfNewHeap = BaseOfNewHeap + HoleMemSize;
+ //
+ // Make sure HOB List start address is 8 byte alignment.
+ //
+ BaseOfNewHeap = ALIGN_VALUE (BaseOfNewHeap + HoleMemSize, 8);
}
if (BaseOfNewHeap >= (UINTN)SecCoreData->PeiTemporaryRamBase) {
Private->HeapOffsetPositive = TRUE;
@@ -1014,7 +1024,9 @@ PeiDispatcher (
//
// Migrate Heap
//
- CopyMem ((UINT8 *) (UINTN) BaseOfNewHeap, (UINT8 *) PeiTemporaryRamBase, PeiTemporaryRamSize);
+ HeapTemporaryRamSize = (UINTN) (Private->HobList.HandoffInformationTable->EfiFreeMemoryBottom - Private->HobList.HandoffInformationTable->EfiMemoryBottom);
+ ASSERT (BaseOfNewHeap + HeapTemporaryRamSize <= Private->FreePhysicalMemoryTop);
+ CopyMem ((UINT8 *) (UINTN) BaseOfNewHeap, (UINT8 *) PeiTemporaryRamBase, HeapTemporaryRamSize);
//
// Migrate Stack
diff --git a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
index c7a06a3c5..10f21d562 100644
--- a/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
+++ b/MdeModulePkg/Core/Pei/Memory/MemoryServices.c
@@ -1,7 +1,7 @@
/** @file
EFI PEI Core memory services
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -182,7 +182,7 @@ PeiAllocatePages (
//
// Verify that there is sufficient memory to satisfy the allocation
//
- RemainingPages = EFI_SIZE_TO_PAGES ((UINTN) (*FreeMemoryTop - *FreeMemoryBottom));
+ RemainingPages = (UINTN)(*FreeMemoryTop - *FreeMemoryBottom) >> EFI_PAGE_SHIFT;
//
// For page allocation, the overhead sizeof (EFI_HOB_MEMORY_ALLOCATION) needs one extra page.
// So the number of remaining pages needs to be greater than that of the request pages.
diff --git a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
index 16384f831..b3016eee5 100644
--- a/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
+++ b/MdeModulePkg/Include/Library/CpuExceptionHandlerLib.h
@@ -85,7 +85,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/MdeModulePkg/Include/Protocol/FormBrowserEx.h b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
index afeb7c0c0..3bb64c6ff 100644
--- a/MdeModulePkg/Include/Protocol/FormBrowserEx.h
+++ b/MdeModulePkg/Include/Protocol/FormBrowserEx.h
@@ -27,6 +27,7 @@ typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION
#define BROWSER_NO_CHANGES 0
#define BROWSER_SAVE_CHANGES 1
#define BROWSER_DISCARD_CHANGES 2
+#define BROWSER_KEEP_CURRENT 3
//
// Browser actions. They can be cominbed together.
@@ -126,6 +127,7 @@ VOID
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
typedef
diff --git a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
index ded14a335..2fea24ac3 100644
--- a/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
+++ b/MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.c
@@ -86,7 +86,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
index 82ab82bb3..ad4bc9ac9 100644
--- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
+++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c
@@ -322,7 +322,9 @@ ProcessExternedOpcode (
)
{
LIST_ENTRY *Link;
+ LIST_ENTRY *NestLink;
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+ FORM_DISPLAY_ENGINE_STATEMENT *NestStatement;
Link = GetFirstNode (&FormData->StatementListOSF);
while (!IsNull (&FormData->StatementListOSF, Link)) {
@@ -338,6 +340,15 @@ ProcessExternedOpcode (
Link = GetNextNode (&FormData->StatementListHead, Link);
ProcessUserOpcode(Statement->OpCode);
+
+ NestLink = GetFirstNode (&Statement->NestStatementList);
+ while (!IsNull (&Statement->NestStatementList, NestLink)) {
+ NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
+ NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
+
+ ProcessUserOpcode(NestStatement->OpCode);
+ }
+
}
}
diff --git a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
index 97e065aee..bbb755fa2 100644
--- a/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c
@@ -2,7 +2,7 @@
Support routines for memory allocation routines based
on boot services for Dxe phase drivers.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -160,6 +160,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -246,6 +247,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -273,6 +275,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -300,6 +303,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index c087dd940..eab1b4180 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -1,7 +1,7 @@
/** @file
Save the S3 data to S3 boot script.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -62,7 +62,7 @@ EFI_GUID mBootScriptHeaderDataGuid = {
This is an internal function to add a terminate node the entry, recalculate the table
length and fill into the table.
- @return the base address of the boot script tble.
+ @return the base address of the boot script table.
**/
UINT8*
S3BootScriptInternalCloseTable (
@@ -651,7 +651,7 @@ SyncBootScript (
how to get the script to run on an S3 resume because the boot script maintained by the lib will be
destroyed.
- @return the base address of the new copy of the boot script tble.
+ @return the base address of the new copy of the boot script table.
@note this function could only called in boot time phase
**/
diff --git a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
index 7435844fb..a6372ed75 100644
--- a/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/MemoryAllocationLib.c
@@ -1,7 +1,7 @@
/** @file
Support routines for memory allocation routines based on SMM Core internal functions.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -251,6 +251,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -337,6 +338,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -364,6 +366,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -391,6 +394,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index b627eb101..a557466cd 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -4,7 +4,7 @@
# It also provides the defintions(including PPIs/PROTOCOLs/GUIDs and library classes)
# and libraries instances, which are used for those modules.
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -20,7 +20,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = MdeModulePkg
PACKAGE_GUID = BA0D78D6-2CAF-414b-BD4D-B6762A894288
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include
@@ -522,15 +522,11 @@
# for a dynamic PCD used in PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPcdCallBackNumberPerPcdEntry|0x08|UINT32|0x0001000f
- ## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
- # to store PCD value.
- #
- gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010
-
## Maximum number of FV is supported by PeiCore's dispatching.
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported|6|UINT32|0x00010030
- ## Maximum PEIM count in every FV is supported by PeiCore's dispatching.
+ ## Maximum File count in every FV is supported by PeiCore's dispatching.
+ # PeiCore supported File type includes PEIM, Combined PEIM and FV.
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv|32|UINT32|0x00010031
## Maximum stack size for PeiCore.
@@ -608,6 +604,11 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdProgressCodeS3SuspendEnd|0x03078001|UINT32|0x30001033
[PcdsFixedAtBuild,PcdsPatchableInModule]
+ ## VPD type PCD allow developer point an absoluted physical address PcdVpdBaseAddress
+ # to store PCD value.
+ #
+ gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0|UINT32|0x00010010
+
## Maximun number of performance log entries during PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
@@ -878,6 +879,9 @@
## This PCD specified whether the S.M.A.R.T feature of attached ATA hard disks are enabled.
gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable|TRUE|BOOLEAN|0x00010065
+ ## This PCD specifies whether full PCI enumeration is disabled.
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048
+
[PcdsPatchableInModule]
## Specify memory size with page number for PEI code when
# the feature of Loading Module at Fixed Address is enabled
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index f31a4d156..f47332534 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -1,7 +1,7 @@
## @file
# EFI/PI Reference Module Package for All Architectures
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,7 +16,7 @@
[Defines]
PLATFORM_NAME = MdeModule
PLATFORM_GUID = 587CE499-6CBE-43cd-94E2-186218569478
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/MdeModule
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
diff --git a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
index 0861a6477..61ee91951 100644
--- a/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
+++ b/MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c
@@ -41,6 +41,9 @@ EFI_HANDLE mNewHandle = NULL;
//
UINTN mTimes = 0;
+UINT32 mMaxSizePopulateCapsule = 0;
+UINT32 mMaxSizeNonPopulateCapsule = 0;
+
/**
Create the variable to save the base address of page table and stack
for transferring into long mode in IA32 PEI.
@@ -339,13 +342,13 @@ QueryCapsuleCapabilities (
return EFI_UNSUPPORTED;
}
*ResetType = EfiResetWarm;
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizePopulateCapsule);
+ *MaxiumCapsuleSize = (UINT64) mMaxSizePopulateCapsule;
} else {
//
// For non-reset capsule image.
//
*ResetType = EfiResetCold;
- *MaxiumCapsuleSize = FixedPcdGet32(PcdMaxSizeNonPopulateCapsule);
+ *MaxiumCapsuleSize = (UINT64) mMaxSizeNonPopulateCapsule;
}
return EFI_SUCCESS;
@@ -370,7 +373,10 @@ CapsuleServiceInitialize (
)
{
EFI_STATUS Status;
-
+
+ mMaxSizePopulateCapsule = PcdGet32(PcdMaxSizePopulateCapsule);
+ mMaxSizeNonPopulateCapsule = PcdGet32(PcdMaxSizeNonPopulateCapsule);
+
//
// When PEI phase is IA32, DXE phase is X64, it is possible that capsule data are
// put above 4GB, so capsule PEI will transfer to long mode to get capsule data.
diff --git a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
index 2616299df..00889a246 100644
--- a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
+++ b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
@@ -4,7 +4,7 @@
ALL CODE IN THE SERIALIO STACK MUST BE RE-ENTRANT AND CALLABLE FROM
INTERRUPT CONTEXT
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -33,7 +33,6 @@ DEBUGPORT_DEVICE mDebugPortDevice = {
DEBUGPORT_DEVICE_SIGNATURE,
(EFI_HANDLE) 0,
(EFI_HANDLE) 0,
- (VOID *) NULL,
(EFI_DEVICE_PATH_PROTOCOL *) NULL,
{
DebugPortReset,
@@ -57,72 +56,52 @@ DEBUGPORT_DEVICE mDebugPortDevice = {
Records requested settings in DebugPort device structure.
**/
-VOID
+EFI_DEVICE_PATH_PROTOCOL *
GetDebugPortVariable (
VOID
)
{
UINTN DataSize;
+ EFI_DEVICE_PATH_PROTOCOL *DebugPortVariable;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
- EFI_STATUS Status;
-
- DataSize = 0;
- Status = gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- mDebugPortDevice.DebugPortVariable
- );
-
- if (Status == EFI_BUFFER_TOO_SMALL) {
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- FreePool (mDebugPortDevice.DebugPortVariable);
- }
+ GetVariable2 (EFI_DEBUGPORT_VARIABLE_NAME, &gEfiDebugPortVariableGuid, (VOID **) &DebugPortVariable, &DataSize);
+ if (DebugPortVariable == NULL) {
+ return NULL;
+ }
- mDebugPortDevice.DebugPortVariable = AllocatePool (DataSize);
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- gRT->GetVariable (
- (CHAR16 *) EFI_DEBUGPORT_VARIABLE_NAME,
- &gEfiDebugPortVariableGuid,
- NULL,
- &DataSize,
- mDebugPortDevice.DebugPortVariable
- );
- DevicePath = (EFI_DEVICE_PATH_PROTOCOL *) mDebugPortDevice.DebugPortVariable;
- while (!IsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {
- DevicePath = NextDevicePathNode (DevicePath);
- }
+ DevicePath = DebugPortVariable;
+ while (!IsDevicePathEnd (DevicePath) && !IS_UART_DEVICEPATH (DevicePath)) {
+ DevicePath = NextDevicePathNode (DevicePath);
+ }
- if (IsDevicePathEnd (DevicePath)) {
- FreePool (mDebugPortDevice.DebugPortVariable);
- mDebugPortDevice.DebugPortVariable = NULL;
- } else {
- CopyMem (
- &mDebugPortDevice.BaudRate,
- &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
- );
- mDebugPortDevice.ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
- mDebugPortDevice.Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
- CopyMem (
- &mDebugPortDevice.Parity,
- &((UART_DEVICE_PATH *) DevicePath)->Parity,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
- );
- CopyMem (
- &mDebugPortDevice.DataBits,
- &((UART_DEVICE_PATH *) DevicePath)->DataBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
- );
- CopyMem (
- &mDebugPortDevice.StopBits,
- &((UART_DEVICE_PATH *) DevicePath)->StopBits,
- sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
- );
- }
- }
+ if (IsDevicePathEnd (DevicePath)) {
+ FreePool (DebugPortVariable);
+ return NULL;
+ } else {
+ CopyMem (
+ &mDebugPortDevice.BaudRate,
+ &((UART_DEVICE_PATH *) DevicePath)->BaudRate,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->BaudRate)
+ );
+ mDebugPortDevice.ReceiveFifoDepth = DEBUGPORT_UART_DEFAULT_FIFO_DEPTH;
+ mDebugPortDevice.Timeout = DEBUGPORT_UART_DEFAULT_TIMEOUT;
+ CopyMem (
+ &mDebugPortDevice.Parity,
+ &((UART_DEVICE_PATH *) DevicePath)->Parity,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->Parity)
+ );
+ CopyMem (
+ &mDebugPortDevice.DataBits,
+ &((UART_DEVICE_PATH *) DevicePath)->DataBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->DataBits)
+ );
+ CopyMem (
+ &mDebugPortDevice.StopBits,
+ &((UART_DEVICE_PATH *) DevicePath)->StopBits,
+ sizeof (((UART_DEVICE_PATH *) DevicePath)->StopBits)
+ );
+ return DebugPortVariable;
}
}
@@ -196,8 +175,8 @@ DebugPortSupported (
)
{
EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *Dp1;
- EFI_DEVICE_PATH_PROTOCOL *Dp2;
+ EFI_DEVICE_PATH_PROTOCOL *DevicePath;
+ EFI_DEVICE_PATH_PROTOCOL *DebugPortVariable;
EFI_SERIAL_IO_PROTOCOL *SerialIo;
EFI_DEBUGPORT_PROTOCOL *DebugPortInterface;
EFI_HANDLE TempHandle;
@@ -212,25 +191,19 @@ DebugPortSupported (
//
// Read DebugPort variable to determine debug port selection and parameters
//
- GetDebugPortVariable ();
+ DebugPortVariable = GetDebugPortVariable ();
- if (mDebugPortDevice.DebugPortVariable != NULL) {
+ if (DebugPortVariable != NULL) {
//
// There's a DEBUGPORT variable, so do LocateDevicePath and check to see if
// the closest matching handle matches the controller handle, and if it does,
// check to see that the remaining device path has the DebugPort GUIDed messaging
// device path only. Otherwise, it's a mismatch and EFI_UNSUPPORTED is returned.
//
- Dp1 = DuplicateDevicePath ((EFI_DEVICE_PATH_PROTOCOL *) mDebugPortDevice.DebugPortVariable);
- if (Dp1 == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Dp2 = Dp1;
-
+ DevicePath = DebugPortVariable;
Status = gBS->LocateDevicePath (
&gEfiSerialIoProtocolGuid,
- &Dp2,
+ &DevicePath,
&TempHandle
);
@@ -239,18 +212,18 @@ DebugPortSupported (
}
if (Status == EFI_SUCCESS &&
- (Dp2->Type != MESSAGING_DEVICE_PATH ||
- Dp2->SubType != MSG_VENDOR_DP ||
- *((UINT16 *) Dp2->Length) != sizeof (DEBUGPORT_DEVICE_PATH))) {
+ (DevicePath->Type != MESSAGING_DEVICE_PATH ||
+ DevicePath->SubType != MSG_VENDOR_DP ||
+ *((UINT16 *) DevicePath->Length) != sizeof (DEBUGPORT_DEVICE_PATH))) {
Status = EFI_UNSUPPORTED;
}
- if (Status == EFI_SUCCESS && !CompareGuid (&gEfiDebugPortDevicePathGuid, (GUID *) (Dp2 + 1))) {
+ if (Status == EFI_SUCCESS && !CompareGuid (&gEfiDebugPortDevicePathGuid, (GUID *) (DevicePath + 1))) {
Status = EFI_UNSUPPORTED;
}
- FreePool (Dp1);
+ FreePool (DebugPortVariable);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -713,16 +686,60 @@ ImageUnloadHandler (
EFI_HANDLE ImageHandle
)
{
+ EFI_STATUS Status;
+ VOID *ComponentName;
+ VOID *ComponentName2;
+
if (mDebugPortDevice.SerialIoBinding != NULL) {
return EFI_ABORTED;
}
//
- // Clean up allocations
+ // Driver is stopped already.
//
- if (mDebugPortDevice.DebugPortVariable != NULL) {
- FreePool (mDebugPortDevice.DebugPortVariable);
+ Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentNameProtocolGuid, &ComponentName);
+ if (EFI_ERROR (Status)) {
+ ComponentName = NULL;
}
- return EFI_SUCCESS;
+ Status = gBS->HandleProtocol (ImageHandle, &gEfiComponentName2ProtocolGuid, &ComponentName2);
+ if (EFI_ERROR (Status)) {
+ ComponentName2 = NULL;
+ }
+
+ if (ComponentName == NULL) {
+ if (ComponentName2 == NULL) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ NULL
+ );
+ } else {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentName2ProtocolGuid, ComponentName2,
+ NULL
+ );
+ }
+ } else {
+ if (ComponentName2 == NULL) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentNameProtocolGuid, ComponentName,
+ NULL
+ );
+ } else {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiDriverBindingProtocolGuid, &gDebugPortDriverBinding,
+ &gEfiComponentNameProtocolGuid, ComponentName,
+ &gEfiComponentName2ProtocolGuid, ComponentName2,
+ NULL
+ );
+ }
+ }
+
+ return Status;
}
diff --git a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
index f10822365..3ce702dfa 100644
--- a/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
+++ b/MdeModulePkg/Universal/DebugPortDxe/DebugPort.h
@@ -1,7 +1,7 @@
/** @file
Definitions and prototypes for DebugPort driver.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -52,7 +52,6 @@ typedef struct {
UINT32 Signature;
EFI_HANDLE DriverBindingHandle;
EFI_HANDLE DebugPortDeviceHandle;
- VOID *DebugPortVariable;
EFI_DEVICE_PATH_PROTOCOL *DebugPortDevicePath;
EFI_DEBUGPORT_PROTOCOL DebugPortInterface;
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
index ee0b4e686..dccb46054 100644
--- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
+++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.c
@@ -1,7 +1,7 @@
/** @file
Source file for CD recovery PEIM
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -259,7 +259,7 @@ FindRecoveryCapsules (
while (TRUE) {
SetMem (Buffer, BufferSize, 0);
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
BlockIoPpi,
IndexBlockDevice,
Lba,
@@ -350,7 +350,7 @@ RetrieveCapsuleFileFromRoot (
SetMem (Buffer, BufferSize, 0);
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ (EFI_PEI_SERVICES **) GetPeiServicesTablePointer (),
BlockIoPpi,
IndexBlockDevice,
Lba,
@@ -566,7 +566,7 @@ LoadRecoveryCapsule (
BlockIoPpi = PrivateData->CapsuleData[CapsuleInstance - 1].BlockIo;
Status = BlockIoPpi->ReadBlocks (
- PrivateData->PeiServices,
+ PeiServices,
BlockIoPpi,
PrivateData->CapsuleData[CapsuleInstance - 1].IndexBlock,
PrivateData->CapsuleData[CapsuleInstance - 1].CapsuleStartLBA,
diff --git a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
index 99edd3d5a..b452747e7 100644
--- a/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
+++ b/MdeModulePkg/Universal/Disk/CdExpressPei/PeiCdExpress.h
@@ -1,7 +1,7 @@
/** @file
Header file for CD recovery PEIM
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -74,7 +74,6 @@ typedef struct {
typedef struct {
UINTN Signature;
- EFI_PEI_SERVICES **PeiServices;
EFI_PEI_DEVICE_RECOVERY_MODULE_PPI DeviceRecoveryPpi;
EFI_PEI_PPI_DESCRIPTOR PpiDescriptor;
EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;
diff --git a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
index f53c3d91d..eb3edeb53 100644
--- a/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
+++ b/MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIo.c
@@ -1111,6 +1111,7 @@ DiskIo2FlushDiskEx (
return Status;
}
Task->Signature = DISK_IO2_FLUSH_TASK_SIGNATURE;
+ Task->Token = Token;
Status = Private->BlockIo2->FlushBlocksEx (Private->BlockIo2, &Task->BlockIo2Token);
if (EFI_ERROR (Status)) {
gBS->CloseEvent (Task->BlockIo2Token.Event);
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf b/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
index 323fcadb8..6a32221b2 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
@@ -54,9 +54,6 @@
gEdkiiFormDisplayEngineProtocolGuid
gEdkiiFormBrowserEx2ProtocolGuid
-[Guids]
- gEfiIfrTianoGuid ## CONSUMES ## GUID
-
[Depex]
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid AND gEdkiiFormBrowserEx2ProtocolGuid
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index dbc5685b0..5dfc482f3 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -1,7 +1,7 @@
/** @file
Entry and initialization module for the browser.
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -699,6 +699,13 @@ ConvertStatementToMenu (
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
+ //
+ // Skip the opcode not recognized by Display core.
+ //
+ if (NestStatement->OpCode->OpCode == EFI_IFR_GUID_OP) {
+ continue;
+ }
+
UiAddMenuOption (NestStatement, &MenuItemCount, TRUE);
}
}
@@ -1713,6 +1720,7 @@ HasOptionString (
@param SkipLine The skip line for this menu.
@param BottomRow The bottom row for this form.
@param Highlight Whether this menu will be highlight.
+ @param UpdateCol Whether need to update the column info for Date/Time.
@retval EFI_SUCESSS Process the user selection success.
@@ -1724,7 +1732,8 @@ DisplayOneMenu (
IN UINTN BeginCol,
IN UINTN SkipLine,
IN UINTN BottomRow,
- IN BOOLEAN Highlight
+ IN BOOLEAN Highlight,
+ IN BOOLEAN UpdateCol
)
{
FORM_DISPLAY_ENGINE_STATEMENT *Statement;
@@ -1773,7 +1782,7 @@ DisplayOneMenu (
//
// Adjust option string for date/time opcode.
//
- ProcessStringForDateTime(MenuOption, OptionString, TRUE);
+ ProcessStringForDateTime(MenuOption, OptionString, UpdateCol);
}
Width = (UINT16) gOptionBlockWidth - 1;
@@ -1798,8 +1807,9 @@ DisplayOneMenu (
} else {
//
// For date/ time, print the first and second past (year for date and second for time)
- //
- DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString), Highlight);
+ // The OutputString has a NARROW_CHAR or WIDE_CHAR at the begin of the string,
+ // so need to - 1 to remove it, otherwise, it will clean 1 extr char follow it.
+ DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, StrLen (OutputString) - 1, Highlight);
}
} else {
DisplayMenuString (MenuOption, MenuOption->OptCol, Row, OutputString, Width + 1, Highlight);
@@ -2160,7 +2170,8 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn + gModalSkipColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
- (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),
+ TRUE
);
} else {
Status = DisplayOneMenu (MenuOption,
@@ -2168,8 +2179,9 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Link == TopOfScreen ? SkipValue : 0,
BottomRow,
- (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption))
- );
+ (BOOLEAN) ((Link == NewPos) && IsSelectable(MenuOption)),
+ TRUE
+ );
}
if (EFI_ERROR (Status)) {
@@ -2272,6 +2284,7 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Temp,
BottomRow,
+ FALSE,
FALSE
);
}
@@ -2293,7 +2306,8 @@ UiDisplayMenu (
gStatementDimensions.LeftColumn,
Temp2,
BottomRow,
- TRUE
+ TRUE,
+ FALSE
);
}
break;
@@ -2548,12 +2562,12 @@ UiDisplayMenu (
// If the screen has no menu items, and the user didn't select UiReset
// ignore the selection and go back to reading keys.
//
+ ASSERT(MenuOption != NULL);
if(IsListEmpty (&gMenuOption) || MenuOption->GrayOut || MenuOption->ReadOnly) {
ControlFlag = CfReadKey;
break;
}
- ASSERT(MenuOption != NULL);
Statement = MenuOption->ThisTag;
if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP)
|| (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)
@@ -2736,7 +2750,8 @@ UiDisplayMenu (
case CfUiHotKey:
ControlFlag = CfRepaint;
-
+
+ ASSERT (HotKey != NULL);
gUserInput->Action = HotKey->Action;
ControlFlag = CfExit;
break;
@@ -2774,16 +2789,16 @@ UiDisplayMenu (
NewLine = TRUE;
SavedListEntry = NewPos;
-
ASSERT(NewPos != NULL);
+
+ MenuOption = MENU_OPTION_FROM_LINK (NewPos);
+ ASSERT (MenuOption != NULL);
+
//
// Adjust Date/Time position before we advance forward.
//
AdjustDateAndTimePosition (TRUE, &NewPos);
- MenuOption = MENU_OPTION_FROM_LINK (NewPos);
- ASSERT (MenuOption != NULL);
-
NewPos = NewPos->BackLink;
//
// Find next selectable menu or the first menu beyond current form.
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
index f4576447d..b44e1e21a 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
@@ -3,7 +3,7 @@
# which provides fault tolerant write capability for block devices.
# Its implementation depends on the full functionality FVB protocol that support read, write/erase flash access.
#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -68,6 +68,12 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#
+# gBS->CalculateCrc32() is consumed in EntryPoint.
+# PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_ARCH_PROTOCOL
+# has been installed, then the Boot Service CalculateCrc32() is available.
+# So add gEfiRuntimeArchProtocolGuid Depex here.
+#
[Depex]
- gEfiFirmwareVolumeBlockProtocolGuid
+ gEfiFirmwareVolumeBlockProtocolGuid AND gEfiRuntimeArchProtocolGuid
diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
index 7740efa35..a6fdd9818 100644
--- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
+++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf
@@ -4,7 +4,7 @@
# depends on the full functionality SMM FVB protocol that support read, write/erase
# flash access.
#
-# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -73,6 +73,12 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#
+# gBS->CalculateCrc32() is consumed in EntryPoint.
+# PI spec said: When the DXE Foundation is notified that the EFI_RUNTIME_ARCH_PROTOCOL
+# has been installed, then the Boot Service CalculateCrc32() is available.
+# So add gEfiRuntimeArchProtocolGuid Depex here.
+#
[Depex]
- gEfiSmmFirmwareVolumeBlockProtocolGuid
+ gEfiSmmFirmwareVolumeBlockProtocolGuid AND gEfiRuntimeArchProtocolGuid
diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
index fb69b9ca1..0b2138ce6 100644
--- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
+++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c
@@ -1287,7 +1287,7 @@ IsThisVarstore (
//
// If ConfigHdr has name field and varstore not has name, return FALSE.
//
- if (Name == NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {
+ if (Name == NULL && ConfigHdr != NULL && StrStr (ConfigHdr, L"NAME=&") == NULL) {
return FALSE;
}
@@ -1432,13 +1432,11 @@ IsThisPackageList (
// No matched varstore is found and directly return.
//
goto Done;
- break;
default:
break;
}
}
-
Done:
if (HiiFormPackage != NULL) {
FreePool (HiiFormPackage);
diff --git a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
index 529ca7775..1804e8ac3 100644
--- a/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
+++ b/MdeModulePkg/Universal/LockBox/SmmLockBox/SmmLockBox.inf
@@ -60,5 +60,4 @@
gEfiLockBoxProtocolGuid ## PRODUCED
[Depex]
- gEfiSmmSwDispatch2ProtocolGuid
-
+ TRUE
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index f4663d9f5..b38961047 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,7 +1,7 @@
/** @file
The entry point of IScsi driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -439,10 +439,12 @@ EfiIScsiUnload (
IN EFI_HANDLE ImageHandle
)
{
- EFI_STATUS Status;
- UINTN DeviceHandleCount;
- EFI_HANDLE *DeviceHandleBuffer;
- UINTN Index;
+ EFI_STATUS Status;
+ UINTN DeviceHandleCount;
+ EFI_HANDLE *DeviceHandleBuffer;
+ UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Try to disonnect the driver from the devices it's controlling.
@@ -454,40 +456,89 @@ EfiIScsiUnload (
&DeviceHandleCount,
&DeviceHandleBuffer
);
- if (!EFI_ERROR (Status)) {
- for (Index = 0; Index < DeviceHandleCount; Index++) {
- Status = gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- ImageHandle,
- NULL
- );
- }
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
- if (DeviceHandleBuffer != NULL) {
- FreePool (DeviceHandleBuffer);
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = IScsiTestManagedDevice (
+ DeviceHandleBuffer[Index],
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiTcp4ProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ continue;
}
- }
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gIScsiDriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
//
// Unload the iSCSI configuration form.
//
- IScsiConfigFormUnload (gIScsiDriverBinding.DriverBindingHandle);
+ Status = IScsiConfigFormUnload (gIScsiDriverBinding.DriverBindingHandle);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
//
- // Uninstall the protocols installed by iSCSI driver.
+ // Uninstall the ComponentName and ComponentName2 protocol from iSCSI4 driver binding handle
+ // if it has been installed.
//
+ Status = gBS->HandleProtocol (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ Status = gBS->HandleProtocol (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiDriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
Status = gBS->UninstallMultipleProtocolInterfaces (
ImageHandle,
&gEfiDriverBindingProtocolGuid,
&gIScsiDriverBinding,
- &gEfiComponentName2ProtocolGuid,
- &gIScsiComponentName2,
- &gEfiComponentNameProtocolGuid,
- &gIScsiComponentName,
&gEfiIScsiInitiatorNameProtocolGuid,
&gIScsiInitiatorName,
NULL
);
+ON_EXIT:
+ if (DeviceHandleBuffer != NULL) {
+ FreePool (DeviceHandleBuffer);
+ }
+
return Status;
}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
index 04f5df34a..372efdc15 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
@@ -349,9 +349,16 @@ IScsiFillNICAndTargetSections (
Target->Header.Index = (UINT8) Index;
Target->Header.Flags = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BLOCK_VALID | EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_BOOT_SELECTED;
Target->Port = SessionConfigData->NvData.TargetPort;
- Target->CHAPType = AuthConfig->CHAPType;
Target->NicIndex = (UINT8) Index;
+ if (AuthConfig->CHAPType == ISCSI_CHAP_NONE) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP;
+ } if (AuthConfig->CHAPType == ISCSI_CHAP_UNI) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP;
+ } else if (AuthConfig->CHAPType == ISCSI_CHAP_MUTUAL) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP;
+ }
+
IScsiMapV4ToV6Addr (&SessionConfigData->NvData.TargetIp, &Target->Ip);
CopyMem (Target->BootLun, SessionConfigData->NvData.BootLun, sizeof (Target->BootLun));
@@ -364,7 +371,7 @@ IScsiFillNICAndTargetSections (
Target->IScsiNameLength = Length;
Target->IScsiNameOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);
- if (Target->CHAPType != ISCSI_CHAP_NONE) {
+ if (Target->CHAPType != EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP) {
//
// CHAP Name
//
@@ -381,7 +388,7 @@ IScsiFillNICAndTargetSections (
Target->CHAPSecretLength = Length;
Target->CHAPSecretOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);
- if (Target->CHAPType == ISCSI_CHAP_MUTUAL) {
+ if (Target->CHAPType == EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP) {
//
// Reverse CHAP Name
//
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
index 2e43b415e..a00d805b8 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
@@ -1,7 +1,7 @@
/** @file
Miscellaneous routines for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -852,3 +852,70 @@ IScsiOnExitBootService (
IScsiSessionAbort (&Private->Session);
}
+
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ )
+{
+ EFI_STATUS Status;
+ VOID *ManagedInterface;
+ EFI_HANDLE NicControllerHandle;
+
+ ASSERT (ProtocolGuid != NULL);
+
+ NicControllerHandle = NetLibGetNicHandle (ControllerHandle, ProtocolGuid);
+ if (NicControllerHandle == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ &ManagedInterface,
+ DriverBindingHandle,
+ NicControllerHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->CloseProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ DriverBindingHandle,
+ NicControllerHandle
+ );
+ return EFI_UNSUPPORTED;
+ }
+
+ if (Status != EFI_ALREADY_STARTED) {
+ return EFI_UNSUPPORTED;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
index b310c9c57..052a90f8d 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
@@ -1,7 +1,7 @@
/** @file
Miscellaneous definitions for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -275,6 +275,35 @@ IScsiOnExitBootService (
IN VOID *Context
);
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ );
#endif
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
index 1aa3207ea..7f03b848e 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpIo.c
@@ -1,7 +1,7 @@
/** @file
Implementation of Managed Network Protocol I/O functions.
-Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -128,12 +128,19 @@ MnpBuildTxPacket (
MNP_DEVICE_DATA *MnpDerviceData;
MnpDerviceData = MnpServiceData->MnpDeviceData;
+
+ //
+ // Reserve space for vlan tag.
+ //
+ *PktBuf = MnpDerviceData->TxBuf + NET_VLAN_TAG_LEN;
+
if ((TxData->DestinationAddress == NULL) && (TxData->FragmentCount == 1)) {
- //
- // Media header is in FragmentTable and there is only one fragment,
- // use fragment buffer directly.
- //
- *PktBuf = TxData->FragmentTable[0].FragmentBuffer;
+ CopyMem (
+ *PktBuf,
+ TxData->FragmentTable[0].FragmentBuffer,
+ TxData->FragmentTable[0].FragmentLength
+ );
+
*PktLen = TxData->FragmentTable[0].FragmentLength;
} else {
//
@@ -141,9 +148,8 @@ MnpBuildTxPacket (
// one fragment, copy the data into the packet buffer. Reserve the
// media header space if necessary.
//
- SnpMode = MnpDerviceData->Snp->Mode;
- DstPos = MnpDerviceData->TxBuf;
-
+ SnpMode = MnpDerviceData->Snp->Mode;
+ DstPos = *PktBuf;
*PktLen = 0;
if (TxData->DestinationAddress != NULL) {
//
@@ -167,9 +173,8 @@ MnpBuildTxPacket (
}
//
- // Set the buffer pointer and the buffer length.
+ // Set the buffer length.
//
- *PktBuf = MnpDerviceData->TxBuf;
*PktLen += TxData->DataLength + TxData->HeaderLength;
}
}
@@ -235,10 +240,15 @@ MnpSyncSendPacket (
goto SIGNAL_TOKEN;
}
- //
- // Insert VLAN tag
- //
- MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+
+ if (MnpServiceData->VlanId != 0) {
+ //
+ // Insert VLAN tag
+ //
+ MnpInsertVlanTag (MnpServiceData, TxData, &ProtocolType, &Packet, &Length);
+ } else {
+ ProtocolType = TxData->ProtocolType;
+ }
for (;;) {
//
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
index 850ed5162..aa7da980d 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.c
@@ -1,7 +1,7 @@
/** @file
VLAN Config Protocol implementation and VLAN packet process routine.
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -171,7 +171,7 @@ MnpRemoveVlanTag (
/**
- Build the packet to transmit from the TxData passed in.
+ Build the vlan packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
@@ -197,11 +197,6 @@ MnpInsertVlanTag (
MNP_DEVICE_DATA *MnpDeviceData;
EFI_SIMPLE_NETWORK_MODE *SnpMode;
- if (MnpServiceData->VlanId == 0) {
- *ProtocolType = TxData->ProtocolType;
- return ;
- }
-
MnpDeviceData = MnpServiceData->MnpDeviceData;
SnpMode = MnpDeviceData->Snp->Mode;
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
index 70b6cec26..d8eac8d07 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpVlan.h
@@ -1,7 +1,7 @@
/** @file
Header file to be included by MnpVlan.c.
-Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -59,7 +59,7 @@ MnpRemoveVlanTag (
);
/**
- Build the packet to transmit from the TxData passed in.
+ Build the vlan packet to transmit from the TxData passed in.
@param MnpServiceData Pointer to the mnp service context data.
@param TxData Pointer to the transmit data containing the
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
index dd0af8d7b..c9043958b 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
@@ -1,7 +1,7 @@
/** @file
UEFI Component Name(2) protocol implementation for Tcp4Dxe driver.
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -259,7 +259,7 @@ UpdateName (
Status = Tcp4->GetModeData (Tcp4, NULL, &Tcp4ConfigData, NULL, NULL, NULL);
if (!EFI_ERROR (Status)) {
UnicodeSPrint (HandleName, sizeof (HandleName),
- L"TCPv4 (SrcPort=%d, DestPort=&d, ActiveFlag=%s)",
+ L"TCPv4 (SrcPort=%d, DestPort=%d, ActiveFlag=%s)",
Tcp4ConfigData.AccessPoint.StationPort,
Tcp4ConfigData.AccessPoint.RemotePort,
(Tcp4ConfigData.AccessPoint.ActiveFlag ? L"TRUE" : L"FALSE")
diff --git a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
index 8be753151..e016cc0f5 100644
--- a/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
+++ b/MdeModulePkg/Universal/Network/UefiPxeBcDxe/PxeBcDhcp.c
@@ -2,7 +2,7 @@
Support for PxeBc dhcp functions.
Copyright (c) 2013, Red Hat, Inc.
-Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -147,13 +147,43 @@ PxeBcParseCachedDhcpPacket (
//
// Parse interested dhcp options and store their pointers in CachedPacket->Dhcp4Option.
+ // First, try to parse DHCPv4 options from the DHCP optional parameters field.
//
for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
Options[Index] = PxeBcParseExtendOptions (
- Offer->Dhcp4.Option,
- GET_OPTION_BUFFER_LEN (Offer),
- mInterestedDhcp4Tags[Index]
- );
+ Offer->Dhcp4.Option,
+ GET_OPTION_BUFFER_LEN (Offer),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ //
+ // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
+ // If yes, try to parse options from the BootFileName field, then ServerName field.
+ //
+ Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
+ if (Option != NULL) {
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseExtendOptions (
+ (UINT8 *) Offer->Dhcp4.Header.BootFileName,
+ sizeof (Offer->Dhcp4.Header.BootFileName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_SERVER_NAME) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseExtendOptions (
+ (UINT8 *) Offer->Dhcp4.Header.ServerName,
+ sizeof (Offer->Dhcp4.Header.ServerName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
}
//
@@ -177,31 +207,23 @@ PxeBcParseCachedDhcpPacket (
}
}
+
//
- // Check whether bootfilename/serverhostname overloaded (See details in dhcp spec).
- // If overloaded, parse this buffer as nested dhcp options, or just parse bootfilename/
- // serverhostname option.
+ // Parse PXE boot file name:
+ // According to PXE spec, boot file name should be read from DHCP option 67 (bootfile name) if present.
+ // Otherwise, read from boot file field in DHCP header.
//
- Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
- if ((Option != NULL) && ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0)) {
-
- Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = PxeBcParseExtendOptions (
- (UINT8 *) Offer->Dhcp4.Header.BootFileName,
- sizeof (Offer->Dhcp4.Header.BootFileName),
- PXEBC_DHCP4_TAG_BOOTFILE
- );
+ if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
//
// RFC 2132, Section 9.5 does not strictly state Bootfile name (option 67) is null
// terminated string. So force to append null terminated character at the end of string.
//
- if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
- Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
- Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
- *Ptr8 = '\0';
+ Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
+ Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
+ if (*(Ptr8 - 1) != '\0') {
+ *Ptr8 = '\0';
}
-
- } else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) &&
- (Offer->Dhcp4.Header.BootFileName[0] != 0)) {
+ } else if (Offer->Dhcp4.Header.BootFileName[0] != 0) {
//
// If the bootfile is not present and bootfilename is present in dhcp packet, just parse it.
// And do not count dhcp option header, or else will destroy the serverhostname.
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
index 8a3e8cd50..4828af2b9 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c
@@ -231,7 +231,7 @@ DxeGetPcdInfoGetSku (
VOID
)
{
- return mPcdDatabase.PeiDb->SystemSkuId;
+ return mPcdDatabase.DxeDb->SystemSkuId;
}
/**
@@ -261,7 +261,7 @@ DxePcdSetSku (
IN UINTN SkuId
)
{
- mPcdDatabase.PeiDb->SystemSkuId = (SKU_ID) SkuId;
+ mPcdDatabase.DxeDb->SystemSkuId = (SKU_ID) SkuId;
return;
}
diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c
index b082f0a6d..a9e1ca49a 100644
--- a/MdeModulePkg/Universal/PCD/Dxe/Service.c
+++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c
@@ -50,6 +50,7 @@ GetLocalTokenNumber (
IN UINTN TokenNumber
)
{
+ UINTN TmpTokenNumber;
UINT32 *LocalTokenNumberTable;
UINT32 LocalTokenNumber;
UINTN Size;
@@ -62,6 +63,11 @@ GetLocalTokenNumber (
//
TokenNumber--;
+ //
+ // Backup the TokenNumber passed in as GetPtrTypeSize need the original TokenNumber
+ //
+ TmpTokenNumber = TokenNumber;
+
LocalTokenNumberTable = IsPeiDb ? (UINT32 *)((UINT8 *)mPcdDatabase.PeiDb + mPcdDatabase.PeiDb->LocalTokenNumberTableOffset) :
(UINT32 *)((UINT8 *)mPcdDatabase.DxeDb + mPcdDatabase.DxeDb->LocalTokenNumberTableOffset);
TokenNumber = IsPeiDb ? TokenNumber : TokenNumber - mPeiLocalTokenCount;
@@ -72,7 +78,7 @@ GetLocalTokenNumber (
if ((LocalTokenNumber & PCD_TYPE_SKU_ENABLED) == PCD_TYPE_SKU_ENABLED) {
if (Size == 0) {
- GetPtrTypeSize (TokenNumber, &MaxSize);
+ GetPtrTypeSize (TmpTokenNumber, &MaxSize);
} else {
MaxSize = Size;
}
@@ -768,6 +774,18 @@ BuildPcdDxeDataBase (
UINT32 PcdDxeDbLen;
VOID *PcdDxeDb;
+ //
+ // Assign PCD Entries with default value to PCD DATABASE
+ //
+ mPcdDatabase.DxeDb = LocateExPcdBinary ();
+ ASSERT(mPcdDatabase.DxeDb != NULL);
+ PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
+ PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
+ ASSERT (PcdDxeDb != NULL);
+ CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
+ FreePool (mPcdDatabase.DxeDb);
+ mPcdDatabase.DxeDb = PcdDxeDb;
+
GuidHob = GetFirstGuidHob (&gPcdDataBaseHobGuid);
if (GuidHob != NULL) {
@@ -783,21 +801,16 @@ BuildPcdDxeDataBase (
// Assign PCD Entries refereneced in PEI phase to PCD DATABASE
//
mPcdDatabase.PeiDb = PeiDatabase;
+ //
+ // Inherit the SystemSkuId from PEI phase.
+ //
+ mPcdDatabase.DxeDb->SystemSkuId = mPcdDatabase.PeiDb->SystemSkuId;
+ } else {
+ mPcdDatabase.PeiDb = AllocateZeroPool (sizeof (PEI_PCD_DATABASE));
+ ASSERT(mPcdDatabase.PeiDb != NULL);
}
//
- // Assign PCD Entries with default value to PCD DATABASE
- //
- mPcdDatabase.DxeDb = LocateExPcdBinary ();
- ASSERT(mPcdDatabase.DxeDb != NULL);
- PcdDxeDbLen = mPcdDatabase.DxeDb->Length + mPcdDatabase.DxeDb->UninitDataBaseSize;
- PcdDxeDb = AllocateZeroPool (PcdDxeDbLen);
- ASSERT (PcdDxeDb != NULL);
- CopyMem (PcdDxeDb, mPcdDatabase.DxeDb, mPcdDatabase.DxeDb->Length);
- FreePool (mPcdDatabase.DxeDb);
- mPcdDatabase.DxeDb = PcdDxeDb;
-
- //
// Initialized the external PCD database local variables
//
mPeiLocalTokenCount = mPcdDatabase.PeiDb->LocalTokenCount;
@@ -939,7 +952,7 @@ GetSkuEnabledTokenNumber (
//
FoundSku = FALSE;
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (mPcdDatabase.PeiDb->SystemSkuId == SkuIdTable[Index + 1]) {
+ if (mPcdDatabase.DxeDb->SystemSkuId == SkuIdTable[Index + 1]) {
FoundSku = TRUE;
break;
}
@@ -1698,7 +1711,7 @@ GetPtrTypeSize (
//
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
+ if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
return SizeTable[SizeTableIdx + 1 + Index];
}
}
@@ -1788,7 +1801,7 @@ SetPtrTypeSize (
//
SkuIdTable = GetSkuIdArray (LocalTokenNumberTableIdx, IsPeiDb);
for (Index = 0; Index < SkuIdTable[0]; Index++) {
- if (SkuIdTable[1 + Index] == mPcdDatabase.PeiDb->SystemSkuId) {
+ if (SkuIdTable[1 + Index] == mPcdDatabase.DxeDb->SystemSkuId) {
SizeTable[SizeTableIdx + 1 + Index] = (SIZE_INFO) *CurrentSize;
return TRUE;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
index ce2ba6fab..41f89ea7f 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/IfrParse.c
@@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
UINT16 mStatementIndex;
UINT16 mExpressionOpCodeIndex;
EFI_QUESTION_ID mUsedQuestionId;
-BOOLEAN mInScopeSubtitle;
extern LIST_ENTRY gBrowserStorageList;
/**
Initialize Statement header members.
@@ -79,8 +78,6 @@ CreateStatement (
CopyMem (Statement->Expression->Expression, GetConditionalExpressionList(ExpressStatement), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
}
- Statement->InSubtitle = mInScopeSubtitle;
-
//
// Insert this Statement into current Form
//
@@ -379,12 +376,18 @@ FindStorageInList (
Link = GetFirstNode (&gBrowserStorageList);
while (!IsNull (&gBrowserStorageList, Link)) {
BrowserStorage = BROWSER_STORAGE_FROM_LINK (Link);
+ Link = GetNextNode (&gBrowserStorageList, Link);
if ((BrowserStorage->Type == StorageType) && CompareGuid (&BrowserStorage->Guid, StorageGuid)) {
- if (StorageType == EFI_HII_VARSTORE_NAME_VALUE && BrowserStorage->HiiHandle == HiiHandle) {
- return BrowserStorage;
+ if (StorageType == EFI_HII_VARSTORE_NAME_VALUE) {
+ if (BrowserStorage->HiiHandle == HiiHandle) {
+ return BrowserStorage;
+ }
+
+ continue;
}
+ ASSERT (StorageName != NULL);
if (StrCmp (BrowserStorage->Name, StorageName) == 0) {
if (StorageType == EFI_HII_VARSTORE_EFI_VARIABLE || StorageType == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
return BrowserStorage;
@@ -393,11 +396,6 @@ FindStorageInList (
}
}
}
-
- //
- // Get Next Storage.
- //
- Link = GetNextNode (&gBrowserStorageList, Link);
}
return NULL;
@@ -1038,6 +1036,39 @@ IsExpressionOpCode (
}
}
+/**
+ Tell whether this Operand is an Statement OpCode.
+
+ @param Operand Operand of an IFR OpCode.
+
+ @retval TRUE This is an Statement OpCode.
+ @retval FALSE Not an Statement OpCode.
+
+**/
+BOOLEAN
+IsStatementOpCode (
+ IN UINT8 Operand
+ )
+{
+ if ((Operand == EFI_IFR_SUBTITLE_OP) ||
+ (Operand == EFI_IFR_TEXT_OP) ||
+ (Operand == EFI_IFR_RESET_BUTTON_OP) ||
+ (Operand == EFI_IFR_REF_OP) ||
+ (Operand == EFI_IFR_ACTION_OP) ||
+ (Operand == EFI_IFR_NUMERIC_OP) ||
+ (Operand == EFI_IFR_ORDERED_LIST_OP) ||
+ (Operand == EFI_IFR_CHECKBOX_OP) ||
+ (Operand == EFI_IFR_STRING_OP) ||
+ (Operand == EFI_IFR_PASSWORD_OP) ||
+ (Operand == EFI_IFR_DATE_OP) ||
+ (Operand == EFI_IFR_TIME_OP) ||
+ (Operand == EFI_IFR_GUID_OP) ||
+ (Operand == EFI_IFR_ONE_OF_OP)) {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
/**
Calculate number of Statemens(Questions) and Expression OpCodes.
@@ -1099,6 +1130,7 @@ ParseOpCodes (
EFI_STATUS Status;
FORM_BROWSER_FORM *CurrentForm;
FORM_BROWSER_STATEMENT *CurrentStatement;
+ FORM_BROWSER_STATEMENT *ParentStatement;
EXPRESSION_OPCODE *ExpressionOpCode;
FORM_EXPRESSION *CurrentExpression;
UINT8 Operand;
@@ -1131,7 +1163,6 @@ ParseOpCodes (
BOOLEAN InScopeDisable;
INTN ConditionalExprCount;
- mInScopeSubtitle = FALSE;
SuppressForQuestion = FALSE;
SuppressForOption = FALSE;
InScopeDisable = FALSE;
@@ -1179,6 +1210,7 @@ ParseOpCodes (
CurrentForm = NULL;
CurrentStatement = NULL;
+ ParentStatement = NULL;
ResetScopeStack ();
@@ -1269,8 +1301,8 @@ ParseOpCodes (
break;
case EFI_IFR_THIS_OP:
- ASSERT (CurrentStatement != NULL);
- ExpressionOpCode->QuestionId = CurrentStatement->QuestionId;
+ ASSERT (ParentStatement != NULL);
+ ExpressionOpCode->QuestionId = ParentStatement->QuestionId;
break;
case EFI_IFR_SECURITY_OP:
@@ -1684,9 +1716,6 @@ ParseOpCodes (
CurrentStatement->Flags = ((EFI_IFR_SUBTITLE *) OpCodeData)->Flags;
CurrentStatement->FakeQuestionId = mUsedQuestionId++;
- if (Scope != 0) {
- mInScopeSubtitle = TRUE;
- }
break;
case EFI_IFR_TEXT_OP:
@@ -1926,7 +1955,7 @@ ParseOpCodes (
//
// Insert to Default Value list of current Question
//
- InsertTailList (&CurrentStatement->DefaultListHead, &CurrentDefault->Link);
+ InsertTailList (&ParentStatement->DefaultListHead, &CurrentDefault->Link);
if (Scope != 0) {
InScopeDefault = TRUE;
@@ -1965,16 +1994,15 @@ ParseOpCodes (
CopyMem (CurrentOption->SuppressExpression->Expression, GetConditionalExpressionList(ExpressOption), (UINTN) (sizeof (FORM_EXPRESSION *) * ConditionalExprCount));
}
+ ASSERT (ParentStatement != NULL);
//
// Insert to Option list of current Question
//
- InsertTailList (&CurrentStatement->OptionListHead, &CurrentOption->Link);
-
+ InsertTailList (&ParentStatement->OptionListHead, &CurrentOption->Link);
//
// Now we know the Storage width of nested Ordered List
//
- ASSERT (CurrentStatement != NULL);
- if ((CurrentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (CurrentStatement->BufferValue == NULL)) {
+ if ((ParentStatement->Operand == EFI_IFR_ORDERED_LIST_OP) && (ParentStatement->BufferValue == NULL)) {
Width = 1;
switch (CurrentOption->Value.Type) {
case EFI_IFR_TYPE_NUM_SIZE_8:
@@ -2000,15 +2028,15 @@ ParseOpCodes (
break;
}
- CurrentStatement->StorageWidth = (UINT16) (CurrentStatement->MaxContainers * Width);
- CurrentStatement->BufferValue = AllocateZeroPool (CurrentStatement->StorageWidth);
- CurrentStatement->ValueType = CurrentOption->Value.Type;
- if (CurrentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
- CurrentStatement->HiiValue.Buffer = CurrentStatement->BufferValue;
- CurrentStatement->HiiValue.BufferLen = CurrentStatement->StorageWidth;
+ ParentStatement->StorageWidth = (UINT16) (ParentStatement->MaxContainers * Width);
+ ParentStatement->BufferValue = AllocateZeroPool (ParentStatement->StorageWidth);
+ ParentStatement->ValueType = CurrentOption->Value.Type;
+ if (ParentStatement->HiiValue.Type == EFI_IFR_TYPE_BUFFER) {
+ ParentStatement->HiiValue.Buffer = ParentStatement->BufferValue;
+ ParentStatement->HiiValue.BufferLen = ParentStatement->StorageWidth;
}
- InitializeRequestElement (FormSet, CurrentStatement, CurrentForm);
+ InitializeRequestElement (FormSet, ParentStatement, CurrentForm);
}
break;
@@ -2025,10 +2053,10 @@ ParseOpCodes (
if (Operand == EFI_IFR_NO_SUBMIT_IF_OP) {
CurrentExpression->Type = EFI_HII_EXPRESSION_NO_SUBMIT_IF;
- InsertTailList (&CurrentStatement->NoSubmitListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->NoSubmitListHead, &CurrentExpression->Link);
} else {
CurrentExpression->Type = EFI_HII_EXPRESSION_INCONSISTENT_IF;
- InsertTailList (&CurrentStatement->InconsistentListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->InconsistentListHead, &CurrentExpression->Link);
}
//
@@ -2048,7 +2076,7 @@ ParseOpCodes (
CopyMem (&CurrentExpression->Error, &((EFI_IFR_WARNING_IF *) OpCodeData)->Warning, sizeof (EFI_STRING_ID));
CurrentExpression->TimeOut = ((EFI_IFR_WARNING_IF *) OpCodeData)->TimeOut;
CurrentExpression->Type = EFI_HII_EXPRESSION_WARNING_IF;
- InsertTailList (&CurrentStatement->WarningListHead, &CurrentExpression->Link);
+ InsertTailList (&ParentStatement->WarningListHead, &CurrentExpression->Link);
//
// Take a look at next OpCode to see whether current expression consists
@@ -2159,8 +2187,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->ValueExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->ValueExpression = CurrentExpression;
}
//
@@ -2198,8 +2226,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->ReadExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->ReadExpression = CurrentExpression;
//
// Take a look at next OpCode to see whether current expression consists
@@ -2220,8 +2248,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler. There may be a bug in VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->WriteExpression = CurrentExpression;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->WriteExpression = CurrentExpression;
//
// Take a look at next OpCode to see whether current expression consists
@@ -2263,8 +2291,8 @@ ParseOpCodes (
// If it is NULL, 1) ParseOpCodes functions may parse the IFR wrongly. Or 2) the IFR
// file is wrongly generated by tools such as VFR Compiler.
//
- ASSERT (CurrentStatement != NULL);
- ImageId = &CurrentStatement->ImageId;
+ ASSERT (ParentStatement != NULL);
+ ImageId = &ParentStatement->ImageId;
break;
}
@@ -2276,16 +2304,16 @@ ParseOpCodes (
// Refresh
//
case EFI_IFR_REFRESH_OP:
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->RefreshInterval = ((EFI_IFR_REFRESH *) OpCodeData)->RefreshInterval;
break;
//
// Refresh guid.
//
case EFI_IFR_REFRESH_ID_OP:
- ASSERT (CurrentStatement != NULL);
- CopyMem (&CurrentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
+ ASSERT (ParentStatement != NULL);
+ CopyMem (&ParentStatement->RefreshGuid, &((EFI_IFR_REFRESH_ID *) OpCodeData)->RefreshEventGroupId, sizeof (EFI_GUID));
break;
//
@@ -2313,8 +2341,8 @@ ParseOpCodes (
break;
default:
- ASSERT (CurrentStatement != NULL);
- CurrentStatement->Locked = TRUE;
+ ASSERT (ParentStatement != NULL);
+ ParentStatement->Locked = TRUE;
}
break;
@@ -2334,6 +2362,13 @@ ParseOpCodes (
ResetScopeStack ();
return Status;
}
+
+ //
+ // Parent statement end tag found, update ParentStatement info.
+ //
+ if (IsStatementOpCode(ScopeOpCode) && (ParentStatement != NULL) && (ParentStatement->Operand == ScopeOpCode)) {
+ ParentStatement = ParentStatement->ParentStatement;
+ }
switch (ScopeOpCode) {
case EFI_IFR_FORM_SET_OP:
@@ -2360,10 +2395,6 @@ ParseOpCodes (
CurrentOption = NULL;
break;
- case EFI_IFR_SUBTITLE_OP:
- mInScopeSubtitle = FALSE;
- break;
-
case EFI_IFR_NO_SUBMIT_IF_OP:
case EFI_IFR_INCONSISTENT_IF_OP:
case EFI_IFR_WARNING_IF_OP:
@@ -2455,6 +2486,17 @@ ParseOpCodes (
default:
break;
}
+
+ if (IsStatementOpCode(Operand)) {
+ CurrentStatement->ParentStatement = ParentStatement;
+ if (Scope != 0) {
+ //
+ // Scope != 0, other statements or options may nest in this statement.
+ // Update the ParentStatement info.
+ //
+ ParentStatement = CurrentStatement;
+ }
+ }
}
return EFI_SUCCESS;
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index fb3ff7b26..f8b1d5067 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -387,18 +387,17 @@ QuestionCheck (
@param DisplayStatement Pointer to the display Statement data strucure.
@param Statement The statement need to check.
- @param HostDisplayStatement Pointer to the display Statement data strucure which is an host statement.
**/
VOID
InitializeDisplayStatement (
IN OUT FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement,
- IN FORM_BROWSER_STATEMENT *Statement,
- IN FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement
+ IN FORM_BROWSER_STATEMENT *Statement
)
{
LIST_ENTRY *Link;
QUESTION_OPTION *Option;
DISPLAY_QUESTION_OPTION *DisplayOption;
+ FORM_DISPLAY_ENGINE_STATEMENT *ParentStatement;
DisplayStatement->Signature = FORM_DISPLAY_ENGINE_STATEMENT_SIGNATURE;
DisplayStatement->Version = FORM_DISPLAY_ENGINE_STATEMENT_VERSION_1;
@@ -502,8 +501,10 @@ InitializeDisplayStatement (
// If this statement is nest in the subtitle, insert to the host statement.
// else insert to the form it belongs to.
//
- if (Statement->InSubtitle) {
- InsertTailList(&HostDisplayStatement->NestStatementList, &DisplayStatement->DisplayLink);
+ if (Statement->ParentStatement != NULL) {
+ ParentStatement = GetDisplayStatement(Statement->ParentStatement->OpCode);
+ ASSERT (ParentStatement != NULL);
+ InsertTailList(&ParentStatement->NestStatementList, &DisplayStatement->DisplayLink);
} else {
InsertTailList(&gDisplayFormData.StatementListHead, &DisplayStatement->DisplayLink);
}
@@ -625,14 +626,12 @@ AddStatementToDisplayForm (
LIST_ENTRY *Link;
FORM_BROWSER_STATEMENT *Statement;
FORM_DISPLAY_ENGINE_STATEMENT *DisplayStatement;
- FORM_DISPLAY_ENGINE_STATEMENT *HostDisplayStatement;
UINT8 MinRefreshInterval;
EFI_EVENT RefreshIntervalEvent;
FORM_BROWSER_REFRESH_EVENT_NODE *EventNode;
BOOLEAN FormEditable;
UINT32 ExtraAttribute;
- HostDisplayStatement = NULL;
MinRefreshInterval = 0;
FormEditable = FALSE;
@@ -686,21 +685,13 @@ AddStatementToDisplayForm (
//
// Initialize this statement and add it to the display form.
//
- InitializeDisplayStatement(DisplayStatement, Statement, HostDisplayStatement);
+ InitializeDisplayStatement(DisplayStatement, Statement);
//
// Set the extra attribute.
//
DisplayStatement->Attribute |= ExtraAttribute;
- //
- // Save the Host statement info.
- // Host statement may has nest statement follow it.
- //
- if (!Statement->InSubtitle) {
- HostDisplayStatement = DisplayStatement;
- }
-
if (Statement->Storage != NULL) {
FormEditable = TRUE;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 66238e055..11c9589ce 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -4085,6 +4085,10 @@ LoadStorage (
EFI_STRING Progress;
EFI_STRING Result;
CHAR16 *StrPtr;
+ EFI_STRING ConfigRequest;
+ UINTN StrLen;
+
+ ConfigRequest = NULL;
switch (Storage->BrowserStorage->Type) {
case EFI_HII_VARSTORE_EFI_VARIABLE:
@@ -4095,6 +4099,21 @@ LoadStorage (
ConfigRequestAdjust(Storage);
return;
}
+
+ //
+ // Create the config request string to get all fields for this storage.
+ // Allocate and fill a buffer large enough to hold the <ConfigHdr> template
+ // followed by "&OFFSET=0&WIDTH=WWWW"followed by a Null-terminator
+ //
+ StrLen = StrSize (Storage->BrowserStorage->ConfigHdr) + 20 * sizeof (CHAR16);
+ ConfigRequest = AllocateZeroPool (StrLen);
+ ASSERT (ConfigRequest != NULL);
+ UnicodeSPrint (
+ ConfigRequest,
+ StrLen,
+ L"%s&OFFSET=0&WIDTH=%04x",
+ Storage->BrowserStorage->ConfigHdr,
+ Storage->BrowserStorage->Size);
break;
case EFI_HII_VARSTORE_BUFFER:
@@ -4106,6 +4125,7 @@ LoadStorage (
return;
}
Storage->BrowserStorage->Initialized = TRUE;
+ ConfigRequest = Storage->ConfigRequest;
break;
default:
@@ -4117,7 +4137,7 @@ LoadStorage (
//
Status = mHiiConfigRouting->ExtractConfig (
mHiiConfigRouting,
- Storage->ConfigRequest,
+ ConfigRequest,
&Progress,
&Result
);
@@ -4146,6 +4166,12 @@ LoadStorage (
// Input NULL for ConfigRequest field means sync all fields from editbuffer to buffer.
//
SynchronizeStorage(FormSet, Storage->BrowserStorage, NULL, TRUE);
+
+ if (Storage->BrowserStorage->Type == EFI_HII_VARSTORE_EFI_VARIABLE_BUFFER) {
+ if (ConfigRequest != NULL) {
+ FreePool (ConfigRequest);
+ }
+ }
}
/**
@@ -4876,21 +4902,27 @@ IsBrowserDataModified (
LIST_ENTRY *Link;
FORM_BROWSER_FORMSET *FormSet;
- if (gCurrentSelection == NULL) {
- return FALSE;
- }
-
switch (gBrowserSettingScope) {
case FormLevel:
+ if (gCurrentSelection == NULL) {
+ return FALSE;
+ }
return IsNvUpdateRequiredForForm (gCurrentSelection->Form);
case FormSetLevel:
+ if (gCurrentSelection == NULL) {
+ return FALSE;
+ }
return IsNvUpdateRequiredForFormSet (gCurrentSelection->FormSet);
case SystemLevel:
Link = GetFirstNode (&gBrowserFormSetList);
while (!IsNull (&gBrowserFormSetList, Link)) {
FormSet = FORM_BROWSER_FORMSET_FROM_LINK (Link);
+ if (!ValidateFormSet(FormSet)) {
+ continue;
+ }
+
if (IsNvUpdateRequiredForFormSet (FormSet)) {
return TRUE;
}
@@ -4920,19 +4952,27 @@ ExecuteAction (
IN UINT16 DefaultId
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
+ FORM_BROWSER_FORMSET *FormSet;
+ FORM_BROWSER_FORM *Form;
- if (gCurrentSelection == NULL) {
+ if (gBrowserSettingScope < SystemLevel && gCurrentSelection == NULL) {
return EFI_NOT_READY;
}
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
+ FormSet = NULL;
+ Form = NULL;
+ if (gBrowserSettingScope < SystemLevel) {
+ FormSet = gCurrentSelection->FormSet;
+ Form = gCurrentSelection->Form;
+ }
//
// Executet the discard action.
//
if ((Action & BROWSER_ACTION_DISCARD) != 0) {
- Status = DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ Status = DiscardForm (FormSet, Form, gBrowserSettingScope);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4942,7 +4982,7 @@ ExecuteAction (
// Executet the difault action.
//
if ((Action & BROWSER_ACTION_DEFAULT) != 0) {
- Status = ExtractDefault (gCurrentSelection->FormSet, gCurrentSelection->Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
+ Status = ExtractDefault (FormSet, Form, DefaultId, gBrowserSettingScope, GetDefaultForAll, NULL, FALSE);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4952,7 +4992,7 @@ ExecuteAction (
// Executet the submit action.
//
if ((Action & BROWSER_ACTION_SUBMIT) != 0) {
- Status = SubmitForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ Status = SubmitForm (FormSet, Form, gBrowserSettingScope);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -4969,7 +5009,7 @@ ExecuteAction (
// Executet the exit action.
//
if ((Action & BROWSER_ACTION_EXIT) != 0) {
- DiscardForm (gCurrentSelection->FormSet, gCurrentSelection->Form, gBrowserSettingScope);
+ DiscardForm (FormSet, Form, gBrowserSettingScope);
if (gBrowserSettingScope == SystemLevel) {
if (ExitHandlerFunction != NULL) {
ExitHandlerFunction ();
@@ -4989,6 +5029,7 @@ ExecuteAction (
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
UINT32
@@ -5001,6 +5042,7 @@ SaveReminder (
FORM_BROWSER_FORMSET *FormSet;
BOOLEAN IsDataChanged;
UINT32 DataSavedAction;
+ UINT32 ConfirmRet;
DataSavedAction = BROWSER_NO_CHANGES;
IsDataChanged = FALSE;
@@ -5028,13 +5070,18 @@ SaveReminder (
// If data is changed, prompt user to save or discard it.
//
do {
- DataSavedAction = (UINT32) mFormDisplay->ConfirmDataChange();
+ ConfirmRet = (UINT32) mFormDisplay->ConfirmDataChange();
- if (DataSavedAction == BROWSER_SAVE_CHANGES) {
+ if (ConfirmRet == BROWSER_ACTION_SUBMIT) {
SubmitForm (NULL, NULL, SystemLevel);
+ DataSavedAction = BROWSER_SAVE_CHANGES;
break;
- } else if (DataSavedAction == BROWSER_DISCARD_CHANGES) {
+ } else if (ConfirmRet == BROWSER_ACTION_DISCARD) {
DiscardForm (NULL, NULL, SystemLevel);
+ DataSavedAction = BROWSER_DISCARD_CHANGES;
+ break;
+ } else if (ConfirmRet == BROWSER_ACTION_NONE) {
+ DataSavedAction = BROWSER_KEEP_CURRENT;
break;
}
} while (1);
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
index 9cb4653c8..87305bad6 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.h
@@ -288,9 +288,11 @@ typedef enum {
ExpressOption
} EXPRESS_LEVEL;
+typedef struct _FORM_BROWSER_STATEMENT FORM_BROWSER_STATEMENT;
+
#define FORM_BROWSER_STATEMENT_SIGNATURE SIGNATURE_32 ('F', 'S', 'T', 'A')
-typedef struct {
+struct _FORM_BROWSER_STATEMENT{
UINTN Signature;
LIST_ENTRY Link;
@@ -352,7 +354,8 @@ typedef struct {
EFI_IMAGE_ID ImageId; // nested EFI_IFR_IMAGE
UINT8 RefreshInterval; // nested EFI_IFR_REFRESH, refresh interval(in seconds) for Question value, 0 means no refresh
- BOOLEAN InSubtitle; // nesting inside of EFI_IFR_SUBTITLE
+
+ FORM_BROWSER_STATEMENT *ParentStatement;
LIST_ENTRY InconsistentListHead;// nested inconsistent expression list (FORM_EXPRESSION)
LIST_ENTRY NoSubmitListHead; // nested nosubmit expression list (FORM_EXPRESSION)
@@ -361,7 +364,7 @@ typedef struct {
FORM_EXPRESSION *ReadExpression; // nested EFI_IFR_READ, provide this question value by read expression.
FORM_EXPRESSION *WriteExpression; // nested EFI_IFR_WRITE, evaluate write expression after this question value is set.
-} FORM_BROWSER_STATEMENT;
+};
#define FORM_BROWSER_STATEMENT_FROM_LINK(a) CR (a, FORM_BROWSER_STATEMENT, Link, FORM_BROWSER_STATEMENT_SIGNATURE)
@@ -1324,6 +1327,7 @@ ExecuteAction (
@retval BROWSER_NO_CHANGES No browser data is changed.
@retval BROWSER_SAVE_CHANGES The changed browser data is saved.
@retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
+ @retval BROWSER_KEEP_CURRENT Browser keep current changes.
**/
UINT32
diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
index 157ea8554..329bdbfc4 100644
--- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
+++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
@@ -981,7 +981,7 @@ SmbiosCreateTable (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (EntryPointStructure->TableLength),
&PhysicalAddress
);
@@ -1093,7 +1093,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
@@ -1101,7 +1101,7 @@ SmbiosDriverEntryPoint (
DEBUG ((EFI_D_ERROR, "SmbiosDriverEntryPoint() could not allocate EntryPointStructure < 4GB\n"));
Status = gBS->AllocatePages (
AllocateAnyPages,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES (sizeof (SMBIOS_TABLE_ENTRY_POINT)),
&PhysicalAddress
);
@@ -1127,7 +1127,7 @@ SmbiosDriverEntryPoint (
PhysicalAddress = 0xffffffff;
Status = gBS->AllocatePages (
AllocateMaxAddress,
- EfiRuntimeServicesData,
+ EfiRuntimeServicesData,
1,
&PhysicalAddress
);
diff --git a/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h b/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
index 0d519d0a6..1e1a5ac97 100644
--- a/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
+++ b/MdePkg/Include/IndustryStandard/IScsiBootFirmwareTable.h
@@ -2,7 +2,7 @@
The definition for iSCSI Boot Firmware Table, it's defined in Microsoft's
iSCSI Boot Firmware Table(iBFT) as Defined in ACPI 3.0b Specification.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -157,6 +157,10 @@ typedef struct {
#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_CHAP BIT2
#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_FLAG_RADIUS_RCHAP BIT3
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP 0
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP 1
+#define EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP 2
+
#pragma pack()
#endif
diff --git a/MdePkg/Include/IndustryStandard/Pci.h b/MdePkg/Include/IndustryStandard/Pci.h
index ed59a4571..a808494a7 100644
--- a/MdePkg/Include/IndustryStandard/Pci.h
+++ b/MdePkg/Include/IndustryStandard/Pci.h
@@ -1,7 +1,7 @@
/** @file
Support for the latest PCI standard.
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -17,6 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <IndustryStandard/Pci30.h>
#include <IndustryStandard/PciExpress21.h>
+#include <IndustryStandard/PciExpress30.h>
#include <IndustryStandard/PciCodeId.h>
#endif
diff --git a/MdePkg/Include/IndustryStandard/PciExpress21.h b/MdePkg/Include/IndustryStandard/PciExpress21.h
index 2ebbc3250..a9915e032 100644
--- a/MdePkg/Include/IndustryStandard/PciExpress21.h
+++ b/MdePkg/Include/IndustryStandard/PciExpress21.h
@@ -1,7 +1,7 @@
/** @file
Support for the latest PCI standard.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -70,4 +70,222 @@ typedef struct {
#define EFI_PCIE_CAPABILITY_ID_SRIOV_BAR5 0x38
#define EFI_PCIE_CAPABILITY_ID_SRIOV_VF_MIGRATION_STATE 0x3C
+typedef struct {
+ UINT32 CapabilityId:16;
+ UINT32 CapabilityVersion:4;
+ UINT32 NextCapabilityOffset:12;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER;
+
+#define PCI_EXP_EXT_HDR PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ADVANCED_ERROR_REPORTING_ID 0x0001
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ADVANCED_ERROR_REPORTING_VER1 0x1
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ADVANCED_ERROR_REPORTING_VER2 0x2
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 UncorrectableErrorStatus;
+ UINT32 UncorrectableErrorMask;
+ UINT32 UncorrectableErrorSeverity;
+ UINT32 CorrectableErrorStatus;
+ UINT32 CorrectableErrorMask;
+ UINT32 AdvancedErrorCapabilitiesAndControl;
+ UINT32 HeaderLog;
+ UINT32 RootErrorCommand;
+ UINT32 RootErrorStatus;
+ UINT16 ErrorSourceIdentification;
+ UINT16 CorrectableErrorSourceIdentification;
+ UINT32 TlpPrefixLog[4];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID 0x0002
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_MFVC 0x0009
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_VER1 0x1
+
+typedef struct {
+ UINT32 VcResourceCapability:24;
+ UINT32 PortArbTableOffset:8;
+ UINT32 VcResourceControl;
+ UINT16 Reserved1;
+ UINT16 VcResourceStatus;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC;
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 ExtendedVcCount:3;
+ UINT32 PortVcCapability1:29;
+ UINT32 PortVcCapability2:24;
+ UINT32 VcArbTableOffset:8;
+ UINT16 PortVcControl;
+ UINT16 PortVcStatus;
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC Capability[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_SERIAL_NUMBER_ID 0x0003
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_SERIAL_NUMBER_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT64 SerialNumber;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_ID 0x0005
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 ElementSelfDescription;
+ UINT32 Reserved;
+ UINT32 LinkEntry[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(LINK_DECLARATION) (UINT8)(((LINK_DECLARATION->ElementSelfDescription)&0x0000ff00)>>8)
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_CONTROL_ID 0x0006
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_CONTROL_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 RootComplexLinkCapabilities;
+ UINT16 RootComplexLinkControl;
+ UINT16 RootComplexLinkStatus;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_POWER_BUDGETING_ID 0x0004
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_POWER_BUDGETING_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 DataSelect:8;
+ UINT32 Reserved:24;
+ UINT32 Data;
+ UINT32 PowerBudgetCapability:1;
+ UINT32 Reserved2:7;
+ UINT32 Reserved3:24;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_ID 0x000D
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT16 AcsCapability;
+ UINT16 AcsControl;
+ UINT8 EgressControlVectorArray[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x00000020))
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(ACS_EXTENDED) (UINT8)(((ACS_EXTENDED->AcsCapability)&0x0000FF00))
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_ID 0x0007
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 AssociationBitmap;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID 0x0008
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_VER1 0x1
+
+typedef PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTI_FUNCTION_VIRTUAL_CHANNEL_CAPABILITY;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_ID 0x000B
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 VendorSpecificHeader;
+ UINT8 VendorSpecific[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_GET_SIZE(VENDOR) (UINT16)(((VENDOR->VendorSpecificHeader)&0xFFF00000)>>20)
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_RCRB_HEADER_ID 0x000A
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_RCRB_HEADER_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT16 VendorId;
+ UINT16 DeviceId;
+ UINT32 RcrbCapabilities;
+ UINT32 RcrbControl;
+ UINT32 Reserved;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID 0x0012
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT16 MultiCastCapability;
+ UINT16 MulticastControl;
+ UINT64 McBaseAddress;
+ UINT64 McReceiveAddress;
+ UINT64 McBlockAll;
+ UINT64 McBlockUntranslated;
+ UINT64 McOverlayBar;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_ID 0x0015
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_VER1 0x1
+
+typedef struct {
+ UINT32 ResizableBarCapability;
+ UINT16 ResizableBarControl;
+ UINT16 Reserved;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY;
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY Capability[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR;
+
+#define GET_NUMBER_RESIZABLE_BARS(x) (((x->Capability[0].ResizableBarControl) & 0xE0) >> 5)
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID 0x000E
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT16 AriCapability;
+ UINT16 AriControl;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_ID 0x0016
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 DpaCapability;
+ UINT32 DpaLatencyIndicator;
+ UINT16 DpaStatus;
+ UINT16 DpaControl;
+ UINT8 DpaPowerAllocationArray[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(POWER) (UINT16)(((POWER->DpaCapability)&0x0000000F))
+
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LATENCE_TOLERANCE_REPORTING_ID 0x0018
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_LATENCE_TOLERANCE_REPORTING_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT16 MaxSnoopLatency;
+ UINT16 MaxNoSnoopLatency;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING;
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_TPH_ID 0x0017
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_TPH_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 TphRequesterCapability;
+ UINT32 TphRequesterControl;
+ UINT16 TphStTable[1];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH;
+
+#define GET_TPH_TABLE_SIZE(x) ((x->TphRequesterCapability & 0x7FF0000)>>16) * sizeof(UINT16)
+
#endif
diff --git a/MdePkg/Include/IndustryStandard/PciExpress30.h b/MdePkg/Include/IndustryStandard/PciExpress30.h
new file mode 100644
index 000000000..6e9e105da
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/PciExpress30.h
@@ -0,0 +1,32 @@
+/** @file
+ Support for the PCI Express 3.0 standard.
+
+ This header file may not define all structures. Please extend as required.
+
+ Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+ 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 _PCIEXPRESS30_H_
+#define _PCIEXPRESS30_H_
+
+#include "PciExpress21.h"
+
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_SECONDARY_PCIE_ID 0x0019
+#define PCI_EXPRESS_EXTENDED_CAPABILITY_SECONDARY_PCIE_VER1 0x1
+
+typedef struct {
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_HEADER Header;
+ UINT32 LinkControl3;
+ UINT32 LaneErrorStatus;
+ UINT16 EqualizationControl[2];
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE;
+
+#endif
diff --git a/MdePkg/Include/IndustryStandard/SmBios.h b/MdePkg/Include/IndustryStandard/SmBios.h
index c74e18a7f..91e85eeee 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -1,7 +1,7 @@
/** @file
Industry Standard Definitions of SMBIOS Table Specification v2.7.1
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -566,6 +566,22 @@ typedef enum {
} PROCESSOR_FAMILY_DATA;
///
+/// Processor Information2 - Processor Family2.
+///
+typedef enum {
+ ProcessorFamilySH3 = 0x0104,
+ ProcessorFamilySH4 = 0x0105,
+ ProcessorFamilyARM = 0x0118,
+ ProcessorFamilyStrongARM = 0x0119,
+ ProcessorFamily6x86 = 0x012C,
+ ProcessorFamilyMediaGX = 0x012D,
+ ProcessorFamilyMII = 0x012E,
+ ProcessorFamilyWinChip = 0x0140,
+ ProcessorFamilyDSP = 0x015E,
+ ProcessorFamilyVideoProcessor = 0x01F4
+} PROCESSOR_FAMILY2_DATA;
+
+///
/// Processor Information - Voltage.
///
typedef struct {
diff --git a/MdePkg/Include/Library/MemoryAllocationLib.h b/MdePkg/Include/Library/MemoryAllocationLib.h
index b5384498e..0df59e60a 100644
--- a/MdePkg/Include/Library/MemoryAllocationLib.h
+++ b/MdePkg/Include/Library/MemoryAllocationLib.h
@@ -6,7 +6,7 @@
and SMM (for example) is done via a different mechanism. Using a common library interface makes it
much easier to port algorithms from phase to phase.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -110,6 +110,7 @@ FreePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -134,6 +135,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -158,6 +160,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdePkg/Include/Library/PcdLib.h b/MdePkg/Include/Library/PcdLib.h
index 1ea4ac7ce..ea39bb53b 100644
--- a/MdePkg/Include/Library/PcdLib.h
+++ b/MdePkg/Include/Library/PcdLib.h
@@ -14,7 +14,7 @@
There are no restrictions on the use of FeaturePcd(), FixedPcdGetXX(),
PatchPcdGetXX(), and PatchPcdSetXX().
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -439,6 +439,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Sets the 8-bit value for the token specified by TokenName. Value is returned.
If TokenName is not a valid token in the token space, then the module will not build.
+ If the set operation was not correctly performed, then ASSERT().
+
@param TokenName The name of the PCD token to retrieve a current value for.
@param Value The 8-bit value to set.
@@ -454,6 +456,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Sets the 16-bit value for the token specified by TokenName. Value is returned.
If TokenName is not a valid token in the token space, then the module will not build.
+ If the set operation was not correctly performed, then ASSERT().
+
@param TokenName The name of the PCD token to retrieve a current value for.
@param Value The 16-bit value to set.
@@ -469,6 +473,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Sets the 32-bit value for the token specified by TokenName. Value is returned.
If TokenName is not a valid token in the token space, then the module will not build.
+ If the set operation was not correctly performed, then ASSERT().
+
@param TokenName The name of the PCD token to retrieve a current value for.
@param Value The 32-bit value to set.
@@ -501,7 +507,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then set SizeOfBuffer to the maximum size supported by TokenName and return NULL
to indicate that the set operation was not actually performed. If SizeOfBuffer
is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported
- by TokenName and NULL must be returned.
+ by TokenName and NULL must be returned, or ASSERT() if the set operation was not corretly performed.
If TokenName is not a valid token in the token space, then the module will not build.
If SizeOfBuffer is NULL, then ASSERT().
@@ -523,6 +529,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Sets the Boolean value for the token specified by TokenName. Value is returned.
If TokenName is not a valid token in the token space, then the module will not build.
+ If the set operation was not correctly performed, then ASSERT().
+
@param TokenName The name of the PCD token to set the current value for.
@param Buffer The Boolean value to set.
@@ -667,6 +675,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then the module will not build.
If Guid is NULL, then ASSERT().
+ If the set operation was not correctly performed, then ASSERT().
@param Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@@ -687,6 +696,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then the module will not build.
If Guid is NULL, then ASSERT().
+ If the set operation was not correctly performed, then ASSERT().
@param Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@@ -707,6 +717,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then the module will not build.
If Guid is NULL, then ASSERT().
+ If the set operation was not correctly performed, then ASSERT().
@param Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@@ -727,6 +738,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then the module will not build.
If Guid is NULL, then ASSERT().
+ If the set operation was not correctly performed, then ASSERT().
@param Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@@ -747,7 +759,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then set SizeOfBuffer to the maximum size supported by Guid and TokenName and return
NULL to indicate that the set operation was not actually performed. If SizeOfBuffer
is set to MAX_ADDRESS, then SizeOfBuffer must be set to the maximum size supported by
- Guid and TokenName and NULL must be returned.
+ Guid and TokenName and NULL must be returned, or ASSERT() if the set operation was not corretly performed.
If TokenName is not a valid token in the token space specified by Guid,
then the module will not build.
@@ -776,6 +788,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
then the module will not build.
If Guid is NULL, then ASSERT().
+ If the set operation was not correctly performed, then ASSERT().
@param Guid Pointer to a 128-bit unique value that designates
which namespace to retrieve a value from.
@@ -1081,7 +1094,9 @@ LibPcdGetExSize (
Sets the 8-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@@ -1101,7 +1116,9 @@ LibPcdSet8 (
Sets the 16-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@@ -1121,7 +1138,9 @@ LibPcdSet16 (
Sets the 32-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@@ -1141,7 +1160,9 @@ LibPcdSet32 (
Sets the 64-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@@ -1163,7 +1184,8 @@ LibPcdSet64 (
specified by Buffer and SizeOfBuffer. Buffer is returned.
If SizeOfBuffer is greater than the maximum size support by TokenNumber,
then set SizeOfBuffer to the maximum size supported by TokenNumber and
- return NULL to indicate that the set operation was not actually performed.
+ return NULL to indicate that the set operation was not actually performed,
+ or ASSERT() if the set operation was not corretly performed.
If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
maximum size supported by TokenName and NULL must be returned.
@@ -1192,7 +1214,9 @@ LibPcdSetPtr (
Sets the Boolean value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The boolean value to set.
@@ -1212,9 +1236,10 @@ LibPcdSetBool (
Sets the 8-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1237,9 +1262,10 @@ LibPcdSetEx8 (
Sets the 16-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1262,9 +1288,10 @@ LibPcdSetEx16 (
Sets the 32-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1287,8 +1314,10 @@ LibPcdSetEx32 (
Sets the 64-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1313,7 +1342,7 @@ LibPcdSetEx64 (
Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
supported by TokenNumber and return NULL to indicate that the set operation
- was not actually performed.
+ was not actually performed, or ASSERT() if the set operation was not corretly performed.
If Guid is NULL, then ASSERT().
If SizeOfBuffer is NULL, then ASSERT().
@@ -1343,9 +1372,10 @@ LibPcdSetExPtr (
Sets the Boolean value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid Pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
diff --git a/MdePkg/Include/Library/PeiServicesTablePointerLib.h b/MdePkg/Include/Library/PeiServicesTablePointerLib.h
index 601e1d57f..b1bed2579 100644
--- a/MdePkg/Include/Library/PeiServicesTablePointerLib.h
+++ b/MdePkg/Include/Library/PeiServicesTablePointerLib.h
@@ -1,7 +1,7 @@
/** @file
Provides a service to retrieve a pointer to the PEI Services Table.
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -50,5 +50,24 @@ SetPeiServicesTablePointer (
IN CONST EFI_PEI_SERVICES ** PeiServicesTablePointer
);
+/**
+ Perform CPU specific actions required to migrate the PEI Services Table
+ pointer from temporary RAM to permanent RAM.
+
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
+ a dedicated CPU register. This means that there is no memory storage
+ associated with storing the PEI Services Table pointer, so no additional
+ migration actions are required for Itanium or ARM CPUs.
+
+**/
+VOID
+EFIAPI
+MigratePeiServicesTablePointer (
+ );
+
#endif
diff --git a/MdePkg/Include/Library/S3BootScriptLib.h b/MdePkg/Include/Library/S3BootScriptLib.h
index 0776812e6..1afb07c24 100644
--- a/MdePkg/Include/Library/S3BootScriptLib.h
+++ b/MdePkg/Include/Library/S3BootScriptLib.h
@@ -5,7 +5,7 @@
be provided in the Framework version library instance, which means some of these
APIs cannot be used if the underlying firmware is Framework and not PI.
- Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -281,7 +281,7 @@ S3BootScriptSaveStall (
);
/**
- Adds a record for an execution stall on the processor into a specified boot script table.
+ Adds a record for dispatching specified arbitrary code into a specified boot script table.
@param[in] EntryPoint The entry point of the code to be dispatched.
@param[in] Context The argument to be passed into the EntryPoint of the code
@@ -492,7 +492,7 @@ S3BootScriptSaveInformationAsciiString (
for figuring out how to get the script to run on an S3 resume because the boot script
maintained by the lib will be destroyed.
- @return the base address of the new copy of the boot script tble.
+ @return the base address of the new copy of the boot script table.
**/
UINT8*
diff --git a/MdePkg/Include/Protocol/AdapterInformation.h b/MdePkg/Include/Protocol/AdapterInformation.h
new file mode 100644
index 000000000..b9dac1ad7
--- /dev/null
+++ b/MdePkg/Include/Protocol/AdapterInformation.h
@@ -0,0 +1,224 @@
+/** @file
+ EFI Adapter Information Protocol definition.
+ The EFI Adapter Information Protocol is used to dynamically and quickly discover
+ or set device information for an adapter.
+
+ Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.4
+
+**/
+
+#ifndef __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
+#define __EFI_ADAPTER_INFORMATION_PROTOCOL_H__
+
+
+#define EFI_ADAPTER_INFORMATION_PROTOCOL_GUID \
+ { \
+ 0xE5DD1403, 0xD622, 0xC24E, {0x84, 0x88, 0xC7, 0x1B, 0x17, 0xF5, 0xE8, 0x02 } \
+ }
+
+#define EFI_ADAPTER_INFO_MEDIA_STATE_GUID \
+ { \
+ 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 } \
+ }
+
+#define EFI_ADAPTER_INFO_NETWORK_BOOT_GUID \
+ { \
+ 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C } \
+ }
+
+#define EFI_ADAPTER_INFO_SAN_MAC_ADDRESS_GUID \
+ { \
+ 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 } \
+ }
+
+typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL EFI_ADAPTER_INFORMATION_PROTOCOL;
+
+///
+/// EFI_ADAPTER_INFO_MEDIA_STATE
+///
+typedef struct {
+ ///
+ /// Returns the current media state status. MediaState can have any of the following values:
+ /// EFI_SUCCESS: There is media attached to the network adapter. EFI_NOT_READY: This detects a bounced state.
+ /// There was media attached to the network adapter, but it was removed and reattached. EFI_NO_MEDIA: There is
+ /// not any media attached to the network.
+ ///
+ EFI_STATUS MediaState;
+}EFI_ADAPTER_INFO_MEDIA_STATE;
+
+///
+/// EFI_ADAPTER_INFO_NETWORK_BOOT
+///
+typedef struct {
+ ///
+ /// TRUE if the adapter supports booting from iSCSI IPv4 targets.
+ ///
+ BOOLEAN iSsciIpv4BootCapablity;
+ ///
+ /// TRUE if the adapter supports booting from iSCSI IPv6 targets.
+ ///
+ BOOLEAN iScsiIpv6BootCapablity;
+ ///
+ /// TRUE if the adapter supports booting from FCoE targets.
+ ///
+ BOOLEAN FCoeBootCapablity;
+ ///
+ /// TRUE if the adapter supports an offload engine (such as TCP
+ /// Offload Engine (TOE)) for its iSCSI or FCoE boot operations.
+ ///
+ BOOLEAN OffloadCapability;
+ ///
+ /// TRUE if the adapter supports multipath I/O (MPIO) for its iSCSI
+ /// boot operations.
+ ///
+ BOOLEAN iScsiMpioCapability;
+ ///
+ /// TRUE if the adapter is currently configured to boot from iSCSI
+ /// IPv4 targets.
+ ///
+ BOOLEAN iScsiIpv4Boot;
+ ///
+ /// TRUE if the adapter is currently configured to boot from iSCSI
+ /// IPv6 targets.
+ ///
+ BOOLEAN iScsiIpv6Boot;
+ ///
+ /// TRUE if the adapter is currently configured to boot from FCoE targets.
+ ///
+ BOOLEAN FCoeBoot;
+}EFI_ADAPTER_INFO_NETWORK_BOOT;
+
+///
+/// EFI_ADAPTER_INFO_SAN_MAC_ADDRESS
+///
+typedef struct {
+ ///
+ /// Returns the SAN MAC address for the adapter.For adapters that support today's 802.3 ethernet
+ /// networking and Fibre-Channel Over Ethernet (FCOE), this conveys the FCOE SAN MAC address from the adapter.
+ ///
+ EFI_MAC_ADDRESS SanMacAddress;
+}EFI_ADAPTER_INFO_SAN_MAC_ADDRESS;
+
+/**
+ Returns the current state information for the adapter.
+
+ This function returns information of type InformationType from the adapter.
+ If an adapter does not support the requested informational type, then
+ EFI_UNSUPPORTED is returned.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
+ @param[out] InforamtionBlock The service returns a pointer to the buffer with the InformationBlock
+ structure which contains details about the data specific to InformationType.
+ @param[out] InforamtionBlockSize The driver returns the size of the InformationBlock in bytes.
+
+ @retval EFI_SUCCESS The InformationType information was retrieved.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlockSize is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_GET_INFO)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ OUT VOID **InformationBlock,
+ OUT UINTN *InformationBlockSize
+ );
+
+/**
+ Sets state information for an adapter.
+
+ This function sends information of type InformationType for an adapter.
+ If an adapter does not support the requested information type, then EFI_UNSUPPORTED
+ is returned.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[in] InformationType A pointer to an EFI_GUID that defines the contents of InformationBlock.
+ @param[in] InforamtionBlock A pointer to the InformationBlock structure which contains details
+ about the data specific to InformationType.
+ @param[in] InforamtionBlockSize The size of the InformationBlock in bytes.
+
+ @retval EFI_SUCCESS The information was received and interpreted successfully.
+ @retval EFI_UNSUPPORTED The InformationType is not known.
+ @retval EFI_DEVICE_ERROR The device reported an error.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InformationBlock is NULL.
+ @retval EFI_WRITE_PROTECTED The InformationType cannot be modified using EFI_ADAPTER_INFO_SET_INFO().
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_SET_INFO)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ IN EFI_GUID *InformationType,
+ IN VOID *InformationBlock,
+ IN UINTN InformationBlockSize
+ );
+
+/**
+ Get a list of supported information types for this instance of the protocol.
+
+ This function returns a list of InformationType GUIDs that are supported on an
+ adapter with this instance of EFI_ADAPTER_INFORMATION_PROTOCOL. The list is returned
+ in InfoTypesBuffer, and the number of GUID pointers in InfoTypesBuffer is returned in
+ InfoTypesBufferCount.
+
+ @param[in] This A pointer to the EFI_ADAPTER_INFORMATION_PROTOCOL instance.
+ @param[out] InfoTypesBuffer A pointer to the list of InformationType GUID pointers that are supported
+ by This.
+ @param[out] InfoTypesBufferCount A pointer to the number of GUID pointers present in InfoTypesBuffer.
+
+ @retval EFI_SUCCESS The list of information type GUIDs that are supported on this adapter was
+ returned in InfoTypesBuffer. The number of information type GUIDs was
+ returned in InfoTypesBufferCount.
+ @retval EFI_INVALID_PARAMETER This is NULL.
+ @retval EFI_INVALID_PARAMETER InfoTypesBuffer is NULL.
+ @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.
+ @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the results.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES)(
+ IN EFI_ADAPTER_INFORMATION_PROTOCOL *This,
+ OUT EFI_GUID **InfoTypesBuffer,
+ OUT UINTN *InfoTypesBufferCount
+ );
+
+///
+/// EFI_ADAPTER_INFORMATION_PROTOCOL
+/// The protocol for adapter provides the following services.
+/// - Gets device state information from adapter.
+/// - Sets device information for adapter.
+/// - Gets a list of supported information types for this instance of the protocol.
+///
+typedef struct _EFI_ADAPTER_INFORMATION_PROTOCOL {
+ EFI_ADAPTER_INFO_GET_INFO GetInformation;
+ EFI_ADAPTER_INFO_SET_INFO SetInformation;
+ EFI_ADAPTER_INFO_GET_SUPPORTED_TYPES GetSupportedTypes;
+};
+
+extern EFI_GUID gEfiAdapterInformationProtocolGuid;
+
+extern EFI_GUID gEfiAdapterInfoMediaStateGuid;
+
+extern EFI_GUID gEfiAdapterInfoNetworkBootGuid;
+
+extern EFI_GUID gEfiAdapterInfoSanMacAddressGuid;
+
+#endif
diff --git a/MdePkg/Include/Protocol/DiskIo2.h b/MdePkg/Include/Protocol/DiskIo2.h
index a6badf231..6e0665b1d 100644
--- a/MdePkg/Include/Protocol/DiskIo2.h
+++ b/MdePkg/Include/Protocol/DiskIo2.h
@@ -1,9 +1,8 @@
/** @file
- Disk IO protocol as defined in the UEFI 2.0 specification.
+ Disk I/O 2 protocol as defined in the UEFI 2.4 specification.
- The Disk IO2 protocol is used to convert block oriented devices into byte
- oriented devices. The Disk IO protocol is intended to layer on top of the
- Block IO protocol.
+ The Disk I/O 2 protocol defines an extension to the Disk I/O protocol to enable
+ non-blocking / asynchronous byte-oriented disk operation.
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
diff --git a/MdePkg/Include/Protocol/FirmwareManagement.h b/MdePkg/Include/Protocol/FirmwareManagement.h
index ae840268a..56b0ff53a 100644
--- a/MdePkg/Include/Protocol/FirmwareManagement.h
+++ b/MdePkg/Include/Protocol/FirmwareManagement.h
@@ -8,7 +8,7 @@
CheckImage(), GetPackageInfo(), and SetPackageInfo() shall return
EFI_UNSUPPORTED if not supported by the driver.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -130,7 +130,7 @@ typedef struct {
#define IMAGE_COMPATIBILITY_CHECK_SUPPORTED 0x0000000000000001
///
-/// Descriptor Version
+/// Descriptor Version exposed by GetImageInfo() function
///
#define EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION 2
@@ -148,6 +148,8 @@ typedef struct {
/// Provides the authorization for the firmware image operations. It is a signature across
/// the image data and the Monotonic Count value. Caller uses the private key that is
/// associated with a public key that has been provisioned via the key exchange.
+ /// Because this is defined as a signature, WIN_CERTIFICATE_UEFI_GUID.CertType must
+ /// be EFI_CERT_TYPE_PKCS7_GUID.
///
WIN_CERTIFICATE_UEFI_GUID AuthInfo;
} EFI_FIRMWARE_IMAGE_AUTHENTICATION;
diff --git a/MdePkg/Include/Protocol/FormBrowser2.h b/MdePkg/Include/Protocol/FormBrowser2.h
index 976ffb8a7..9e83bfa6f 100644
--- a/MdePkg/Include/Protocol/FormBrowser2.h
+++ b/MdePkg/Include/Protocol/FormBrowser2.h
@@ -4,7 +4,7 @@
The EFI_FORM_BROWSER2_PROTOCOL is the interface to call for drivers to
leverage the EFI configuration driver interface.
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -82,7 +82,7 @@ typedef UINTN EFI_BROWSER_ACTION_REQUEST;
@param FormSetGuid This field points to the EFI_GUID which must match the Guid field or one of the
elements of the ClassId field in the EFI_IFR_FORM_SET op-code. If
- FormsetGuid is NULL, then this function will display the the form set class
+ FormsetGuid is NULL, then this function will display the form set class
EFI_HII_PLATFORM_SETUP_FORMSET_GUID.
@param FormId This field specifies the identifier of the form within the form set to render as the first
diff --git a/MdePkg/Include/Protocol/Hash.h b/MdePkg/Include/Protocol/Hash.h
index 9299c9669..1f9b3b32a 100644
--- a/MdePkg/Include/Protocol/Hash.h
+++ b/MdePkg/Include/Protocol/Hash.h
@@ -5,7 +5,7 @@
provided by a driver and to create and destroy instances of the EFI Hash Protocol
so that a multiple drivers can use the underlying hashing services.
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -69,6 +69,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
0x8628752a, 0x6cb7, 0x4814, {0x96, 0xfc, 0x24, 0xa8, 0x15, 0xac, 0x22, 0x26 } \
}
+//
+// Note: Use of the following algorithms with EFI_HASH_PROTOCOL is deprecated.
+// EFI_HASH_ALGORITHM_SHA1_GUID
+// EFI_HASH_ALGORITHM_SHA224_GUID
+// EFI_HASH_ALGORITHM_SHA256_GUID
+// EFI_HASH_ALGORITHM_SHA384_GUID
+// EFI_HASH_ALGORITHM_SHA512_GUID
+// EFI_HASH_ALGORTIHM_MD5_GUID
+//
+
typedef struct _EFI_HASH_PROTOCOL EFI_HASH_PROTOCOL;
typedef UINT8 EFI_MD5_HASH[16];
diff --git a/MdePkg/Include/Protocol/SimpleFileSystem.h b/MdePkg/Include/Protocol/SimpleFileSystem.h
index bc6718cf6..461e56822 100644
--- a/MdePkg/Include/Protocol/SimpleFileSystem.h
+++ b/MdePkg/Include/Protocol/SimpleFileSystem.h
@@ -7,7 +7,7 @@
UEFI 2.0 can boot from any valid EFI image contained in a SimpleFileSystem.
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -517,8 +517,10 @@ EFI_STATUS
IN OUT EFI_FILE_IO_TOKEN *Token
);
-#define EFI_FILE_PROTOCOL_REVISION 0x00010000
-#define EFI_FILE_PROTOCOL_REVISION2 0x00020000
+#define EFI_FILE_PROTOCOL_REVISION 0x00010000
+#define EFI_FILE_PROTOCOL_REVISION2 0x00020000
+#define EFI_FILE_PROTOCOL_LATEST_REVISION EFI_FILE_PROTOCOL_REVISION2
+
//
// Revision defined in EFI1.1.
//
@@ -534,8 +536,8 @@ EFI_STATUS
struct _EFI_FILE_PROTOCOL {
///
/// The version of the EFI_FILE_PROTOCOL interface. The version specified
- /// by this specification is 0x00010000. Future versions are required
- /// to be backward compatible to version 1.0.
+ /// by this specification is EFI_FILE_PROTOCOL_LATEST_REVISION.
+ /// Future versions are required to be backward compatible to version 1.0.
///
UINT64 Revision;
EFI_FILE_OPEN Open;
diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h
index e6819aa28..168ebf511 100644
--- a/MdePkg/Include/Uefi/UefiSpec.h
+++ b/MdePkg/Include/Uefi/UefiSpec.h
@@ -2043,41 +2043,46 @@ EFI_STATUS
///
/// EFI Boot Key Data
///
-typedef UINT32 EFI_BOOT_KEY_DATA;
-///
-/// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
-///
-#define EFI_KEY_OPTION_REVISION_MASK 0x000000FF
-///
-/// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_SHIFT_PRESSED_MASK BIT8
-///
-/// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_CONTROL_PRESSED_MASK BIT9
-///
-/// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_ALT_PRESSED_MASK BIT10
-///
-/// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_LOGO_PRESSED_MASK BIT11
-///
-/// The Menu key must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_MENU_PRESSED_MASK BIT12
-///
-/// The SysReq key must be pressed (1) or must not be pressed (0).
-///
-#define EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK BIT13
-///
-/// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
-/// zero, then only the shift state is considered. If more than one, then the boot option will
-/// only be launched if all of the specified keys are pressed with the same shift state.
-///
-#define EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK (BIT30 | BIT31)
+typedef union {
+ struct {
+ ///
+ /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.
+ ///
+ UINT32 Revision : 8;
+ ///
+ /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 ShiftPressed : 1;
+ ///
+ /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 ControlPressed : 1;
+ ///
+ /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 AltPressed : 1;
+ ///
+ /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 LogoPressed : 1;
+ ///
+ /// The Menu key must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 MenuPressed : 1;
+ ///
+ /// The SysReq key must be pressed (1) or must not be pressed (0).
+ ///
+ UINT32 SysReqPressed : 1;
+ UINT32 Reserved : 16;
+ ///
+ /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If
+ /// zero, then only the shift state is considered. If more than one, then the boot option will
+ /// only be launched if all of the specified keys are pressed with the same shift state.
+ ///
+ UINT32 InputKeyCount : 2;
+ } Options;
+ UINT32 PackedValue;
+} EFI_BOOT_KEY_DATA;
///
/// EFI Key Option.
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.S b/MdePkg/Library/BaseLib/Ia32/Thunk16.S
index 8356c5a1c..185655eec 100644
--- a/MdePkg/Library/BaseLib/Ia32/Thunk16.S
+++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.S
@@ -24,6 +24,28 @@
ASM_GLOBAL ASM_PFX(m16Start), ASM_PFX(m16Size), ASM_PFX(mThunk16Attr), ASM_PFX(m16Gdt), ASM_PFX(m16GdtrBase), 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 4
+.set _EIP, 44 #size 4
+.set _CS, 48 #size 2
+.set _SS, 50 #size 2
+.set IA32_REGS_SIZE, 52
+
+ .text
+ .code16
+
ASM_PFX(m16Start):
SavedGdt: .space 6
@@ -31,21 +53,22 @@ SavedGdt: .space 6
ASM_PFX(BackFromUserCode):
push %ss
push %cs
- .byte 0x66
- call L_Base1 # push eip
+
+ calll L_Base1 # push eip
L_Base1:
- pushfw # pushfd actually
+ pushfl
cli # disable interrupts
push %gs
push %fs
push %es
push %ds
- pushaw # pushad actually
+ pushal
.byte 0x66, 0xba # mov edx, imm32
ASM_PFX(ThunkAttr): .space 4
testb $THUNK_ATTRIBUTE_DISABLE_A20_MASK_INT_15, %dl
jz 1f
- movl $0x15cd2401, %eax # mov ax, 2401h & int 15h
+ movw $0x2401, %ax
+ int $0x15
cli # disable interrupts
jnc 2f
1:
@@ -55,27 +78,26 @@ ASM_PFX(ThunkAttr): .space 4
orb $2, %al
outb %al, $0x92 # deactivate A20M#
2:
- xorw %ax, %ax # xor eax, eax
- movl %ss, %eax # mov ax, ss
- .byte 0x67, 0x66, 0x8d, 0x6c, 0x24, 0x34, 0x66
- mov %ebp, 0xffffffd8(%esi)
- mov 0xfffffff8(%esi), %ebx
- shlw $4, %ax # shl eax, 4
- addw %ax, %bp # add ebp, eax
- .byte 0x66, 0xb8 # mov eax, imm32
+ xorl %eax, %eax
+ movw %ss, %ax
+ leal IA32_REGS_SIZE(%esp), %ebp
+ mov %ebp, (_ESP - IA32_REGS_SIZE)(%bp)
+ mov (_EIP - IA32_REGS_SIZE)(%bp), %bx
+ shll $4, %eax
+ addl %eax, %ebp
+ .byte 0x66, 0xb8 # mov eax, imm32
SavedCr4: .space 4
movl %eax, %cr4
- lgdtw %cs:0xfffffff2(%edi)
- .byte 0x66, 0xb8 # mov eax, imm32
+ lgdtl %cs:(SavedGdt - L_Base1)(%bx)
+ .byte 0x66, 0xb8 # mov eax, imm32
SavedCr0: .space 4
movl %eax, %cr0
.byte 0xb8 # mov ax, imm16
SavedSs: .space 2
movl %eax, %ss
- .byte 0x66, 0xbc # mov esp, imm32
+ .byte 0x66, 0xbc # mov esp, imm32
SavedEsp: .space 4
- .byte 0x66
- lret # return to protected mode
+ lretl # return to protected mode
_EntryPoint: .long ASM_PFX(ToUserCode) - ASM_PFX(m16Start)
.word 0x8
@@ -85,37 +107,31 @@ _16Gdtr: .word GdtEnd - _NullSegDesc - 1
_16GdtrBase: .long _NullSegDesc
ASM_PFX(ToUserCode):
- movl %ss, %edx
- movl %ecx, %ss # set new segment selectors
- movl %ecx, %ds
- movl %ecx, %es
- movl %ecx, %fs
- movl %ecx, %gs
- movl %eax, %cr0
- movl %ebp, %cr4 # real mode starts at next instruction
- movl %esi, %ss # set up 16-bit stack segment
- xchgw %bx, %sp # set up 16-bit stack pointer
- .byte 0x66
- call L_Base # push eip
-L_Base:
- popw %bp # ebp <- offset L_Base
- .byte 0x67; # address size override
- push 54(%esp)
- lea 0xc(%esi), %eax
- push %eax
- lret
+ movw %ss, %dx
+ movw %cx, %ss # set new segment selectors
+ movw %cx, %ds
+ movw %cx, %es
+ movw %cx, %fs
+ movw %cx, %gs
+ movl %eax, %cr0 # real mode starts at next instruction
+ # which (per SDM) *must* be a far JMP.
+ ljmpw $0,$0 # will be filled in by InternalAsmThunk16
+L_Base: # to point here.
+ movl %ebp, %cr4
+ movw %si, %ss # set up 16-bit stack segment
+ xchgl %ebx, %esp # set up 16-bit stack pointer
-L_RealMode:
- mov %edx, %cs:0xffffffc5(%esi)
- mov %bx, %cs:0xffffffcb(%esi)
- lidtw %cs:0xffffffd7(%esi)
- popaw # popad actually
+ movw IA32_REGS_SIZE(%esp), %bp # get BackToUserCode address from stack
+ mov %dx, %cs:(SavedSs - ASM_PFX(BackFromUserCode))(%bp)
+ mov %ebx, %cs:(SavedEsp - ASM_PFX(BackFromUserCode))(%bp)
+ lidtl %cs:(_16Idtr - ASM_PFX(BackFromUserCode))(%bp)
+ popal
pop %ds
pop %es
pop %fs
pop %gs
- popfw # popfd
- lretw # transfer control to user code
+ popfl
+ lretl # transfer control to user code
_NullSegDesc: .quad 0
_16CsDesc:
@@ -134,6 +150,7 @@ _16DsDesc:
.byte 0
GdtEnd:
+ .code32
#
# @param RegSet The pointer to a IA32_DWORD_REGS structure
# @param Transition The pointer to the transition code
@@ -149,41 +166,43 @@ ASM_PFX(InternalAsmThunk16):
push %fs
push %gs
movl 36(%esp), %esi # esi <- RegSet
- movzwl 0x32(%esi), %edx
- mov 0xc(%esi), %edi
- add $0xffffffc8, %edi
+ movzwl _SS(%esi), %edx
+ mov _ESP(%esi), %edi
+ add $(-(IA32_REGS_SIZE + 4)), %edi
movl %edi, %ebx # ebx <- stack offset
imul $0x10, %edx, %eax
- push $0xd
+ push $(IA32_REGS_SIZE / 4)
addl %eax, %edi # edi <- linear address of 16-bit stack
pop %ecx
rep
movsl # copy RegSet
movl 40(%esp), %eax # eax <- address of transition code
movl %edx, %esi # esi <- 16-bit stack segment
- lea 0x61(%eax), %edx
+ lea (SavedCr0 - ASM_PFX(m16Start))(%eax), %edx
movl %eax, %ecx
andl $0xf, %ecx
shll $12, %eax
- lea 0x6(%ecx), %ecx
+ lea (ASM_PFX(BackFromUserCode) - ASM_PFX(m16Start))(%ecx), %ecx
movw %cx, %ax
stosl # [edi] <- return address of user code
- sgdtl 0xffffff9f(%edx)
+ addl $(L_Base - ASM_PFX(BackFromUserCode)), %eax
+ movl %eax, (L_Base - SavedCr0 - 4)(%edx)
+ sgdtl (SavedGdt - SavedCr0)(%edx)
sidtl 0x24(%esp)
movl %cr0, %eax
movl %eax, (%edx) # save CR0 in SavedCr0
andl $0x7ffffffe, %eax # clear PE, PG bits
movl %cr4, %ebp
- mov %ebp, 0xfffffff1(%edx)
+ mov %ebp, (SavedCr4 - SavedCr0)(%edx)
andl $0xffffffcf, %ebp # clear PAE, PSE bits
pushl $0x10
pop %ecx # ecx <- selector for data segments
- lgdtl 0x20(%edx)
+ lgdtl (_16Gdtr - SavedCr0)(%edx)
pushfl
- lcall *0x14(%edx)
+ lcall *(_EntryPoint - SavedCr0)(%edx)
popfl
lidtl 0x24(%esp)
- lea 0xffffffcc(%ebp), %eax
+ lea -IA32_REGS_SIZE(%ebp), %eax
pop %gs
pop %fs
pop %es
diff --git a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
index 3e84aedf3..08955d4e9 100644
--- a/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
+++ b/MdePkg/Library/BaseLib/Ia32/Thunk16.asm
@@ -157,24 +157,30 @@ _ToUserCode PROC
mov es, ecx
mov fs, ecx
mov gs, ecx
- mov cr0, eax
- mov cr4, ebp ; real mode starts at next instruction
+ mov cr0, eax ; real mode starts at next instruction
+ ; which (per SDM) *must* be a far JMP.
+ DB 0eah
+_RealAddr DW 0,0 ; filled in by InternalAsmThunk16
+
+ mov cr4, ebp
mov ss, esi ; set up 16-bit stack segment
xchg sp, bx ; set up 16-bit stack pointer
- DB 66h
- call @Base ; push eip
-@Base:
- pop bp ; ebp <- address of @Base
- DB 67h ; address size override
- push [esp + sizeof (IA32_REGS) + 2]
- lea eax, [esi + (@RealMode - @Base)]
- push eax
- retf
-@RealMode:
- mov cs:[esi + (SavedSs - @Base)], edx
- mov cs:[esi + (SavedEsp - @Base)], bx
- DB 66h
- lidt fword ptr cs:[esi + (_16Idtr - @Base)]
+
+; mov bp, [esp + sizeof(IA32_REGS)
+ DB 67h
+ mov ebp, [esp + sizeof(IA32_REGS)] ; BackFromUserCode address from stack
+
+; mov cs:[bp + (SavedSs - _BackFromUserCode)], dx
+ mov cs:[esi + (SavedSs - _BackFromUserCode)], edx
+
+; mov cs:[bp + (SavedEsp - _BackFromUserCode)], ebx
+ DB 2eh, 66h, 89h, 9eh
+ DW SavedEsp - _BackFromUserCode
+
+; lidt cs:[bp + (_16Idtr - _BackFromUserCode)]
+ DB 2eh, 66h, 0fh, 01h, 9eh
+ DW _16Idtr - _BackFromUserCode
+
popaw ; popad actually
pop ds
pop es
@@ -230,6 +236,8 @@ InternalAsmThunk16 PROC USES ebp ebx esi edi ds es fs gs
lea ecx, [ecx + (_BackFromUserCode - m16Start)]
mov ax, cx
stosd ; [edi] <- return address of user code
+ add eax, _RealAddr + 4 - _BackFromUserCode
+ mov dword ptr [edx + (_RealAddr - SavedCr0)], eax
sgdt fword ptr [edx + (SavedGdt - SavedCr0)]
sidt fword ptr [esp + 36] ; save IDT stack in argument space
mov eax, cr0
diff --git a/MdePkg/Library/BasePcdLibNull/PcdLib.c b/MdePkg/Library/BasePcdLibNull/PcdLib.c
index 8333aaa3f..e03c01da5 100644
--- a/MdePkg/Library/BasePcdLibNull/PcdLib.c
+++ b/MdePkg/Library/BasePcdLibNull/PcdLib.c
@@ -1,7 +1,7 @@
/** @file
A emptry template implementation of PCD Library.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -400,7 +400,9 @@ LibPcdGetExSize (
Sets the 8-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@@ -426,7 +428,9 @@ LibPcdSet8 (
Sets the 16-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@@ -452,7 +456,9 @@ LibPcdSet16 (
Sets the 32-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@@ -478,7 +484,9 @@ LibPcdSet32 (
Sets the 64-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@@ -506,7 +514,8 @@ LibPcdSet64 (
specified by Buffer and SizeOfBuffer. Buffer is returned.
If SizeOfBuffer is greater than the maximum size support by TokenNumber,
then set SizeOfBuffer to the maximum size supported by TokenNumber and
- return NULL to indicate that the set operation was not actually performed.
+ return NULL to indicate that the set operation was not actually performed,
+ or ASSERT() if the set operation was not corretly performed.
If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
maximum size supported by TokenName and NULL must be returned.
@@ -541,7 +550,9 @@ LibPcdSetPtr (
Sets the Boolean value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The boolean value to set.
@@ -567,9 +578,10 @@ LibPcdSetBool (
Sets the 8-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -598,9 +610,10 @@ LibPcdSetEx8 (
Sets the 16-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -629,9 +642,10 @@ LibPcdSetEx16 (
Sets the 32-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -660,8 +674,10 @@ LibPcdSetEx32 (
Sets the 64-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -692,7 +708,7 @@ LibPcdSetEx64 (
Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
supported by TokenNumber and return NULL to indicate that the set operation
- was not actually performed.
+ was not actually performed, or ASSERT() if the set operation was not corretly performed.
If Guid is NULL, then ASSERT().
If SizeOfBuffer is NULL, then ASSERT().
@@ -728,9 +744,10 @@ LibPcdSetExPtr (
Sets the Boolean value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
diff --git a/MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c b/MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c
index 8e1ca7f4e..bb075db7d 100644
--- a/MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c
+++ b/MdePkg/Library/BaseS3BootScriptLibNull/BootScriptLib.c
@@ -1,7 +1,7 @@
/** @file
Null function implementation for EFI S3 boot script.
- Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
@@ -257,7 +257,7 @@ S3BootScriptSaveDispatch (
return RETURN_SUCCESS;
}
/**
- Adds a record for an execution stall on the processor into a specified boot script table.
+ Adds a record for dispatching specified arbitrary code into a specified boot script table.
@param EntryPoint Entry point of the code to be dispatched.
@param Context Argument to be passed into the EntryPoint of the code to be dispatched.
@@ -455,7 +455,7 @@ S3BootScriptSaveInformationAsciiString (
how to get the script to run on an S3 resume because the boot script maintained by the lib will be
destroyed.
- @return the base address of the new copy of the boot script tble.
+ @return the base address of the new copy of the boot script table.
**/
UINT8*
diff --git a/MdePkg/Library/DxePcdLib/DxePcdLib.c b/MdePkg/Library/DxePcdLib/DxePcdLib.c
index bc87c4e6a..6f3a1b286 100644
--- a/MdePkg/Library/DxePcdLib/DxePcdLib.c
+++ b/MdePkg/Library/DxePcdLib/DxePcdLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation of PcdLib class library for DXE phase.
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -489,7 +489,9 @@ LibPcdGetExSize (
Sets the 8-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@@ -518,7 +520,9 @@ LibPcdSet8 (
Sets the 16-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@@ -547,7 +551,9 @@ LibPcdSet16 (
Sets the 32-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@@ -576,6 +582,8 @@ LibPcdSet32 (
Sets the 64-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
+
+ If the set operation was not correctly performed, then ASSERT().
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@@ -607,7 +615,8 @@ LibPcdSet64 (
specified by Buffer and SizeOfBuffer. Buffer is returned.
If SizeOfBuffer is greater than the maximum size support by TokenNumber,
then set SizeOfBuffer to the maximum size supported by TokenNumber and
- return NULL to indicate that the set operation was not actually performed.
+ return NULL to indicate that the set operation was not actually performed,
+ or ASSERT() if the set operation was not correctly performed.
If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
maximum size supported by TokenName and NULL must be returned.
@@ -631,6 +640,7 @@ LibPcdSetPtr (
)
{
EFI_STATUS Status;
+ UINTN InputSizeOfBuffer;
ASSERT (SizeOfBuffer != NULL);
@@ -638,10 +648,12 @@ LibPcdSetPtr (
ASSERT (Buffer != NULL);
}
+ InputSizeOfBuffer = *SizeOfBuffer;
Status = GetPcdProtocol()->SetPtr (TokenNumber, SizeOfBuffer, (VOID *) Buffer);
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) {
return NULL;
}
+ ASSERT_EFI_ERROR (Status);
return (VOID *)Buffer;
}
@@ -653,7 +665,9 @@ LibPcdSetPtr (
Sets the Boolean value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The boolean value to set.
@@ -682,9 +696,10 @@ LibPcdSetBool (
Sets the 8-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -718,9 +733,10 @@ LibPcdSetEx8 (
Sets the 16-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -754,9 +770,10 @@ LibPcdSetEx16 (
Sets the 32-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -790,8 +807,10 @@ LibPcdSetEx32 (
Sets the 64-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -827,7 +846,7 @@ LibPcdSetEx64 (
Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
supported by TokenNumber and return NULL to indicate that the set operation
- was not actually performed.
+ was not actually performed, or ASSERT() if the set operation was not corretly performed.
If Guid is NULL, then ASSERT().
If SizeOfBuffer is NULL, then ASSERT().
@@ -852,6 +871,7 @@ LibPcdSetExPtr (
)
{
EFI_STATUS Status;
+ UINTN InputSizeOfBuffer;
ASSERT (Guid != NULL);
@@ -861,10 +881,12 @@ LibPcdSetExPtr (
ASSERT (Buffer != NULL);
}
+ InputSizeOfBuffer = *SizeOfBuffer;
Status = GetPiPcdProtocol()->SetPtr (Guid, TokenNumber, SizeOfBuffer, Buffer);
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) {
return NULL;
}
+ ASSERT_EFI_ERROR (Status);
return Buffer;
}
@@ -876,9 +898,10 @@ LibPcdSetExPtr (
Sets the Boolean value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1002,7 +1025,10 @@ LibPcdGetNextToken (
IN UINTN TokenNumber
)
{
- GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber);
+ EFI_STATUS Status;
+
+ Status = GetPiPcdProtocol()->GetNextToken (Guid, &TokenNumber);
+ ASSERT (!EFI_ERROR (Status) || TokenNumber == 0);
return TokenNumber;
}
diff --git a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
index 90d4bbfd4..e325908aa 100644
--- a/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c
@@ -189,6 +189,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -242,6 +243,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
@@ -270,6 +272,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
@@ -298,6 +301,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
diff --git a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
index a57751f41..536e1d05d 100644
--- a/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
+++ b/MdePkg/Library/PeiPcdLib/PeiPcdLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation of PcdLib class library for PEI phase.
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -490,7 +490,9 @@ LibPcdGetExSize (
Sets the 8-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 8-bit value to set.
@@ -520,7 +522,9 @@ LibPcdSet8 (
Sets the 16-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 16-bit value to set.
@@ -550,7 +554,9 @@ LibPcdSet16 (
Sets the 32-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 32-bit value to set.
@@ -580,7 +586,9 @@ LibPcdSet32 (
Sets the 64-bit value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The 64-bit value to set.
@@ -612,7 +620,8 @@ LibPcdSet64 (
specified by Buffer and SizeOfBuffer. Buffer is returned.
If SizeOfBuffer is greater than the maximum size support by TokenNumber,
then set SizeOfBuffer to the maximum size supported by TokenNumber and
- return NULL to indicate that the set operation was not actually performed.
+ return NULL to indicate that the set operation was not actually performed,
+ or ASSERT() if the set operation was not corretly performed.
If SizeOfBuffer is set to MAX_ADDRESS, then SizeOfBuffer must be set to the
maximum size supported by TokenName and NULL must be returned.
@@ -636,18 +645,20 @@ LibPcdSetPtr (
)
{
EFI_STATUS Status;
+ UINTN InputSizeOfBuffer;
ASSERT (SizeOfBuffer != NULL);
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
}
-
- Status = (GetPcdPpiPointer ())->SetPtr (TokenNumber, SizeOfBuffer, (VOID *) Buffer);
- if (EFI_ERROR (Status)) {
+ InputSizeOfBuffer = *SizeOfBuffer;
+ Status = (GetPcdPpiPointer ())->SetPtr (TokenNumber, SizeOfBuffer, (VOID *) Buffer);
+ if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) {
return NULL;
}
+ ASSERT_EFI_ERROR (Status);
return (VOID *) Buffer;
}
@@ -659,7 +670,9 @@ LibPcdSetPtr (
Sets the Boolean value for the token specified by TokenNumber
to the value specified by Value. Value is returned.
-
+
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] TokenNumber The PCD token number to set a current value for.
@param[in] Value The boolean value to set.
@@ -689,9 +702,10 @@ LibPcdSetBool (
Sets the 8-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -726,9 +740,10 @@ LibPcdSetEx8 (
Sets the 16-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -761,9 +776,10 @@ LibPcdSetEx16 (
Sets the 32-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -798,8 +814,10 @@ LibPcdSetEx32 (
Sets the 64-bit value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -835,7 +853,7 @@ LibPcdSetEx64 (
Buffer and SizeOfBuffer. Buffer is returned. If SizeOfBuffer is greater than
the maximum size support by TokenNumber, then set SizeOfBuffer to the maximum size
supported by TokenNumber and return NULL to indicate that the set operation
- was not actually performed.
+ was not actually performed, or ASSERT() if the set operation was not corretly performed.
If Guid is NULL, then ASSERT().
If SizeOfBuffer is NULL, then ASSERT().
@@ -860,17 +878,21 @@ LibPcdSetExPtr (
)
{
EFI_STATUS Status;
+ UINTN InputSizeOfBuffer;
+
+
ASSERT (SizeOfBuffer != NULL);
if (*SizeOfBuffer > 0) {
ASSERT (Buffer != NULL);
}
ASSERT (Guid != NULL);
+ InputSizeOfBuffer = *SizeOfBuffer;
Status = (GetPiPcdPpiPointer ())->SetPtr (Guid, TokenNumber, SizeOfBuffer, Buffer);
-
- if (EFI_ERROR (Status)) {
+ if (EFI_ERROR (Status) && (*SizeOfBuffer < InputSizeOfBuffer)) {
return NULL;
}
+ ASSERT_EFI_ERROR (Status);
return Buffer;
}
@@ -882,9 +904,10 @@ LibPcdSetExPtr (
Sets the Boolean value for the token specified by TokenNumber and
Guid to the value specified by Value. Value is returned.
-
+
If Guid is NULL, then ASSERT().
-
+ If the set operation was not correctly performed, then ASSERT().
+
@param[in] Guid The pointer to a 128-bit unique value that
designates which namespace to set a value from.
@param[in] TokenNumber The PCD token number to set a current value for.
@@ -1010,7 +1033,10 @@ LibPcdGetNextToken (
IN UINTN TokenNumber
)
{
- (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber);
+ EFI_STATUS Status;
+
+ Status = (GetPiPcdPpiPointer ())->GetNextToken (Guid, &TokenNumber);
+ ASSERT (!EFI_ERROR (Status) || TokenNumber == 0);
return TokenNumber;
}
diff --git a/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
index 9b02316af..0c687a526 100644
--- a/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
+++ b/MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointer.c
@@ -4,7 +4,7 @@
This library is used for PEIM which does executed from flash device directly but
executed in memory.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -88,4 +88,28 @@ PeiServicesTablePointerLibConstructor (
return EFI_SUCCESS;
}
+/**
+ Perform CPU specific actions required to migrate the PEI Services Table
+ pointer from temporary RAM to permanent RAM.
+
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
+ a dedicated CPU register. This means that there is no memory storage
+ associated with storing the PEI Services Table pointer, so no additional
+ migration actions are required for Itanium or ARM CPUs.
+**/
+VOID
+EFIAPI
+MigratePeiServicesTablePointer (
+ )
+{
+ //
+ // PEI Services Table pointer is cached in the global variable. No additional
+ // migration actions are required.
+ //
+ return;
+}
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
index 4e3f013ed..1ce3c727e 100644
--- a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointer.c
@@ -4,7 +4,7 @@
According to PI specification, the peiservice pointer is stored prior at IDT
table in IA32 and x64 architecture.
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -21,7 +21,6 @@
#include <Library/PeiServicesTablePointerLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
-#include <Ppi/TemporaryRamSupport.h>
/**
Retrieves the cached value of the PEI Services Table pointer.
@@ -70,42 +69,62 @@ SetPeiServicesTablePointer (
)
{
IA32_DESCRIPTOR Idtr;
- EFI_PHYSICAL_ADDRESS IdtBase;
- EFI_STATUS Status;
- EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI *TemporaryRamSupportPpi;
ASSERT (PeiServicesTablePointer != NULL);
AsmReadIdtr (&Idtr);
- if ((*(UINTN*)(Idtr.Base - sizeof (UINTN))) != (UINTN)PeiServicesTablePointer) {
- (*(UINTN*)(Idtr.Base - sizeof (UINTN))) = (UINTN)PeiServicesTablePointer;
- Status = (*PeiServicesTablePointer)->LocatePpi (
- PeiServicesTablePointer,
- &gEfiTemporaryRamSupportPpiGuid,
- 0,
- NULL,
- (VOID**)&TemporaryRamSupportPpi
- );
-
- if (EFI_ERROR (Status)) {
- //
- // If TemporaryRamSupportPpi is not found, Idt table needs to be migrated into memory.
- //
- Status = (*PeiServicesTablePointer)->AllocatePages (
- PeiServicesTablePointer,
- EfiBootServicesCode,
- EFI_SIZE_TO_PAGES(Idtr.Limit + 1 + sizeof (UINTN)),
- &IdtBase
- );
- if (!EFI_ERROR (Status)) {
- //
- // Migrate Idt table
- //
- CopyMem ((VOID *) (UINTN) IdtBase, (VOID *) (Idtr.Base - sizeof (UINTN)), Idtr.Limit + 1 + sizeof (UINTN));
- Idtr.Base = (UINTN) IdtBase + sizeof (UINTN);
- AsmWriteIdtr (&Idtr);
- }
- }
- }
+ (*(UINTN*)(Idtr.Base - sizeof (UINTN))) = (UINTN)PeiServicesTablePointer;
+}
+
+/**
+ Perform CPU specific actions required to migrate the PEI Services Table
+ pointer from temporary RAM to permanent RAM.
+
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
+ a dedicated CPU register. This means that there is no memory storage
+ associated with storing the PEI Services Table pointer, so no additional
+ migration actions are required for Itanium or ARM CPUs.
+
+ If The cached PEI Services Table pointer is NULL, then ASSERT().
+ If the permanent memory is allocated failed, then ASSERT().
+**/
+VOID
+EFIAPI
+MigratePeiServicesTablePointer (
+ )
+{
+ EFI_STATUS Status;
+ IA32_DESCRIPTOR Idtr;
+ EFI_PHYSICAL_ADDRESS IdtBase;
+ CONST EFI_PEI_SERVICES **PeiServices;
+
+ //
+ // Get PEI Services Table pointer
+ //
+ AsmReadIdtr (&Idtr);
+ PeiServices = (CONST EFI_PEI_SERVICES **) (*(UINTN*)(Idtr.Base - sizeof (UINTN)));
+ ASSERT (PeiServices != NULL);
+ //
+ // Allocate the permanent memory.
+ //
+ Status = (*PeiServices)->AllocatePages (
+ PeiServices,
+ EfiBootServicesCode,
+ EFI_SIZE_TO_PAGES(Idtr.Limit + 1 + sizeof (UINTN)),
+ &IdtBase
+ );
+ ASSERT_EFI_ERROR (Status);
+ //
+ // Idt table needs to be migrated into memory.
+ //
+ CopyMem ((VOID *) (UINTN) IdtBase, (VOID *) (Idtr.Base - sizeof (UINTN)), Idtr.Limit + 1 + sizeof (UINTN));
+ Idtr.Base = (UINTN) IdtBase + sizeof (UINTN);
+ AsmWriteIdtr (&Idtr);
+
+ return;
}
diff --git a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
index 020a7f7e8..7ebe9c81a 100644
--- a/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
+++ b/MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
@@ -4,7 +4,7 @@
# PEI Services Table Pointer Library implementation that retrieves a pointer to the PEI
# Services Table from the IDT on IA-32 and x64.
#
-# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -40,6 +40,3 @@
DebugLib
BaseLib
BaseMemoryLib
-
-[Ppis]
- gEfiTemporaryRamSupportPpiGuid ## SOMETIMES_CONSUMES
diff --git a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
index 4c91a9618..5da6e1d75 100644
--- a/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
+++ b/MdePkg/Library/PeiServicesTablePointerLibKr7/PeiServicesTablePointer.c
@@ -2,7 +2,7 @@
PEI Services Table Pointer Library implementation for IPF that uses Kernel
Register 7 to store the pointer.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -66,6 +66,25 @@ SetPeiServicesTablePointer (
AsmWriteKr7 ((UINT64)(UINTN)PeiServicesTablePointer);
}
+/**
+ Perform CPU specific actions required to migrate the PEI Services Table
+ pointer from temporary RAM to permanent RAM.
+ For IA32 CPUs, the PEI Services Table pointer is stored in the 4 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For X64 CPUs, the PEI Services Table pointer is stored in the 8 bytes
+ immediately preceding the Interrupt Descriptor Table (IDT) in memory.
+ For Itanium and ARM CPUs, a the PEI Services Table Pointer is stored in
+ a dedicated CPU register. This means that there is no memory storage
+ associated with storing the PEI Services Table pointer, so no additional
+ migration actions are required for Itanium or ARM CPUs.
+**/
+VOID
+EFIAPI
+MigratePeiServicesTablePointer (
+ )
+{
+ return;
+}
diff --git a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
index d68c1a1b6..49d7a57a0 100644
--- a/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c
@@ -11,7 +11,7 @@
In addition, allocation for the Reserved memory types are not supported and
will always return NULL.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -285,6 +285,7 @@ FreePages (
If Pages is 0, then NULL is returned. If there is not enough memory at the
specified alignment remaining to satisfy the request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -372,6 +373,7 @@ InternalAllocateAlignedPages (
specified alignment remaining to satisfy the request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
@@ -400,6 +402,7 @@ AllocateAlignedPages (
specified alignment remaining to satisfy the request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
@@ -428,6 +431,7 @@ AllocateAlignedRuntimePages (
specified alignment remaining to satisfy the request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation.
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
index 8943191bd..008ec0b96 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c
@@ -1,7 +1,7 @@
/** @file
DevicePathFromText protocol as defined in the UEFI 2.0 specification.
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -535,6 +535,79 @@ StrToAscii (
}
/**
+ Converts a generic text device path node to device path structure.
+
+ @param Type The type of the device path node.
+ @param TextDeviceNode The input text device path node.
+
+ @return A pointer to device path structure.
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextGenericPath (
+ IN UINT8 Type,
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ EFI_DEVICE_PATH_PROTOCOL *Node;
+ CHAR16 *SubtypeStr;
+ CHAR16 *DataStr;
+ UINTN DataLength;
+
+ SubtypeStr = GetNextParamStr (&TextDeviceNode);
+ DataStr = GetNextParamStr (&TextDeviceNode);
+
+ if (DataStr == NULL) {
+ DataLength = 0;
+ } else {
+ DataLength = StrLen (DataStr) / 2;
+ }
+ Node = CreateDeviceNode (
+ Type,
+ (UINT8) Strtoi (SubtypeStr),
+ (UINT16) (sizeof (EFI_DEVICE_PATH_PROTOCOL) + DataLength)
+ );
+
+ StrToBuf ((UINT8 *) (Node + 1), DataLength, DataStr);
+ return Node;
+}
+
+/**
+ Converts a generic text device path node to device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextPath (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ CHAR16 *TypeStr;
+
+ TypeStr = GetNextParamStr (&TextDeviceNode);
+
+ return DevPathFromTextGenericPath ((UINT8) Strtoi (TypeStr), TextDeviceNode);
+}
+
+/**
+ Converts a generic hardware text device path node to Hardware device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to Hardware device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextHardwarePath (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ return DevPathFromTextGenericPath (HARDWARE_DEVICE_PATH, TextDeviceNode);
+}
+
+/**
Converts a text device path node to Hardware PCI device path structure.
@param TextDeviceNode The input Text device path node.
@@ -719,6 +792,22 @@ DevPathFromTextCtrl (
}
/**
+ Converts a generic ACPI text device path node to ACPI device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to ACPI device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextAcpiPath (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ return DevPathFromTextGenericPath (ACPI_DEVICE_PATH, TextDeviceNode);
+}
+
+/**
Converts a string to EisaId.
@param Text The input string.
@@ -1046,6 +1135,22 @@ DevPathFromTextAcpiAdr (
}
/**
+ Converts a generic messaging text device path node to messaging device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to messaging device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextMsg (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ return DevPathFromTextGenericPath (MESSAGING_DEVICE_PATH, TextDeviceNode);
+}
+
+/**
Converts a text device path node to Parallel Port device path structure.
@param TextDeviceNode The input Text device path node.
@@ -2521,6 +2626,22 @@ DevPathFromTextVlan (
}
/**
+ Converts a media text device path node to media device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to media device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextMediaPath (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ return DevPathFromTextGenericPath (MEDIA_DEVICE_PATH, TextDeviceNode);
+}
+
+/**
Converts a text device path node to HD device path structure.
@param TextDeviceNode The input Text device path node.
@@ -2775,6 +2896,23 @@ DevPathFromTextRelativeOffsetRange (
return (EFI_DEVICE_PATH_PROTOCOL *) Offset;
}
+
+/**
+ Converts a BBS text device path node to BBS device path structure.
+
+ @param TextDeviceNode The input Text device path node.
+
+ @return A pointer to BBS device path structure.
+
+**/
+EFI_DEVICE_PATH_PROTOCOL *
+DevPathFromTextBbsPath (
+ IN CHAR16 *TextDeviceNode
+ )
+{
+ return DevPathFromTextGenericPath (BBS_DEVICE_PATH, TextDeviceNode);
+}
+
/**
Converts a text device path node to BIOS Boot Specification device path structure.
@@ -2862,11 +3000,16 @@ DevPathFromTextSata (
}
GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevPathFromTextTable[] = {
+ {L"Path", DevPathFromTextPath },
+
+ {L"HardwarePath", DevPathFromTextHardwarePath },
{L"Pci", DevPathFromTextPci },
{L"PcCard", DevPathFromTextPcCard },
{L"MemoryMapped", DevPathFromTextMemoryMapped },
{L"VenHw", DevPathFromTextVenHw },
{L"Ctrl", DevPathFromTextCtrl },
+
+ {L"AcpiPath", DevPathFromTextAcpiPath },
{L"Acpi", DevPathFromTextAcpi },
{L"PciRoot", DevPathFromTextPciRoot },
{L"PcieRoot", DevPathFromTextPcieRoot },
@@ -2877,6 +3020,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"AcpiEx", DevPathFromTextAcpiEx },
{L"AcpiExp", DevPathFromTextAcpiExp },
{L"AcpiAdr", DevPathFromTextAcpiAdr },
+
+ {L"Msg", DevPathFromTextMsg },
{L"Ata", DevPathFromTextAta },
{L"Scsi", DevPathFromTextScsi },
{L"Fibre", DevPathFromTextFibre },
@@ -2918,6 +3063,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"Unit", DevPathFromTextUnit },
{L"iSCSI", DevPathFromTextiSCSI },
{L"Vlan", DevPathFromTextVlan },
+
+ {L"MediaPath", DevPathFromTextMediaPath },
{L"HD", DevPathFromTextHD },
{L"CDROM", DevPathFromTextCDROM },
{L"VenMedia", DevPathFromTextVenMedia },
@@ -2925,6 +3072,8 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_TABLE mUefiDevicePathLibDevP
{L"Fv", DevPathFromTextFv },
{L"FvFile", DevPathFromTextFvFile },
{L"Offset", DevPathFromTextRelativeOffsetRange },
+
+ {L"BbsPath", DevPathFromTextBbsPath },
{L"BBS", DevPathFromTextBBS },
{L"Sata", DevPathFromTextSata },
{NULL, NULL}
diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
index eebdbf239..9b1ca8e28 100644
--- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
+++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c
@@ -1,7 +1,7 @@
/** @file
DevicePathToText protocol as defined in the UEFI 2.0 specification.
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1755,6 +1755,15 @@ DevPathToTextEndInstance (
UefiDevicePathLibCatPrint (Str, L",");
}
+GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_GENERIC_TABLE mUefiDevicePathLibToTextTableGeneric[] = {
+ {HARDWARE_DEVICE_PATH, L"HardwarePath" },
+ {ACPI_DEVICE_PATH, L"AcpiPath" },
+ {MESSAGING_DEVICE_PATH, L"Msg" },
+ {MEDIA_DEVICE_PATH, L"MediaPath" },
+ {BBS_DEVICE_PATH, L"BbsPath" },
+ {0, NULL}
+};
+
/**
Converts an unknown device path structure to its string representative.
@@ -1769,17 +1778,48 @@ DevPathToTextEndInstance (
**/
VOID
-DevPathToTextNodeUnknown (
+DevPathToTextNodeGeneric (
IN OUT POOL_PRINT *Str,
IN VOID *DevPath,
IN BOOLEAN DisplayOnly,
IN BOOLEAN AllowShortcuts
)
{
- UefiDevicePathLibCatPrint (Str, L"?");
+ EFI_DEVICE_PATH_PROTOCOL *Node;
+ UINTN Index;
+
+ Node = DevPath;
+
+ for (Index = 0; mUefiDevicePathLibToTextTableGeneric[Index].Text != NULL; Index++) {
+ if (DevicePathType (Node) == mUefiDevicePathLibToTextTableGeneric[Index].Type) {
+ break;
+ }
+ }
+
+ if (mUefiDevicePathLibToTextTableGeneric[Index].Text == NULL) {
+ //
+ // It's a node whose type cannot be recognized
+ //
+ UefiDevicePathLibCatPrint (Str, L"Path(%d,%d", DevicePathType (Node), DevicePathSubType (Node));
+ } else {
+ //
+ // It's a node whose type can be recognized
+ //
+ UefiDevicePathLibCatPrint (Str, L"%s(%d", mUefiDevicePathLibToTextTableGeneric[Index].Text, DevicePathSubType (Node));
+ }
+
+ Index = sizeof (EFI_DEVICE_PATH_PROTOCOL);
+ if (Index < DevicePathNodeLength (Node)) {
+ UefiDevicePathLibCatPrint (Str, L",");
+ for (; Index < DevicePathNodeLength (Node); Index++) {
+ UefiDevicePathLibCatPrint (Str, L"%02x", ((UINT8 *) Node)[Index]);
+ }
+ }
+
+ UefiDevicePathLibCatPrint (Str, L")");
}
-GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLibDevPathToTextTable[] = {
+GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TEXT_TABLE mUefiDevicePathLibToTextTable[] = {
{HARDWARE_DEVICE_PATH, HW_PCI_DP, DevPathToTextPci },
{HARDWARE_DEVICE_PATH, HW_PCCARD_DP, DevPathToTextPccard },
{HARDWARE_DEVICE_PATH, HW_MEMMAP_DP, DevPathToTextMemMap },
@@ -1858,12 +1898,12 @@ UefiDevicePathLibConvertDeviceNodeToText (
// Process the device path node
// If not found, use a generic function
//
- ToText = DevPathToTextNodeUnknown;
- for (Index = 0; mUefiDevicePathLibDevPathToTextTable[Index].Function != NULL; Index++) {
- if (DevicePathType (DeviceNode) == mUefiDevicePathLibDevPathToTextTable[Index].Type &&
- DevicePathSubType (DeviceNode) == mUefiDevicePathLibDevPathToTextTable[Index].SubType
+ ToText = DevPathToTextNodeGeneric;
+ for (Index = 0; mUefiDevicePathLibToTextTable[Index].Function != NULL; Index++) {
+ if (DevicePathType (DeviceNode) == mUefiDevicePathLibToTextTable[Index].Type &&
+ DevicePathSubType (DeviceNode) == mUefiDevicePathLibToTextTable[Index].SubType
) {
- ToText = mUefiDevicePathLibDevPathToTextTable[Index].Function;
+ ToText = mUefiDevicePathLibToTextTable[Index].Function;
break;
}
}
@@ -1921,13 +1961,13 @@ UefiDevicePathLibConvertDevicePathToText (
// Find the handler to dump this device path node
// If not found, use a generic function
//
- ToText = DevPathToTextNodeUnknown;
- for (Index = 0; mUefiDevicePathLibDevPathToTextTable[Index].Function != NULL; Index += 1) {
+ ToText = DevPathToTextNodeGeneric;
+ for (Index = 0; mUefiDevicePathLibToTextTable[Index].Function != NULL; Index += 1) {
- if (DevicePathType (Node) == mUefiDevicePathLibDevPathToTextTable[Index].Type &&
- DevicePathSubType (Node) == mUefiDevicePathLibDevPathToTextTable[Index].SubType
+ if (DevicePathType (Node) == mUefiDevicePathLibToTextTable[Index].Type &&
+ DevicePathSubType (Node) == mUefiDevicePathLibToTextTable[Index].SubType
) {
- ToText = mUefiDevicePathLibDevPathToTextTable[Index].Function;
+ ToText = mUefiDevicePathLibToTextTable[Index].Function;
break;
}
}
diff --git a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h
index a7ed53189..233844cfc 100644
--- a/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h
+++ b/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.h
@@ -1,7 +1,7 @@
/** @file
Definition for Device Path library.
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -69,6 +69,11 @@ typedef struct {
} DEVICE_PATH_TO_TEXT_TABLE;
typedef struct {
+ UINT8 Type;
+ CHAR16 *Text;
+} DEVICE_PATH_TO_TEXT_GENERIC_TABLE;
+
+typedef struct {
CHAR16 *DevicePathNodeText;
DEVICE_PATH_FROM_TEXT Function;
} DEVICE_PATH_FROM_TEXT_TABLE;
diff --git a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
index 0ccb52449..f1eaccc8d 100644
--- a/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
+++ b/MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c
@@ -2,7 +2,7 @@
Support routines for memory allocation routines based
on boot services for Dxe phase drivers.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -160,6 +160,7 @@ FreePages (
If there is not enough memory at the specified alignment remaining to satisfy the request, then
NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param MemoryType The type of memory to allocate.
@param Pages The number of 4 KB pages to allocate.
@@ -246,6 +247,7 @@ InternalAllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -273,6 +275,7 @@ AllocateAlignedPages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
@@ -300,6 +303,7 @@ AllocateAlignedRuntimePages (
request, then NULL is returned.
If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+ If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT().
@param Pages The number of 4 KB pages to allocate.
@param Alignment The requested alignment of the allocation. Must be a power of two.
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 9b37abdc9..affff516e 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -3,9 +3,9 @@
# This Package provides all definitions(including functions, MACROs, structures and library classes)
# and libraries instances, which are defined in MDE Specification.
# It also provides the definitions(including PPIs/PROTOCOLs/GUIDs) of
-# EFI1.10/UEFI2.3.1/PI1.2 and some Industry Standards.
+# EFI1.10/UEFI2.4/PI1.3 and some Industry Standards.
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available under
@@ -23,7 +23,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = MdePkg
PACKAGE_GUID = 1E73767F-8F52-4603-AEB4-F29B510B6766
- PACKAGE_VERSION = 1.03
+ PACKAGE_VERSION = 1.04
[Includes]
@@ -528,6 +528,11 @@
gEfiRngAlgorithmX931AesGuid = { 0xacd03321, 0x777e, 0x4d3d, {0xb1, 0xc8, 0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9 }}
gEfiRngAlgorithmRaw = { 0xe43176d7, 0xb6e8, 0x4827, {0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 }}
+ ## Include/Protocol/AdapterInformation.h
+ gEfiAdapterInfoMediaStateGuid = { 0xD7C74207, 0xA831, 0x4A26, {0xB1, 0xF5, 0xD1, 0x93, 0x06, 0x5C, 0xE8, 0xB6 }}
+ gEfiAdapterInfoNetworkBootGuid = { 0x1FBD2960, 0x4130, 0x41E5, {0x94, 0xAC, 0xD2, 0xCF, 0x03, 0x7F, 0xB3, 0x7C }}
+ gEfiAdapterInfoSanMacAddressGuid = { 0x114da5ef, 0x2cf1, 0x4e12, {0x9b, 0xbb, 0xc4, 0x70, 0xb5, 0x52, 0x5, 0xd9 }}
+
#
# GUID defined in PI1.0
#
@@ -1353,6 +1358,9 @@
## Include/Protocol/Rng.h
gEfiRngProtocolGuid = { 0x3152bca5, 0xeade, 0x433d, {0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44 }}
+
+ ## Include/Protocol/AdapterInformation.h
+ gEfiAdapterInformationProtocolGuid = { 0xE5DD1403, 0xD622, 0xC24E, {0x84, 0x88, 0xC7, 0x1B, 0x17, 0xF5, 0xE8, 0x02 }}
[PcdsFeatureFlag]
## If TRUE, the component name protocol will not be installed.
diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc
index 389c4eb05..092483565 100644
--- a/MdePkg/MdePkg.dsc
+++ b/MdePkg/MdePkg.dsc
@@ -1,7 +1,7 @@
## @file
# EFI/PI MdePkg Package
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
# Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
#
# This program and the accompanying materials
@@ -17,7 +17,7 @@
[Defines]
PLATFORM_NAME = Mde
PLATFORM_GUID = 082F8BFC-0455-4859-AE3C-ECD64FB81642
- PLATFORM_VERSION = 1.03
+ PLATFORM_VERSION = 1.04
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/Mde
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM|AARCH64
diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c
index 6d6f9a13e..42ac8f0fe 100644
--- a/NetworkPkg/IScsiDxe/IScsiDriver.c
+++ b/NetworkPkg/IScsiDxe/IScsiDriver.c
@@ -1,7 +1,7 @@
/** @file
The entry point of IScsi driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1245,10 +1245,12 @@ IScsiUnload (
IN EFI_HANDLE ImageHandle
)
{
- EFI_STATUS Status;
- UINTN DeviceHandleCount;
- EFI_HANDLE *DeviceHandleBuffer;
- UINTN Index;
+ EFI_STATUS Status;
+ UINTN DeviceHandleCount;
+ EFI_HANDLE *DeviceHandleBuffer;
+ UINTN Index;
+ EFI_COMPONENT_NAME_PROTOCOL *ComponentName;
+ EFI_COMPONENT_NAME2_PROTOCOL *ComponentName2;
//
// Try to disonnect the driver from the devices it's controlling.
@@ -1264,64 +1266,184 @@ IScsiUnload (
return Status;
}
+ //
+ // Disconnect the iSCSI4 driver from the controlled device.
+ //
+ for (Index = 0; Index < DeviceHandleCount; Index++) {
+ Status = IScsiTestManagedDevice (
+ DeviceHandleBuffer[Index],
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiTcp4ProtocolGuid)
+ ;
+ if (EFI_ERROR (Status)) {
+ continue;
+ }
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ //
+ // Disconnect the iSCSI6 driver from the controlled device.
+ //
for (Index = 0; Index < DeviceHandleCount; Index++) {
- gBS->DisconnectController (
- DeviceHandleBuffer[Index],
+ Status = IScsiTestManagedDevice (
+ DeviceHandleBuffer[Index],
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiTcp6ProtocolGuid
+ );
+ if (EFI_ERROR (Status)) {
+ continue;
+ }
+ Status = gBS->DisconnectController (
+ DeviceHandleBuffer[Index],
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ //
+ // Unload the iSCSI configuration form.
+ //
+ Status = IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+
+ //
+ // Uninstall the protocols installed by iSCSI driver.
+ //
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ ImageHandle,
+ &gEfiAuthenticationInfoProtocolGuid,
+ &gIScsiAuthenticationInfo,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+
+ if (gIScsiControllerNameTable!= NULL) {
+ Status = FreeUnicodeStringTable (gIScsiControllerNameTable);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ gIScsiControllerNameTable = NULL;
+ }
+
+ //
+ // Uninstall the ComponentName and ComponentName2 protocol from iSCSI4 driver binding handle
+ // if it has been installed.
+ //
+ Status = gBS->HandleProtocol (
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName,
NULL
);
- gBS->DisconnectController (
- DeviceHandleBuffer[Index],
- gIScsiIp6DriverBinding.DriverBindingHandle,
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ Status = gBS->HandleProtocol (
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2,
NULL
);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
}
//
- // Unload the iSCSI configuration form.
+ // Uninstall the ComponentName and ComponentName2 protocol from iSCSI6 driver binding handle
+ // if it has been installed.
//
- IScsiConfigFormUnload (gIScsiIp4DriverBinding.DriverBindingHandle);
+ Status = gBS->HandleProtocol (
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ (VOID **) &ComponentName
+ );
+ if (!EFI_ERROR (Status)) {
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiComponentNameProtocolGuid,
+ ComponentName,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
+
+ Status = gBS->HandleProtocol (
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ (VOID **) &ComponentName2
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiComponentName2ProtocolGuid,
+ ComponentName2,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
+ }
//
- // Uninstall the protocols installed by iSCSI driver.
+ // Uninstall the IScsiInitiatorNameProtocol and all the driver binding protocols.
//
- gBS->UninstallMultipleProtocolInterfaces (
- ImageHandle,
- &gEfiAuthenticationInfoProtocolGuid,
- &gIScsiAuthenticationInfo,
- NULL
- );
-
- if (gIScsiControllerNameTable!= NULL) {
- FreeUnicodeStringTable (gIScsiControllerNameTable);
- gIScsiControllerNameTable = NULL;
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiIp4DriverBinding.DriverBindingHandle,
+ &gEfiDriverBindingProtocolGuid,
+ &gIScsiIp4DriverBinding,
+ &gEfiIScsiInitiatorNameProtocolGuid,
+ &gIScsiInitiatorName,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
}
-
- gBS->UninstallMultipleProtocolInterfaces (
- gIScsiIp4DriverBinding.DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid,
- &gIScsiIp4DriverBinding,
- &gEfiComponentName2ProtocolGuid,
- &gIScsiComponentName2,
- &gEfiComponentNameProtocolGuid,
- &gIScsiComponentName,
- &gEfiIScsiInitiatorNameProtocolGuid,
- &gIScsiInitiatorName,
- NULL
- );
- gBS->UninstallMultipleProtocolInterfaces (
- gIScsiIp6DriverBinding.DriverBindingHandle,
- &gEfiDriverBindingProtocolGuid,
- &gIScsiIp6DriverBinding,
- &gEfiComponentName2ProtocolGuid,
- &gIScsiComponentName2,
- &gEfiComponentNameProtocolGuid,
- &gIScsiComponentName,
- NULL
- );
+ Status = gBS->UninstallMultipleProtocolInterfaces (
+ gIScsiIp6DriverBinding.DriverBindingHandle,
+ &gEfiDriverBindingProtocolGuid,
+ &gIScsiIp6DriverBinding,
+ NULL
+ );
- return EFI_SUCCESS;
+ON_EXIT:
+
+ if (DeviceHandleBuffer != NULL) {
+ FreePool (DeviceHandleBuffer);
+ }
+
+ return Status;
}
/**
diff --git a/NetworkPkg/IScsiDxe/IScsiIbft.c b/NetworkPkg/IScsiDxe/IScsiIbft.c
index 9dba4e6f3..3c179bfc5 100644
--- a/NetworkPkg/IScsiDxe/IScsiIbft.c
+++ b/NetworkPkg/IScsiDxe/IScsiIbft.c
@@ -1,7 +1,7 @@
/** @file
Implementation for iSCSI Boot Firmware Table publication.
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -359,9 +359,13 @@ IScsiFillNICAndTargetSections (
Target->Port = NvData->TargetPort;
if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_CHAP) {
- Target->CHAPType = AuthConfig->CHAPType;
+ if (AuthConfig->CHAPType == ISCSI_CHAP_UNI) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_CHAP;
+ } else if (AuthConfig->CHAPType == ISCSI_CHAP_MUTUAL) {
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP;
+ }
} else if (Attempt->AuthenticationType == ISCSI_AUTH_TYPE_NONE) {
- Target->CHAPType = ISCSI_AUTH_TYPE_NONE;
+ Target->CHAPType = EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_NO_CHAP;
}
Target->NicIndex = (UINT8) Index;
@@ -402,7 +406,7 @@ IScsiFillNICAndTargetSections (
Target->CHAPSecretLength = Length;
Target->CHAPSecretOffset = (UINT16) ((UINTN) *Heap - (UINTN) Table);
- if (Target->CHAPType == ISCSI_CHAP_MUTUAL) {
+ if (Target->CHAPType == EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_TARGET_STRUCTURE_CHAP_TYPE_MUTUAL_CHAP) {
//
// Reverse CHAP Name.
//
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index 6ed497454..444d6f062 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -1,7 +1,7 @@
/** @file
Miscellaneous routines for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1436,3 +1436,70 @@ IScsiOnExitBootService (
IScsiSessionAbort (Private->Session);
}
}
+
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ )
+{
+ EFI_STATUS Status;
+ VOID *ManagedInterface;
+ EFI_HANDLE NicControllerHandle;
+
+ ASSERT (ProtocolGuid != NULL);
+
+ NicControllerHandle = NetLibGetNicHandle (ControllerHandle, ProtocolGuid);
+ if (NicControllerHandle == NULL) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ &ManagedInterface,
+ DriverBindingHandle,
+ NicControllerHandle,
+ EFI_OPEN_PROTOCOL_BY_DRIVER
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->CloseProtocol (
+ ControllerHandle,
+ (EFI_GUID *) ProtocolGuid,
+ DriverBindingHandle,
+ NicControllerHandle
+ );
+ return EFI_UNSUPPORTED;
+ }
+
+ if (Status != EFI_ALREADY_STARTED) {
+ return EFI_UNSUPPORTED;
+ }
+
+ return EFI_SUCCESS;
+}
diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.h b/NetworkPkg/IScsiDxe/IScsiMisc.h
index e2a27806a..fd9e3af76 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.h
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.h
@@ -1,7 +1,7 @@
/** @file
Miscellaneous definitions for iSCSI driver.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -357,4 +357,34 @@ IScsiOnExitBootService (
IN VOID *Context
);
+/**
+ Tests whether a controller handle is being managed by IScsi driver.
+
+ This function tests whether the driver specified by DriverBindingHandle is
+ currently managing the controller specified by ControllerHandle. This test
+ is performed by evaluating if the the protocol specified by ProtocolGuid is
+ present on ControllerHandle and is was opened by DriverBindingHandle and Nic
+ Device handle with an attribute of EFI_OPEN_PROTOCOL_BY_DRIVER.
+ If ProtocolGuid is NULL, then ASSERT().
+
+ @param ControllerHandle A handle for a controller to test.
+ @param DriverBindingHandle Specifies the driver binding handle for the
+ driver.
+ @param ProtocolGuid Specifies the protocol that the driver specified
+ by DriverBindingHandle opens in its Start()
+ function.
+
+ @retval EFI_SUCCESS ControllerHandle is managed by the driver
+ specified by DriverBindingHandle.
+ @retval EFI_UNSUPPORTED ControllerHandle is not managed by the driver
+ specified by DriverBindingHandle.
+
+**/
+EFI_STATUS
+EFIAPI
+IScsiTestManagedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverBindingHandle,
+ IN EFI_GUID *ProtocolGuid
+ );
#endif
diff --git a/NetworkPkg/IpSecDxe/Ikev2/Exchange.c b/NetworkPkg/IpSecDxe/Ikev2/Exchange.c
index ffa53824d..7634d11a2 100644
--- a/NetworkPkg/IpSecDxe/Ikev2/Exchange.c
+++ b/NetworkPkg/IpSecDxe/Ikev2/Exchange.c
@@ -1,7 +1,7 @@
/** @file
The general interfaces of the IKEv2.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -467,8 +467,7 @@ Ikev2HandleSa (
//
// Validate the IKE packet header.
//
- Status = Ikev2ValidateHeader (IkeSaSession, IkePacket->Header);
- if (EFI_ERROR (Status)) {
+ if (!Ikev2ValidateHeader (IkeSaSession, IkePacket->Header)) {
//
// Drop the packet if invalid IKE header.
//
diff --git a/NetworkPkg/NetworkPkg.dec b/NetworkPkg/NetworkPkg.dec
index 5d2979d47..6b467ddef 100644
--- a/NetworkPkg/NetworkPkg.dec
+++ b/NetworkPkg/NetworkPkg.dec
@@ -1,8 +1,8 @@
## @file
#
-# This package provides network modules that conform to UEFI 2.2 specification.
+# This package provides network modules that conform to UEFI 2.4 specification.
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License which accompanies this distribution.
@@ -18,7 +18,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = NetworkPkg
PACKAGE_GUID = 947988BE-8D5C-471a-893D-AD181C46BEBB
- PACKAGE_VERSION = 0.93
+ PACKAGE_VERSION = 0.94
[Includes]
Include
diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc
index b5848b7e9..7df49ec14 100644
--- a/NetworkPkg/NetworkPkg.dsc
+++ b/NetworkPkg/NetworkPkg.dsc
@@ -1,7 +1,7 @@
## @file
-# UEFI 2.2 Network Module Package for All Architectures
+# UEFI 2.4 Network Module Package for All Architectures
#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,7 +16,7 @@
[Defines]
PLATFORM_NAME = NetworkPkg
PLATFORM_GUID = 3FD34E9B-E90C-44e1-B510-1F632A509F10
- PLATFORM_VERSION = 0.93
+ PLATFORM_VERSION = 0.94
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/NetworkPkg
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC|ARM
diff --git a/NetworkPkg/TcpDxe/ComponentName.c b/NetworkPkg/TcpDxe/ComponentName.c
index 9b4dada6a..ecfda7a8c 100644
--- a/NetworkPkg/TcpDxe/ComponentName.c
+++ b/NetworkPkg/TcpDxe/ComponentName.c
@@ -2,7 +2,7 @@
Implementation of protocols EFI_COMPONENT_NAME_PROTOCOL and
EFI_COMPONENT_NAME2_PROTOCOL.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -256,7 +256,7 @@ UpdateTcp4Name (
Status = Tcp4->GetModeData (Tcp4, NULL, &Tcp4ConfigData, NULL, NULL, NULL);
if (!EFI_ERROR (Status)) {
UnicodeSPrint (HandleName, sizeof (HandleName),
- L"TCPv4 (SrcPort=%d, DestPort=&d, ActiveFlag=%s)",
+ L"TCPv4 (SrcPort=%d, DestPort=%d, ActiveFlag=%s)",
Tcp4ConfigData.AccessPoint.StationPort,
Tcp4ConfigData.AccessPoint.RemotePort,
(Tcp4ConfigData.AccessPoint.ActiveFlag ? L"TRUE" : L"FALSE")
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
index 5bbefcee9..84031e40e 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcBoot.c
@@ -1,7 +1,7 @@
/** @file
Boot functions implementation for UefiPxeBc Driver.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -468,7 +468,9 @@ PxeBcDhcp4BootInfo (
EFI_STATUS Status;
PXEBC_DHCP4_PACKET_CACHE *Cache4;
UINT16 Value;
-
+ PXEBC_VENDOR_OPTION *VendorOpt;
+ PXEBC_BOOT_SVR_ENTRY *Entry;
+
PxeBc = &Private->PxeBc;
Mode = PxeBc->Mode;
Status = EFI_SUCCESS;
@@ -485,17 +487,40 @@ PxeBcDhcp4BootInfo (
Cache4 = &Private->DhcpAck.Dhcp4;
}
+ ASSERT (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL);
+
//
- // Parse the boot server Ipv4 address by next server address.
- // If this field isn't available, use option 54 instead.
+ // Parse the boot server address.
+ // If prompt/discover is disabled, get the first boot server from the boot servers list.
+ // Otherwise, parse the boot server Ipv4 address from next server address field in DHCP header.
+ // If all these fields are not available, use option 54 instead.
//
- CopyMem (
- &Private->ServerIp,
- &Cache4->Packet.Offer.Dhcp4.Header.ServerAddr,
- sizeof (EFI_IPv4_ADDRESS)
- );
-
+ VendorOpt = &Cache4->VendorOpt;
+ if (IS_DISABLE_PROMPT_MENU (VendorOpt->DiscoverCtrl) && IS_VALID_BOOT_SERVERS (VendorOpt->BitMap)) {
+ Entry = VendorOpt->BootSvr;
+ if (VendorOpt->BootSvrLen >= sizeof (PXEBC_BOOT_SVR_ENTRY) && Entry->IpCnt > 0) {
+ CopyMem (
+ &Private->ServerIp,
+ &Entry->IpAddr[0],
+ sizeof (EFI_IPv4_ADDRESS)
+ );
+ }
+ }
+ if (Private->ServerIp.Addr[0] == 0) {
+ //
+ // ServerIp.Addr[0] equals zero means we failed to get IP address from boot server list.
+ // Try to use next server address field.
+ //
+ CopyMem (
+ &Private->ServerIp,
+ &Cache4->Packet.Offer.Dhcp4.Header.ServerAddr,
+ sizeof (EFI_IPv4_ADDRESS)
+ );
+ }
if (Private->ServerIp.Addr[0] == 0) {
+ //
+ // Still failed , use the IP address from option 54.
+ //
CopyMem (
&Private->ServerIp,
Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_SERVER_ID]->Data,
@@ -506,7 +531,6 @@ PxeBcDhcp4BootInfo (
//
// Parse the boot file name by option.
//
- ASSERT (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL);
Private->BootFileName = Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data;
if (Cache4->OptList[PXEBC_DHCP4_TAG_INDEX_BOOTFILE_LEN] != NULL) {
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index 23682b245..40e1fe021 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1,7 +1,7 @@
/** @file
Functions implementation related with DHCPv4 for UefiPxeBc Driver.
- Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -472,6 +472,7 @@ PxeBcParseDhcp4Packet (
//
// Parse DHCPv4 options in this offer, and store the pointers.
+ // First, try to parse DHCPv4 options from the DHCP optional parameters field.
//
for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
Options[Index] = PxeBcParseDhcp4Options (
@@ -480,6 +481,35 @@ PxeBcParseDhcp4Packet (
mInterestedDhcp4Tags[Index]
);
}
+ //
+ // Second, Check if bootfilename and serverhostname is overloaded to carry DHCP options refers to rfc-2132.
+ // If yes, try to parse options from the BootFileName field, then ServerName field.
+ //
+ Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
+ if (Option != NULL) {
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseDhcp4Options (
+ (UINT8 *) Offer->Dhcp4.Header.BootFileName,
+ sizeof (Offer->Dhcp4.Header.BootFileName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
+ if ((Option->Data[0] & PXEBC_DHCP4_OVERLOAD_SERVER_NAME) != 0) {
+ for (Index = 0; Index < PXEBC_DHCP4_TAG_INDEX_MAX; Index++) {
+ if (Options[Index] == NULL) {
+ Options[Index] = PxeBcParseDhcp4Options (
+ (UINT8 *) Offer->Dhcp4.Header.ServerName,
+ sizeof (Offer->Dhcp4.Header.ServerName),
+ mInterestedDhcp4Tags[Index]
+ );
+ }
+ }
+ }
+ }
//
// The offer with "yiaddr" is a proxy offer.
@@ -506,30 +536,21 @@ PxeBcParseDhcp4Packet (
}
//
- // Check whether bootfilename and serverhostname overloaded, refers to rfc-2132 in details.
- // If overloaded, parse the buffer as nested DHCPv4 options, or else just parse as bootfilename
- // and serverhostname option.
+ // Parse PXE boot file name:
+ // According to PXE spec, boot file name should be read from DHCP option 67 (bootfile name) if present.
+ // Otherwise, read from boot file field in DHCP header.
//
- Option = Options[PXEBC_DHCP4_TAG_INDEX_OVERLOAD];
- if (Option != NULL && (Option->Data[0] & PXEBC_DHCP4_OVERLOAD_FILE) != 0) {
-
- Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] = PxeBcParseDhcp4Options (
- (UINT8 *) Offer->Dhcp4.Header.BootFileName,
- sizeof (Offer->Dhcp4.Header.BootFileName),
- PXEBC_DHCP4_TAG_BOOTFILE
- );
+ if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
//
// RFC 2132, Section 9.5 does not strictly state Bootfile name (option 67) is null
// terminated string. So force to append null terminated character at the end of string.
//
- if (Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] != NULL) {
- Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
- Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
- *Ptr8 = '\0';
+ Ptr8 = (UINT8*)&Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Data[0];
+ Ptr8 += Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE]->Length;
+ if (*(Ptr8 - 1) != '\0') {
+ *Ptr8 = '\0';
}
-
- } else if ((Options[PXEBC_DHCP4_TAG_INDEX_BOOTFILE] == NULL) &&
- (Offer->Dhcp4.Header.BootFileName[0] != 0)) {
+ } else if (Offer->Dhcp4.Header.BootFileName[0] != 0) {
//
// If the bootfile is not present and bootfilename is present in DHCPv4 packet, just parse it.
// Do not count dhcp option header here, or else will destroy the serverhostname.
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
index 15cda8cf6..d1187d742 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcImpl.c
@@ -1,7 +1,7 @@
/** @file
This implementation of EFI_PXE_BASE_CODE_PROTOCOL and EFI_LOAD_FILE_PROTOCOL.
- Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -345,6 +345,10 @@ EfiPxeBcStop (
Private->BootFileSize = 0;
Private->SolicitTimes = 0;
Private->ElapsedTime = 0;
+ ZeroMem (&Private->StationIp, sizeof (EFI_IP_ADDRESS));
+ ZeroMem (&Private->SubnetMask, sizeof (EFI_IP_ADDRESS));
+ ZeroMem (&Private->GatewayIp, sizeof (EFI_IP_ADDRESS));
+ ZeroMem (&Private->ServerIp, sizeof (EFI_IP_ADDRESS));
//
// Reset the mode data.
diff --git a/OvmfPkg/Include/IndustryStandard/E820.h b/OvmfPkg/Include/IndustryStandard/E820.h
new file mode 100644
index 000000000..aeafd89f2
--- /dev/null
+++ b/OvmfPkg/Include/IndustryStandard/E820.h
@@ -0,0 +1,46 @@
+/** @file
+
+Copyright (c) 2013, Citrix Systems UK Ltd.
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+
+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 __E820_H__
+#define __E820_H__
+
+#pragma pack(1)
+
+typedef enum {
+ EfiAcpiAddressRangeMemory = 1,
+ EfiAcpiAddressRangeReserved = 2,
+ EfiAcpiAddressRangeACPI = 3,
+ EfiAcpiAddressRangeNVS = 4
+} EFI_ACPI_MEMORY_TYPE;
+
+typedef struct {
+ UINT64 BaseAddr;
+ UINT64 Length;
+ EFI_ACPI_MEMORY_TYPE Type;
+} EFI_E820_ENTRY64;
+
+typedef struct {
+ UINT32 BassAddrLow;
+ UINT32 BaseAddrHigh;
+ UINT32 LengthLow;
+ UINT32 LengthHigh;
+ EFI_ACPI_MEMORY_TYPE Type;
+} EFI_E820_ENTRY;
+
+#pragma pack()
+
+#endif /* __E820_H__ */
diff --git a/OvmfPkg/Include/IndustryStandard/VirtioBlk.h b/OvmfPkg/Include/IndustryStandard/VirtioBlk.h
index 55f6548ed..2ce528a12 100644
--- a/OvmfPkg/Include/IndustryStandard/VirtioBlk.h
+++ b/OvmfPkg/Include/IndustryStandard/VirtioBlk.h
@@ -26,30 +26,40 @@
//
#pragma pack(1)
typedef struct {
- UINT64 Capacity;
- UINT32 SizeMax;
- UINT32 SegMax;
- UINT16 Cylinders;
- UINT8 Heads;
- UINT8 Sectors;
- UINT32 BlkSize;
-} VIRTIO_BLK_CONFIG;
+ UINT8 PhysicalBlockExp; // # of logical blocks per physical block (log2)
+ UINT8 AlignmentOffset; // offset of first aligned logical block
+ UINT16 MinIoSize; // suggested minimum I/O size in blocks
+ UINT32 OptIoSize; // optimal (suggested maximum) I/O size in blocks
+} VIRTIO_BLK_TOPOLOGY;
+
+typedef struct {
+ UINT64 Capacity;
+ UINT32 SizeMax;
+ UINT32 SegMax;
+ UINT16 Cylinders;
+ UINT8 Heads;
+ UINT8 Sectors;
+ UINT32 BlkSize;
+ VIRTIO_BLK_TOPOLOGY Topology;
+} VIRTIO_BLK_CONFIG;
#pragma pack()
-#define OFFSET_OF_VBLK(Field) OFFSET_OF (VIRTIO_BLK_CONFIG, Field)
-#define SIZE_OF_VBLK(Field) (sizeof ((VIRTIO_BLK_CONFIG *) 0)->Field)
+#define OFFSET_OF_VBLK(Field) OFFSET_OF (VIRTIO_BLK_CONFIG, Field)
+#define SIZE_OF_VBLK(Field) (sizeof ((VIRTIO_BLK_CONFIG *) 0)->Field)
#define VIRTIO_BLK_F_BARRIER BIT0
#define VIRTIO_BLK_F_SIZE_MAX BIT1
#define VIRTIO_BLK_F_SEG_MAX BIT2
#define VIRTIO_BLK_F_GEOMETRY BIT4
#define VIRTIO_BLK_F_RO BIT5
-#define VIRTIO_BLK_F_BLK_SIZE BIT6 // treated as "logical block size" in
- // practice; actual host side implementation
- // negotiates "optimal" block size
- // separately
+#define VIRTIO_BLK_F_BLK_SIZE BIT6 // treated as "logical block size" in
+ // practice; actual host side
+ // implementation negotiates "optimal"
+ // block size separately, via
+ // VIRTIO_BLK_F_TOPOLOGY
#define VIRTIO_BLK_F_SCSI BIT7
-#define VIRTIO_BLK_F_FLUSH BIT9 // identical to "write cache enabled"
+#define VIRTIO_BLK_F_FLUSH BIT9 // identical to "write cache enabled"
+#define VIRTIO_BLK_F_TOPOLOGY BIT10 // information on optimal I/O alignment
//
// We keep the status byte separate from the rest of the virtio-blk request
diff --git a/OvmfPkg/Include/IndustryStandard/VirtioNet.h b/OvmfPkg/Include/IndustryStandard/VirtioNet.h
index 90d9702cb..34bf15a58 100644
--- a/OvmfPkg/Include/IndustryStandard/VirtioNet.h
+++ b/OvmfPkg/Include/IndustryStandard/VirtioNet.h
@@ -24,13 +24,13 @@
//
#pragma pack(1)
typedef struct {
- UINT8 Mac[6];
- UINT16 LinkStatus;
-} VIRTIO_NET_CONFIG;
+ UINT8 Mac[6];
+ UINT16 LinkStatus;
+} VIRTIO_NET_CONFIG;
#pragma pack()
-#define OFFSET_OF_VNET(Field) OFFSET_OF (VIRTIO_NET_CONFIG, Field)
-#define SIZE_OF_VNET(Field) (sizeof ((VIRTIO_NET_CONFIG *) 0)->Field)
+#define OFFSET_OF_VNET(Field) OFFSET_OF (VIRTIO_NET_CONFIG, Field)
+#define SIZE_OF_VNET(Field) (sizeof ((VIRTIO_NET_CONFIG *) 0)->Field)
//
// Queue Identifiers
@@ -89,7 +89,7 @@ typedef struct {
#define VIRTIO_NET_HDR_GSO_ECN BIT7
//
-// Link Status Bits in VIRTIO_NET_CONFIG.LinkStatus
+// Link Status Bits in VIRTIO_NET_CONFIG.LinkStatus
//
#define VIRTIO_NET_S_LINK_UP BIT0
#define VIRTIO_NET_S_ANNOUNCE BIT1
diff --git a/OvmfPkg/Include/IndustryStandard/VirtioScsi.h b/OvmfPkg/Include/IndustryStandard/VirtioScsi.h
index 884e4d642..0c9b52090 100644
--- a/OvmfPkg/Include/IndustryStandard/VirtioScsi.h
+++ b/OvmfPkg/Include/IndustryStandard/VirtioScsi.h
@@ -26,21 +26,21 @@
//
#pragma pack(1)
typedef struct {
- UINT32 NumQueues;
- UINT32 SegMax;
- UINT32 MaxSectors;
- UINT32 CmdPerLun;
- UINT32 EventInfoSize;
- UINT32 SenseSize;
- UINT32 CdbSize;
- UINT16 MaxChannel;
- UINT16 MaxTarget;
- UINT32 MaxLun;
-} VIRTIO_SCSI_CONFIG;
+ UINT32 NumQueues;
+ UINT32 SegMax;
+ UINT32 MaxSectors;
+ UINT32 CmdPerLun;
+ UINT32 EventInfoSize;
+ UINT32 SenseSize;
+ UINT32 CdbSize;
+ UINT16 MaxChannel;
+ UINT16 MaxTarget;
+ UINT32 MaxLun;
+} VIRTIO_SCSI_CONFIG;
#pragma pack()
-#define OFFSET_OF_VSCSI(Field) OFFSET_OF (VIRTIO_SCSI_CONFIG, Field)
-#define SIZE_OF_VSCSI(Field) (sizeof ((VIRTIO_SCSI_CONFIG *) 0)->Field)
+#define OFFSET_OF_VSCSI(Field) OFFSET_OF (VIRTIO_SCSI_CONFIG, Field)
+#define SIZE_OF_VSCSI(Field) (sizeof ((VIRTIO_SCSI_CONFIG *) 0)->Field)
#define VIRTIO_SCSI_F_INOUT BIT0
#define VIRTIO_SCSI_F_HOTPLUG BIT1
diff --git a/OvmfPkg/Include/Library/QemuFwCfgLib.h b/OvmfPkg/Include/Library/QemuFwCfgLib.h
index 9d023777c..2519fc297 100644
--- a/OvmfPkg/Include/Library/QemuFwCfgLib.h
+++ b/OvmfPkg/Include/Library/QemuFwCfgLib.h
@@ -2,6 +2,8 @@
QEMU/KVM Firmware Configuration access
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2013, Red Hat, Inc.
+
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
@@ -56,6 +58,8 @@ typedef enum {
Returns a boolean indicating if the firmware configuration interface
is available or not.
+ This function may change fw_cfg state.
+
@retval TRUE The interface is available
@retval FALSE The interface is not available
@@ -193,5 +197,22 @@ QemuFwCfgFindFile (
OUT FIRMWARE_CONFIG_ITEM *Item,
OUT UINTN *Size
);
+
+
+/**
+ Returns a boolean indicating if the firmware configuration interface is
+ available for library-internal purposes.
+
+ This function never changes fw_cfg state.
+
+ @retval TRUE The interface is available internally.
+ @retval FALSE The interface is not available internally.
+**/
+BOOLEAN
+EFIAPI
+InternalQemuFwCfgIsAvailable (
+ VOID
+ );
+
#endif
diff --git a/OvmfPkg/Include/Library/VirtioLib.h b/OvmfPkg/Include/Library/VirtioLib.h
index e61a5090e..36527a523 100644
--- a/OvmfPkg/Include/Library/VirtioLib.h
+++ b/OvmfPkg/Include/Library/VirtioLib.h
@@ -17,8 +17,8 @@
#ifndef _VIRTIO_LIB_H_
#define _VIRTIO_LIB_H_
-#include <Protocol/VirtioDevice.h>
-
+#include <Protocol/VirtioDevice.h>
+
#include <IndustryStandard/Virtio.h>
@@ -157,7 +157,7 @@ VirtioAppendDesc (
Notify the host about the descriptor chain just built, and wait until the
host processes it.
- @param[in] VirtIo The target virtio device to notify.
+ @param[in] VirtIo The target virtio device to notify.
@param[in] VirtQueueId Identifies the queue for the target device.
@@ -168,7 +168,7 @@ VirtioAppendDesc (
of the descriptor chain.
- @return Error code from VirtioWriteDevice() if it fails.
+ @return Error code from VirtIo->SetQueueNotify() if it fails.
@retval EFI_SUCCESS Otherwise, the host processed all descriptors.
@@ -176,10 +176,10 @@ VirtioAppendDesc (
EFI_STATUS
EFIAPI
VirtioFlush (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINT16 VirtQueueId,
- IN OUT VRING *Ring,
- IN DESC_INDICES *Indices
+ IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
+ IN UINT16 VirtQueueId,
+ IN OUT VRING *Ring,
+ IN DESC_INDICES *Indices
);
#endif // _VIRTIO_LIB_H_
diff --git a/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h b/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h
index 73e5a9e8d..3f63a650b 100644
--- a/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h
+++ b/OvmfPkg/Include/Library/VirtioMmioDeviceLib.h
@@ -1,65 +1,66 @@
-/** @file
-
- Definitions for the VirtIo MMIO Device Library
-
- Copyright (C) 2013, ARM Ltd
-
- 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 _VIRTIO_MMIO_DEVICE_LIB_H_
-#define _VIRTIO_MMIO_DEVICE_LIB_H_
-
-/**
-
- Initialize VirtIo Device and Install VIRTIO_DEVICE_PROTOCOL protocol
-
- @param[in] BaseAddress Base Address of the VirtIo MMIO Device
-
- @param[in] Handle Handle of the device the driver should be attached to.
-
- @retval EFI_SUCCESS The VirtIo Device has been installed
- successfully.
-
- @retval EFI_OUT_OF_RESOURCES The function failed too allocate memory require
- by the Virtio MMIO device initialization.
-
- @retval EFI_UNSUPPORTED BaseAddress does not point to a VirtIo MMIO
- device.
-
- @return Status code returned by InstallProtocolInterface
- Boot Service function.
-
-**/
-EFI_STATUS
-VirtioMmioInstallDevice (
- IN PHYSICAL_ADDRESS BaseAddress,
- IN EFI_HANDLE Handle
- );
-
-/**
-
- Uninstall the VirtIo Device
-
- @param[in] Handle Handle of the device where the VirtIo Device protocol
- should have been installed.
-
- @retval EFI_SUCCESS The device has been un-initialized successfully.
-
- @return Status code returned by UninstallProtocolInterface
- Boot Service function.
-
-**/
-EFI_STATUS
-VirtioMmioUninstallDevice (
- IN EFI_HANDLE Handle
- );
-
-#endif // _VIRTIO_MMIO_DEVICE_LIB_H_
+/** @file
+
+ Definitions for the VirtIo MMIO Device Library
+
+ Copyright (C) 2013, ARM Ltd
+
+ 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 _VIRTIO_MMIO_DEVICE_LIB_H_
+#define _VIRTIO_MMIO_DEVICE_LIB_H_
+
+/**
+
+ Initialize VirtIo Device and Install VIRTIO_DEVICE_PROTOCOL protocol
+
+ @param[in] BaseAddress Base Address of the VirtIo MMIO Device
+
+ @param[in] Handle Handle of the device the driver should be attached
+ to.
+
+ @retval EFI_SUCCESS The VirtIo Device has been installed
+ successfully.
+
+ @retval EFI_OUT_OF_RESOURCES The function failed to allocate memory required
+ by the Virtio MMIO device initialization.
+
+ @retval EFI_UNSUPPORTED BaseAddress does not point to a VirtIo MMIO
+ device.
+
+ @return Status code returned by InstallProtocolInterface
+ Boot Service function.
+
+**/
+EFI_STATUS
+VirtioMmioInstallDevice (
+ IN PHYSICAL_ADDRESS BaseAddress,
+ IN EFI_HANDLE Handle
+ );
+
+/**
+
+ Uninstall the VirtIo Device
+
+ @param[in] Handle Handle of the device where the VirtIo Device protocol
+ should have been installed.
+
+ @retval EFI_SUCCESS The device has been un-initialized successfully.
+
+ @return Status code returned by UninstallProtocolInterface
+ Boot Service function.
+
+**/
+EFI_STATUS
+VirtioMmioUninstallDevice (
+ IN EFI_HANDLE Handle
+ );
+
+#endif // _VIRTIO_MMIO_DEVICE_LIB_H_
diff --git a/OvmfPkg/Include/Protocol/VirtioDevice.h b/OvmfPkg/Include/Protocol/VirtioDevice.h
index cecac0541..48fca2e14 100644
--- a/OvmfPkg/Include/Protocol/VirtioDevice.h
+++ b/OvmfPkg/Include/Protocol/VirtioDevice.h
@@ -1,376 +1,382 @@
-/** @file
- Virtio Device
-
- Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
-
- 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 __VIRTIO_DEVICE_H__
-#define __VIRTIO_DEVICE_H__
-
-// VirtIo Specification Revision: Major[31:24].Minor[23:16].Revision[15:0
-#define VIRTIO_SPEC_REVISION(major,minor,revision) \
- ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | ((revision) & 0xFFFF))
-
-#define VIRTIO_DEVICE_PROTOCOL_GUID { \
- 0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a }\
- }
-
-typedef struct _VIRTIO_DEVICE_PROTOCOL VIRTIO_DEVICE_PROTOCOL;
-
-/**
-
- Read a word from the device-specific I/O region of the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] FieldOffset Source offset.
-
- @param[in] FieldSize Source field size in bytes, must be in {1, 2, 4, 8}.
-
- @param[in] BufferSize Number of bytes available in the target buffer. Must
- equal FieldSize.
-
- @param[out] Buffer Target buffer.
-
- @retval EFI_SUCCESS The data was read successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
- lack of resources.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_DEVICE_READ) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- );
-
-/**
-
- Write a word to the device-specific I/O region of the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] FieldOffset Destination offset.
-
- @param[in] FieldSize Destination field size in bytes,
- must be in {1, 2, 4, 8}.
-
- @param[out] Value Value to write.
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
- lack of resources.
- @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_DEVICE_WRITE) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- );
-
-/**
- Read the device features field from the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[out] DeviceFeatures The 32-bit device features field.
-
- @retval EFI_SUCCESS The data was read successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
- @retval EFI_INVALID_PARAMETER DeviceFeatures is NULL
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_GET_DEVICE_FEATURES) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *DeviceFeatures
- );
-
-/**
- Write the guest features field in the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] Features The 32-bit guest guest features field
-
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_GUEST_FEATURES) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Features
- );
-
-/**
- Read the queue address field from the Virtio Header.
-
- QueueAddress is the address of the virtqueue divided by 4096.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[out] QueueAddress The 32-bit queue address field.
-
- @retval EFI_SUCCESS The data was read successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
- @retval EFI_INVALID_PARAMETER QueueAddress is NULL
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_GET_QUEUE_ADDRESS) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *QueueAddress
- );
-
-/**
- Write the queue address field in the Virtio Header.
-
- The parameter Address must be the base address of the virtqueue divided
- by 4096.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] Address The 32-bit Queue Address field
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_QUEUE_ADDRESS) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Address
- );
-
-/**
-
- Write the queue select field in the Virtio Header.
-
- Writing to the queue select field sets the index of the queue to which
- operations such as SetQueueAlign and GetQueueNumMax apply.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] Index The index of the queue to select
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_QUEUE_SEL) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 Index
- );
-
-/**
-
- Write the queue notify field in the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] Address The 32-bit Queue Notify field
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_QUEUE_NOTIFY) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 Index
- );
-
-/**
- Write the queue alignment field in the Virtio Header.
-
- The queue to which the alignment applies is selected by the Queue Select
- field.
-
- Note: This operation is not implemented by the VirtIo over PCI. The PCI
- implementation of this protocol returns EFI_SUCCESS.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] Alignment The alignment boundary of the Used Ring in bytes.
- Must be a power of 2.
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_QUEUE_ALIGN) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Alignment
- );
-
-/**
- Write the guest page size.
-
- Note: This operation is not implemented by the VirtIo over PCI. The PCI
- implementation of this protocol returns EFI_SUCCESS.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] PageSize Size of the Guest page in bytes.
- Must be a power of 2.
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_PAGE_SIZE) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 PageSize
- );
-
-/**
-
- Get the size of the virtqueue selected by the queue select field.
-
- See Virtio spec Section 2.3
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[out] QueueNumMax The size of the virtqueue in bytes.
- Always a power of 2.
-
- @retval EFI_SUCCESS The data was read successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
- @retval EFI_INVALID_PARAMETER QueueNumMax is NULL
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_GET_QUEUE_NUM_MAX) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT16 *QueueNumMax
- );
-
-/**
-
- Write to the QueueNum field in the Virtio Header.
-
- This function only applies to Virtio-MMIO and may be a stub for other
- implementations. See Virtio Spec appendix X.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] QueueSize The number of elements in the queue.
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_QUEUE_NUM) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT16 QueueSize
- );
-
-/**
-
- Get the DeviceStatus field from the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[out] DeviceStatus The 8-bit value for the Device status field
-
- @retval EFI_SUCCESS The data was read successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
- @retval EFI_INVALID_PARAMETER DeviceStatus is NULL
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_GET_DEVICE_STATUS) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT8 *DeviceStatus
- );
-
-/**
-
- Write the DeviceStatus field in the Virtio Header.
-
- @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
-
- @param[in] DeviceStatus The 8-bit value for the Device status field
-
- @retval EFI_SUCCESS The data was written successfully.
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and write size.
-**/
-typedef
-EFI_STATUS
-(EFIAPI *VIRTIO_SET_DEVICE_STATUS) (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT8 DeviceStatus
- );
-
-
-///
-/// This protocol provides an abstraction over the VirtIo transport layer
-///
-struct _VIRTIO_DEVICE_PROTOCOL {
- /// VirtIo Specification Revision encoded with VIRTIO_SPEC_REVISION()
- UINT32 Revision;
- /// From the Virtio Spec
- INT32 SubSystemDeviceId;
-
- VIRTIO_GET_DEVICE_FEATURES GetDeviceFeatures;
- VIRTIO_SET_GUEST_FEATURES SetGuestFeatures;
-
- VIRTIO_GET_QUEUE_ADDRESS GetQueueAddress;
- VIRTIO_SET_QUEUE_ADDRESS SetQueueAddress;
-
- VIRTIO_SET_QUEUE_SEL SetQueueSel;
-
- VIRTIO_SET_QUEUE_NOTIFY SetQueueNotify;
-
- VIRTIO_SET_QUEUE_ALIGN SetQueueAlign;
- VIRTIO_SET_PAGE_SIZE SetPageSize;
-
- VIRTIO_GET_QUEUE_NUM_MAX GetQueueNumMax;
- VIRTIO_SET_QUEUE_NUM SetQueueNum;
-
- VIRTIO_GET_DEVICE_STATUS GetDeviceStatus;
- VIRTIO_SET_DEVICE_STATUS SetDeviceStatus;
-
- // Functions to read/write Device Specific headers
- VIRTIO_DEVICE_WRITE WriteDevice;
- VIRTIO_DEVICE_READ ReadDevice;
-};
-
-extern EFI_GUID gVirtioDeviceProtocolGuid;
-
-#endif
+/** @file
+ Virtio Device
+
+ DISCLAIMER: the VIRTIO_DEVICE_PROTOCOL introduced here is a work in progress,
+ and should not be used outside of the EDK II tree.
+
+ Copyright (c) 2013, ARM Ltd. All rights reserved.<BR>
+
+ 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 __VIRTIO_DEVICE_H__
+#define __VIRTIO_DEVICE_H__
+
+// VirtIo Specification Revision: Major[31:24].Minor[23:16].Revision[15:0
+#define VIRTIO_SPEC_REVISION(major,minor,revision) \
+ ((((major) & 0xFF) << 24) | (((minor) & 0xFF) << 16) | ((revision) & 0xFFFF))
+
+#define VIRTIO_DEVICE_PROTOCOL_GUID { \
+ 0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a }\
+ }
+
+typedef struct _VIRTIO_DEVICE_PROTOCOL VIRTIO_DEVICE_PROTOCOL;
+
+/**
+
+ Read a word from the device-specific I/O region of the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] FieldOffset Source offset.
+
+ @param[in] FieldSize Source field size in bytes, must be in {1, 2, 4, 8}.
+
+ @param[in] BufferSize Number of bytes available in the target buffer. Must
+ equal FieldSize.
+
+ @param[out] Buffer Target buffer.
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
+ lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_DEVICE_READ) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+/**
+
+ Write a word to the device-specific I/O region of the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] FieldOffset Destination offset.
+
+ @param[in] FieldSize Destination field size in bytes,
+ must be in {1, 2, 4, 8}.
+
+ @param[out] Value Value to write.
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a
+ lack of resources.
+ @retval EFI_INVALID_PARAMETER One or more parameters are invalid.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_DEVICE_WRITE) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ );
+
+/**
+ Read the device features field from the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[out] DeviceFeatures The 32-bit device features field.
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+ @retval EFI_INVALID_PARAMETER DeviceFeatures is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_GET_DEVICE_FEATURES) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *DeviceFeatures
+ );
+
+/**
+ Write the guest features field in the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] Features The 32-bit guest guest features field
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_GUEST_FEATURES) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 Features
+ );
+
+/**
+ Read the queue address field from the Virtio Header.
+
+ QueueAddress is the address of the virtqueue divided by 4096.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[out] QueueAddress The 32-bit queue address field.
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+ @retval EFI_INVALID_PARAMETER QueueAddress is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_GET_QUEUE_ADDRESS) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *QueueAddress
+ );
+
+/**
+ Write the queue address field in the Virtio Header.
+
+ The parameter Address must be the base address of the virtqueue divided
+ by 4096.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] Address The 32-bit Queue Address field
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_QUEUE_ADDRESS) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 Address
+ );
+
+/**
+
+ Write the queue select field in the Virtio Header.
+
+ Writing to the queue select field sets the index of the queue to which
+ operations such as SetQueueAlign and GetQueueNumMax apply.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] Index The index of the queue to select
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_QUEUE_SEL) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT16 Index
+ );
+
+/**
+
+ Write the queue notify field in the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] Address The 32-bit Queue Notify field
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_QUEUE_NOTIFY) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT16 Index
+ );
+
+/**
+ Write the queue alignment field in the Virtio Header.
+
+ The queue to which the alignment applies is selected by the Queue Select
+ field.
+
+ Note: This operation is not implemented by the VirtIo over PCI. The PCI
+ implementation of this protocol returns EFI_SUCCESS.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] Alignment The alignment boundary of the Used Ring in bytes.
+ Must be a power of 2.
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_QUEUE_ALIGN) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 Alignment
+ );
+
+/**
+ Write the guest page size.
+
+ Note: This operation is not implemented by the VirtIo over PCI. The PCI
+ implementation of this protocol returns EFI_SUCCESS.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] PageSize Size of the Guest page in bytes.
+ Must be a power of 2.
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_PAGE_SIZE) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 PageSize
+ );
+
+/**
+
+ Get the size of the virtqueue selected by the queue select field.
+
+ See Virtio spec Section 2.3
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[out] QueueNumMax The size of the virtqueue in bytes.
+ Always a power of 2.
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+ @retval EFI_INVALID_PARAMETER QueueNumMax is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_GET_QUEUE_NUM_MAX) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT16 *QueueNumMax
+ );
+
+/**
+
+ Write to the QueueNum field in the Virtio Header.
+
+ This function only applies to Virtio-MMIO and may be a stub for other
+ implementations. See Virtio Spec appendix X.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] QueueSize The number of elements in the queue.
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_QUEUE_NUM) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT16 QueueSize
+ );
+
+/**
+
+ Get the DeviceStatus field from the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[out] DeviceStatus The 8-bit value for the Device status field
+
+ @retval EFI_SUCCESS The data was read successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+ @retval EFI_INVALID_PARAMETER DeviceStatus is NULL
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_GET_DEVICE_STATUS) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT8 *DeviceStatus
+ );
+
+/**
+
+ Write the DeviceStatus field in the Virtio Header.
+
+ @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL
+
+ @param[in] DeviceStatus The 8-bit value for the Device status field
+
+ @retval EFI_SUCCESS The data was written successfully.
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and write size.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *VIRTIO_SET_DEVICE_STATUS) (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT8 DeviceStatus
+ );
+
+
+///
+/// This protocol provides an abstraction over the VirtIo transport layer
+///
+/// DISCLAIMER: this protocol is a work in progress, and should not be used
+/// outside of the EDK II tree.
+///
+struct _VIRTIO_DEVICE_PROTOCOL {
+ /// VirtIo Specification Revision encoded with VIRTIO_SPEC_REVISION()
+ UINT32 Revision;
+ /// From the Virtio Spec
+ INT32 SubSystemDeviceId;
+
+ VIRTIO_GET_DEVICE_FEATURES GetDeviceFeatures;
+ VIRTIO_SET_GUEST_FEATURES SetGuestFeatures;
+
+ VIRTIO_GET_QUEUE_ADDRESS GetQueueAddress;
+ VIRTIO_SET_QUEUE_ADDRESS SetQueueAddress;
+
+ VIRTIO_SET_QUEUE_SEL SetQueueSel;
+
+ VIRTIO_SET_QUEUE_NOTIFY SetQueueNotify;
+
+ VIRTIO_SET_QUEUE_ALIGN SetQueueAlign;
+ VIRTIO_SET_PAGE_SIZE SetPageSize;
+
+ VIRTIO_GET_QUEUE_NUM_MAX GetQueueNumMax;
+ VIRTIO_SET_QUEUE_NUM SetQueueNum;
+
+ VIRTIO_GET_DEVICE_STATUS GetDeviceStatus;
+ VIRTIO_SET_DEVICE_STATUS SetDeviceStatus;
+
+ // Functions to read/write Device Specific headers
+ VIRTIO_DEVICE_WRITE WriteDevice;
+ VIRTIO_DEVICE_READ ReadDevice;
+};
+
+extern EFI_GUID gVirtioDeviceProtocolGuid;
+
+#endif
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
index 7e5ea00bf..3c5963f31 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.c
@@ -1,6 +1,7 @@
/** @file
Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2013, Red Hat, Inc.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -21,8 +22,6 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
-STATIC BOOLEAN mQemuFwCfgSupported = FALSE;
-
/**
Reads an 8-bit I/O port fifo into a block of memory.
@@ -78,24 +77,6 @@ IoWriteFifo8 (
/**
- Returns a boolean indicating if the firmware configuration interface
- is available or not.
-
- @retval TRUE The interface is available
- @retval FALSE The interface is not available
-
-**/
-BOOLEAN
-EFIAPI
-QemuFwCfgIsAvailable (
- VOID
- )
-{
- return mQemuFwCfgSupported;
-}
-
-
-/**
Selects a firmware configuration item for reading.
Following this call, any data read from this item will start from
@@ -151,7 +132,7 @@ QemuFwCfgReadBytes (
IN VOID *Buffer
)
{
- if (mQemuFwCfgSupported) {
+ if (InternalQemuFwCfgIsAvailable ()) {
InternalQemuFwCfgReadBytes (Size, Buffer);
} else {
ZeroMem (Buffer, Size);
@@ -176,7 +157,7 @@ QemuFwCfgWriteBytes (
IN VOID *Buffer
)
{
- if (mQemuFwCfgSupported) {
+ if (InternalQemuFwCfgIsAvailable ()) {
IoWriteFifo8 (0x511, Size, Buffer);
}
}
@@ -262,39 +243,6 @@ QemuFwCfgRead64 (
}
-RETURN_STATUS
-EFIAPI
-QemuFwCfgInitialize (
- VOID
- )
-{
- UINT32 Signature;
- UINT32 Revision;
-
- //
- // Enable the access routines while probing to see if it is supported.
- //
- mQemuFwCfgSupported = TRUE;
-
- QemuFwCfgSelectItem (QemuFwCfgItemSignature);
- Signature = QemuFwCfgRead32 ();
- DEBUG ((EFI_D_INFO, "FW CFG Signature: 0x%x\n", Signature));
- QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion);
- Revision = QemuFwCfgRead32 ();
- DEBUG ((EFI_D_INFO, "FW CFG Revision: 0x%x\n", Revision));
- if ((Signature != SIGNATURE_32 ('Q', 'E', 'M', 'U')) ||
- (Revision < 1)
- ) {
- DEBUG ((EFI_D_INFO, "QemuFwCfg interface not supported.\n"));
- mQemuFwCfgSupported = FALSE;
- return RETURN_SUCCESS;
- }
-
- DEBUG ((EFI_D_INFO, "QemuFwCfg interface is supported.\n"));
- return RETURN_SUCCESS;
-}
-
-
/**
Find the configuration item corresponding to the firmware configuration file.
@@ -319,7 +267,7 @@ QemuFwCfgFindFile (
UINT32 Count;
UINT32 Idx;
- if (!mQemuFwCfgSupported) {
+ if (!InternalQemuFwCfgIsAvailable ()) {
return RETURN_UNSUPPORTED;
}
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
index a5446f0b9..071737ede 100644
--- a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
@@ -1,5 +1,8 @@
## @file
#
+# Stateful, implicitly initialized fw_cfg library.
+#
+# Copyright (C) 2013, Red Hat, Inc.
# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
@@ -18,7 +21,7 @@
FILE_GUID = fdd53716-31e1-4acc-9007-8bd5d877c96f
MODULE_TYPE = BASE
VERSION_STRING = 1.0
- LIBRARY_CLASS = QemuFwCfgLib
+ LIBRARY_CLASS = QemuFwCfgLib|PEIM DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER
CONSTRUCTOR = QemuFwCfgInitialize
@@ -30,6 +33,7 @@
[Sources]
QemuFwCfgLib.c
+ QemuFwCfgPeiDxe.c
[Sources.IA32]
Ia32/IoLibExAsm.asm
@@ -49,5 +53,4 @@
DebugLib
IoLib
MemoryAllocationLib
- UefiBootServicesTableLib
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c
new file mode 100644
index 000000000..f693cff29
--- /dev/null
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgPeiDxe.c
@@ -0,0 +1,92 @@
+/** @file
+
+ Stateful and implicitly initialized fw_cfg library implementation.
+
+ Copyright (C) 2013, Red Hat, Inc.
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+
+ 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 <Library/DebugLib.h>
+#include <Library/QemuFwCfgLib.h>
+
+STATIC BOOLEAN mQemuFwCfgSupported = FALSE;
+
+
+/**
+ Returns a boolean indicating if the firmware configuration interface
+ is available or not.
+
+ This function may change fw_cfg state.
+
+ @retval TRUE The interface is available
+ @retval FALSE The interface is not available
+
+**/
+BOOLEAN
+EFIAPI
+QemuFwCfgIsAvailable (
+ VOID
+ )
+{
+ return InternalQemuFwCfgIsAvailable ();
+}
+
+
+RETURN_STATUS
+EFIAPI
+QemuFwCfgInitialize (
+ VOID
+ )
+{
+ UINT32 Signature;
+ UINT32 Revision;
+
+ //
+ // Enable the access routines while probing to see if it is supported.
+ //
+ mQemuFwCfgSupported = TRUE;
+
+ QemuFwCfgSelectItem (QemuFwCfgItemSignature);
+ Signature = QemuFwCfgRead32 ();
+ DEBUG ((EFI_D_INFO, "FW CFG Signature: 0x%x\n", Signature));
+ QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion);
+ Revision = QemuFwCfgRead32 ();
+ DEBUG ((EFI_D_INFO, "FW CFG Revision: 0x%x\n", Revision));
+ if ((Signature != SIGNATURE_32 ('Q', 'E', 'M', 'U')) ||
+ (Revision < 1)
+ ) {
+ DEBUG ((EFI_D_INFO, "QemuFwCfg interface not supported.\n"));
+ mQemuFwCfgSupported = FALSE;
+ return RETURN_SUCCESS;
+ }
+
+ DEBUG ((EFI_D_INFO, "QemuFwCfg interface is supported.\n"));
+ return RETURN_SUCCESS;
+}
+
+
+/**
+ Returns a boolean indicating if the firmware configuration interface is
+ available for library-internal purposes.
+
+ This function never changes fw_cfg state.
+
+ @retval TRUE The interface is available internally.
+ @retval FALSE The interface is not available internally.
+**/
+BOOLEAN
+EFIAPI
+InternalQemuFwCfgIsAvailable (
+ VOID
+ )
+{
+ return mQemuFwCfgSupported;
+}
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c
new file mode 100644
index 000000000..88c32ce89
--- /dev/null
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSec.c
@@ -0,0 +1,81 @@
+/** @file
+
+ Stateless fw_cfg library implementation.
+
+ Clients must call QemuFwCfgIsAvailable() first.
+
+ Copyright (C) 2013, Red Hat, Inc.
+ Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+
+ 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 <Library/DebugLib.h>
+#include <Library/QemuFwCfgLib.h>
+
+
+/**
+ Returns a boolean indicating if the firmware configuration interface
+ is available or not.
+
+ This function may change fw_cfg state.
+
+ @retval TRUE The interface is available
+ @retval FALSE The interface is not available
+
+**/
+BOOLEAN
+EFIAPI
+QemuFwCfgIsAvailable (
+ VOID
+ )
+{
+ UINT32 Signature;
+ UINT32 Revision;
+
+ QemuFwCfgSelectItem (QemuFwCfgItemSignature);
+ Signature = QemuFwCfgRead32 ();
+ DEBUG ((EFI_D_INFO, "FW CFG Signature: 0x%x\n", Signature));
+ QemuFwCfgSelectItem (QemuFwCfgItemInterfaceVersion);
+ Revision = QemuFwCfgRead32 ();
+ DEBUG ((EFI_D_INFO, "FW CFG Revision: 0x%x\n", Revision));
+ if ((Signature != SIGNATURE_32 ('Q', 'E', 'M', 'U')) ||
+ (Revision < 1)
+ ) {
+ DEBUG ((EFI_D_INFO, "QemuFwCfg interface not supported.\n"));
+ return FALSE;
+ }
+
+ DEBUG ((EFI_D_INFO, "QemuFwCfg interface is supported.\n"));
+ return TRUE;
+}
+
+
+/**
+ Returns a boolean indicating if the firmware configuration interface is
+ available for library-internal purposes.
+
+ This function never changes fw_cfg state.
+
+ @retval TRUE The interface is available internally.
+ @retval FALSE The interface is not available internally.
+**/
+BOOLEAN
+EFIAPI
+InternalQemuFwCfgIsAvailable (
+ VOID
+ )
+{
+ //
+ // We always return TRUE, because the consumer of this library ought to have
+ // called QemuFwCfgIsAvailable before making other calls which would hit this
+ // path.
+ //
+ return TRUE;
+}
diff --git a/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
new file mode 100644
index 000000000..71beacbaf
--- /dev/null
+++ b/OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
@@ -0,0 +1,54 @@
+## @file
+#
+# Stateless fw_cfg library that must be queried before use.
+#
+# Copyright (C) 2013, Red Hat, Inc.
+# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
+#
+# 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 = QemuFwCfgSecLib
+ FILE_GUID = 60a910e5-7443-413d-9a30-97e57497cd1b
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = QemuFwCfgLib|SEC
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[Sources]
+ QemuFwCfgLib.c
+ QemuFwCfgSec.c
+
+[Sources.IA32]
+ Ia32/IoLibExAsm.asm
+ Ia32/IoLibExAsm.S
+
+[Sources.X64]
+ X64/IoLibExAsm.asm
+ X64/IoLibExAsm.S
+
+[Packages]
+ MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ BaseLib
+ BaseMemoryLib
+ DebugLib
+ IoLib
+ MemoryAllocationLib
+
diff --git a/OvmfPkg/Library/VirtioLib/VirtioLib.c b/OvmfPkg/Library/VirtioLib/VirtioLib.c
index 1550318d8..54cf225c9 100644
--- a/OvmfPkg/Library/VirtioLib/VirtioLib.c
+++ b/OvmfPkg/Library/VirtioLib/VirtioLib.c
@@ -3,7 +3,7 @@
Utility functions used by virtio device drivers.
Copyright (C) 2012, Red Hat, Inc.
- Portion of Copyright (C) 2013, ARM Ltd.
+ Portion of Copyright (C) 2013, ARM Ltd.
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License which accompanies this
@@ -239,7 +239,7 @@ VirtioAppendDesc (
Notify the host about the descriptor chain just built, and wait until the
host processes it.
- @param[in] VirtIo The target virtio device to notify.
+ @param[in] VirtIo The target virtio device to notify.
@param[in] VirtQueueId Identifies the queue for the target device.
@@ -250,7 +250,7 @@ VirtioAppendDesc (
of the descriptor chain.
- @return Error code from VirtioWriteDevice() if it fails.
+ @return Error code from VirtIo->SetQueueNotify() if it fails.
@retval EFI_SUCCESS Otherwise, the host processed all descriptors.
@@ -258,10 +258,10 @@ VirtioAppendDesc (
EFI_STATUS
EFIAPI
VirtioFlush (
- IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
- IN UINT16 VirtQueueId,
- IN OUT VRING *Ring,
- IN DESC_INDICES *Indices
+ IN VIRTIO_DEVICE_PROTOCOL *VirtIo,
+ IN UINT16 VirtQueueId,
+ IN OUT VRING *Ring,
+ IN DESC_INDICES *Indices
)
{
UINT16 NextAvailIdx;
@@ -290,7 +290,7 @@ VirtioFlush (
// OK.
//
MemoryFence();
- Status = VirtIo->SetQueueNotify (VirtIo, VirtQueueId);
+ Status = VirtIo->SetQueueNotify (VirtIo, VirtQueueId);
if (EFI_ERROR (Status)) {
return Status;
}
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
index f763db5fb..4af9dd0ac 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c
@@ -1,204 +1,224 @@
-/** @file
-
- This driver produces Virtio Device Protocol instances for Virtio Mmio devices.
-
- Copyright (C) 2013, ARM Ltd.
-
- 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 <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-
-#include "VirtioMmioDevice.h"
-
-static VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate = {
- 0, // Revision
- 0, // SubSystemDeviceId
- VirtioMmioGetDeviceFeatures, // GetDeviceFeatures
- VirtioMmioSetGuestFeatures, // SetGuestFeatures
- VirtioMmioGetQueueAddress, // GetQueueAddress
- VirtioMmioSetQueueAddress, // SetQueueAddress
- VirtioMmioSetQueueSel, // SetQueueSel
- VirtioMmioSetQueueNotify, // SetQueueNotify
- VirtioMmioSetQueueAlignment, // SetQueueAlign
- VirtioMmioSetPageSize, // SetPageSize
- VirtioMmioGetQueueSize, // GetQueueNumMax
- VirtioMmioSetQueueSize, // SetQueueNum
- VirtioMmioGetDeviceStatus, // GetDeviceStatus
- VirtioMmioSetDeviceStatus, // SetDeviceStatus
- VirtioMmioDeviceWrite, // WriteDevice
- VirtioMmioDeviceRead // ReadDevice
-};
-
-/**
-
- Initialize the VirtIo MMIO Device
-
- @param[in] BaseAddress Base Address of the VirtIo MMIO Device
-
- @param[in, out] Device The driver instance to configure.
-
- @retval EFI_SUCCESS Setup complete.
-
- @retval EFI_UNSUPPORTED The driver is not a VirtIo MMIO device.
-
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-VirtioMmioInit (
- IN PHYSICAL_ADDRESS BaseAddress,
- IN OUT VIRTIO_MMIO_DEVICE *Device
- )
-{
- UINT32 MagicValue;
- UINT32 VendorId;
- UINT32 Version;
-
- // Initialize VirtIo Mmio Device
- CopyMem (&Device->VirtioDevice, &mMmioDeviceProtocolTemplate,
- sizeof (VIRTIO_DEVICE_PROTOCOL));
- Device->BaseAddress = BaseAddress;
- Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
- Device->VirtioDevice.SubSystemDeviceId =
- MmioRead32 (BaseAddress + VIRTIO_MMIO_OFFSET_DEVICE_ID);
-
- // Double-check MMIO-specific values
- MagicValue = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_MAGIC);
- if (MagicValue != VIRTIO_MMIO_MAGIC) {
- return EFI_UNSUPPORTED;
- }
-
- Version = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_VERSION);
- if (Version != 1) {
- return EFI_UNSUPPORTED;
- }
-
- // Double-check MMIO-specific values
- VendorId = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_VENDOR_ID);
- if (VendorId != VIRTIO_VENDOR_ID) {
- // The ARM Base and Foundation Models do not report a valid VirtIo VendorId.
- // They return a value of 0x0 for the VendorId.
- DEBUG((EFI_D_WARN, "VirtioMmioInit: Warning: The VendorId (0x%X) does not "
- "match the VirtIo VendorId (0x%X).\n",
- VendorId, VIRTIO_VENDOR_ID));
- //return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-
-/**
-
- Uninitialize the internals of a virtio-mmio device that has been successfully
- set up with VirtioMmioInit().
-
- @param[in, out] Device The device to clean up.
-
-**/
-
-STATIC
-VOID
-EFIAPI
-VirtioMmioUninit (
- IN VIRTIO_MMIO_DEVICE *Device
- )
-{
- // Note: This function mirrors VirtioMmioInit() that does not allocate any
- // resources - there's nothing to free here.
-}
-
-EFI_STATUS
-VirtioMmioInstallDevice (
- IN PHYSICAL_ADDRESS BaseAddress,
- IN EFI_HANDLE Handle
- )
-{
- EFI_STATUS Status;
- VIRTIO_MMIO_DEVICE *VirtIo;
-
- if (!BaseAddress) {
- return EFI_INVALID_PARAMETER;
- }
- if (Handle == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- // Allocate VIRTIO_MMIO_DEVICE
- VirtIo = AllocateZeroPool (sizeof (VIRTIO_MMIO_DEVICE));
- if (VirtIo == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- VirtIo->Signature = VIRTIO_MMIO_DEVICE_SIGNATURE;
-
- Status = VirtioMmioInit (BaseAddress, VirtIo);
- if (EFI_ERROR (Status)) {
- goto FreeVirtioMem;
- }
-
- // Install VIRTIO_DEVICE_PROTOCOL to Handle
- Status = gBS->InstallProtocolInterface (&Handle,
- &gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
- &VirtIo->VirtioDevice);
- if (EFI_ERROR (Status)) {
- goto UninitVirtio;
- }
-
- return EFI_SUCCESS;
-
-UninitVirtio:
- VirtioMmioUninit (VirtIo);
-
-FreeVirtioMem:
- FreePool (VirtIo);
- return Status;
-}
-
-EFI_STATUS
-VirtioMmioUninstallDevice (
- IN EFI_HANDLE DeviceHandle
- )
-{
- VIRTIO_DEVICE_PROTOCOL *VirtioDevice;
- VIRTIO_MMIO_DEVICE *MmioDevice;
- EFI_STATUS Status;
-
- Status = gBS->OpenProtocol (
- DeviceHandle, // candidate device
- &gVirtioDeviceProtocolGuid, // retrieve the VirtIo iface
- (VOID **)&VirtioDevice, // target pointer
- DeviceHandle, // requestor driver identity
- DeviceHandle, // requesting lookup for dev.
- EFI_OPEN_PROTOCOL_GET_PROTOCOL // lookup only, no ref. added
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- // Get the MMIO device from the VirtIo Device instance
- MmioDevice = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (VirtioDevice);
-
- // Uninstall the protocol interface
- Status = gBS->UninstallProtocolInterface (DeviceHandle,
- &gVirtioDeviceProtocolGuid, &MmioDevice->VirtioDevice
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- // Uninitialize the VirtIo Device
- VirtioMmioUninit (MmioDevice);
-
- return EFI_SUCCESS;
-}
+/** @file
+
+ This driver produces Virtio Device Protocol instances for Virtio Mmio devices.
+
+ Copyright (C) 2013, ARM Ltd.
+
+ 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 <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+#include "VirtioMmioDevice.h"
+
+static VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate = {
+ 0, // Revision
+ 0, // SubSystemDeviceId
+ VirtioMmioGetDeviceFeatures, // GetDeviceFeatures
+ VirtioMmioSetGuestFeatures, // SetGuestFeatures
+ VirtioMmioGetQueueAddress, // GetQueueAddress
+ VirtioMmioSetQueueAddress, // SetQueueAddress
+ VirtioMmioSetQueueSel, // SetQueueSel
+ VirtioMmioSetQueueNotify, // SetQueueNotify
+ VirtioMmioSetQueueAlignment, // SetQueueAlign
+ VirtioMmioSetPageSize, // SetPageSize
+ VirtioMmioGetQueueSize, // GetQueueNumMax
+ VirtioMmioSetQueueSize, // SetQueueNum
+ VirtioMmioGetDeviceStatus, // GetDeviceStatus
+ VirtioMmioSetDeviceStatus, // SetDeviceStatus
+ VirtioMmioDeviceWrite, // WriteDevice
+ VirtioMmioDeviceRead // ReadDevice
+};
+
+/**
+
+ Initialize the VirtIo MMIO Device
+
+ @param[in] BaseAddress Base Address of the VirtIo MMIO Device
+
+ @param[in, out] Device The driver instance to configure.
+
+ @retval EFI_SUCCESS Setup complete.
+
+ @retval EFI_UNSUPPORTED The driver is not a VirtIo MMIO device.
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+VirtioMmioInit (
+ IN PHYSICAL_ADDRESS BaseAddress,
+ IN OUT VIRTIO_MMIO_DEVICE *Device
+ )
+{
+ UINT32 MagicValue;
+ UINT32 VendorId;
+ UINT32 Version;
+
+ //
+ // Initialize VirtIo Mmio Device
+ //
+ CopyMem (&Device->VirtioDevice, &mMmioDeviceProtocolTemplate,
+ sizeof (VIRTIO_DEVICE_PROTOCOL));
+ Device->BaseAddress = BaseAddress;
+ Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
+ Device->VirtioDevice.SubSystemDeviceId =
+ MmioRead32 (BaseAddress + VIRTIO_MMIO_OFFSET_DEVICE_ID);
+
+ //
+ // Double-check MMIO-specific values
+ //
+ MagicValue = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_MAGIC);
+ if (MagicValue != VIRTIO_MMIO_MAGIC) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Version = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_VERSION);
+ if (Version != 1) {
+ return EFI_UNSUPPORTED;
+ }
+
+ //
+ // Double-check MMIO-specific values
+ //
+ VendorId = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_VENDOR_ID);
+ if (VendorId != VIRTIO_VENDOR_ID) {
+ //
+ // The ARM Base and Foundation Models do not report a valid VirtIo VendorId.
+ // They return a value of 0x0 for the VendorId.
+ //
+ DEBUG((EFI_D_WARN, "VirtioMmioInit: Warning: The VendorId (0x%X) does not "
+ "match the VirtIo VendorId (0x%X).\n",
+ VendorId, VIRTIO_VENDOR_ID));
+ }
+
+ return EFI_SUCCESS;
+}
+
+
+/**
+
+ Uninitialize the internals of a virtio-mmio device that has been successfully
+ set up with VirtioMmioInit().
+
+ @param[in, out] Device The device to clean up.
+
+**/
+
+STATIC
+VOID
+EFIAPI
+VirtioMmioUninit (
+ IN VIRTIO_MMIO_DEVICE *Device
+ )
+{
+ //
+ // Note: This function mirrors VirtioMmioInit() that does not allocate any
+ // resources - there's nothing to free here.
+ //
+}
+
+EFI_STATUS
+VirtioMmioInstallDevice (
+ IN PHYSICAL_ADDRESS BaseAddress,
+ IN EFI_HANDLE Handle
+ )
+{
+ EFI_STATUS Status;
+ VIRTIO_MMIO_DEVICE *VirtIo;
+
+ if (!BaseAddress) {
+ return EFI_INVALID_PARAMETER;
+ }
+ if (Handle == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Allocate VIRTIO_MMIO_DEVICE
+ //
+ VirtIo = AllocateZeroPool (sizeof (VIRTIO_MMIO_DEVICE));
+ if (VirtIo == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ VirtIo->Signature = VIRTIO_MMIO_DEVICE_SIGNATURE;
+
+ Status = VirtioMmioInit (BaseAddress, VirtIo);
+ if (EFI_ERROR (Status)) {
+ goto FreeVirtioMem;
+ }
+
+ //
+ // Install VIRTIO_DEVICE_PROTOCOL to Handle
+ //
+ Status = gBS->InstallProtocolInterface (&Handle,
+ &gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
+ &VirtIo->VirtioDevice);
+ if (EFI_ERROR (Status)) {
+ goto UninitVirtio;
+ }
+
+ return EFI_SUCCESS;
+
+UninitVirtio:
+ VirtioMmioUninit (VirtIo);
+
+FreeVirtioMem:
+ FreePool (VirtIo);
+ return Status;
+}
+
+EFI_STATUS
+VirtioMmioUninstallDevice (
+ IN EFI_HANDLE DeviceHandle
+ )
+{
+ VIRTIO_DEVICE_PROTOCOL *VirtioDevice;
+ VIRTIO_MMIO_DEVICE *MmioDevice;
+ EFI_STATUS Status;
+
+ Status = gBS->OpenProtocol (
+ DeviceHandle, // candidate device
+ &gVirtioDeviceProtocolGuid, // retrieve the VirtIo iface
+ (VOID **)&VirtioDevice, // target pointer
+ DeviceHandle, // requestor driver identity
+ DeviceHandle, // requesting lookup for dev.
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL // lookup only, no ref. added
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Get the MMIO device from the VirtIo Device instance
+ //
+ MmioDevice = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (VirtioDevice);
+
+ //
+ // Uninstall the protocol interface
+ //
+ Status = gBS->UninstallProtocolInterface (DeviceHandle,
+ &gVirtioDeviceProtocolGuid, &MmioDevice->VirtioDevice
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Uninitialize the VirtIo Device
+ //
+ VirtioMmioUninit (MmioDevice);
+ FreePool (MmioDevice);
+
+ return EFI_SUCCESS;
+}
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
index 188d873ae..3e4e5606c 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h
@@ -1,147 +1,147 @@
-/** @file
-
- Internal definitions for the VirtIo MMIO Device driver
-
- Copyright (C) 2013, ARM Ltd
-
- 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 _VIRTIO_MMIO_DEVICE_INTERNAL_H_
-#define _VIRTIO_MMIO_DEVICE_INTERNAL_H_
-
-#include <Protocol/VirtioDevice.h>
-
-#include <IndustryStandard/Virtio.h>
-
-#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
-#include <Library/UefiLib.h>
-#include <Library/VirtioMmioDeviceLib.h>
-
-#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')
-
-typedef struct {
- UINT32 Signature;
- VIRTIO_DEVICE_PROTOCOL VirtioDevice;
- PHYSICAL_ADDRESS BaseAddress;
-} VIRTIO_MMIO_DEVICE;
-
-#define VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE(Device) \
- CR (Device, VIRTIO_MMIO_DEVICE, VirtioDevice, VIRTIO_MMIO_DEVICE_SIGNATURE)
-
-#define VIRTIO_CFG_WRITE(Device, Offset, Val) \
- (MmioWrite32 (Device->BaseAddress + (Offset), Val))
-#define VIRTIO_CFG_READ(Device, Offset) \
- (MmioRead32 (Device->BaseAddress + (Offset)))
-
-EFI_STATUS
-EFIAPI
-VirtioMmioDeviceRead (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOFfset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID* Buffer
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioDeviceWrite (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetDeviceFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *DeviceFeatures
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetQueueAddress (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *QueueAddress
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetQueueSize (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT16 *QueueNumMax
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetDeviceStatus (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT8 *DeviceStatus
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 QueueSize
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetDeviceStatus (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT8 DeviceStatus
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueNotify (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 QueueNotify
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueSel (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Sel
- );
-
-EFI_STATUS
-VirtioMmioSetQueueAddress (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Address
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueAlignment (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Alignment
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetPageSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 PageSize
- );
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetGuestFeatures (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Features
- );
-
-#endif // _VIRTIO_MMIO_DEVICE_INTERNAL_H_
+/** @file
+
+ Internal definitions for the VirtIo MMIO Device driver
+
+ Copyright (C) 2013, ARM Ltd
+
+ 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 _VIRTIO_MMIO_DEVICE_INTERNAL_H_
+#define _VIRTIO_MMIO_DEVICE_INTERNAL_H_
+
+#include <Protocol/VirtioDevice.h>
+
+#include <IndustryStandard/Virtio.h>
+
+#include <Library/DebugLib.h>
+#include <Library/IoLib.h>
+#include <Library/UefiLib.h>
+#include <Library/VirtioMmioDeviceLib.h>
+
+#define VIRTIO_MMIO_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'M', 'I', 'O')
+
+typedef struct {
+ UINT32 Signature;
+ VIRTIO_DEVICE_PROTOCOL VirtioDevice;
+ PHYSICAL_ADDRESS BaseAddress;
+} VIRTIO_MMIO_DEVICE;
+
+#define VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE(Device) \
+ CR (Device, VIRTIO_MMIO_DEVICE, VirtioDevice, VIRTIO_MMIO_DEVICE_SIGNATURE)
+
+#define VIRTIO_CFG_WRITE(Device, Offset, Val) \
+ (MmioWrite32 (Device->BaseAddress + (Offset), Val))
+#define VIRTIO_CFG_READ(Device, Offset) \
+ (MmioRead32 (Device->BaseAddress + (Offset)))
+
+EFI_STATUS
+EFIAPI
+VirtioMmioDeviceRead (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOFfset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID* Buffer
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioDeviceWrite (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetDeviceFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *DeviceFeatures
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetQueueAddress (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *QueueAddress
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetQueueSize (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT16 *QueueNumMax
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetDeviceStatus (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT8 *DeviceStatus
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 QueueSize
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetDeviceStatus (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT8 DeviceStatus
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueNotify (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 QueueNotify
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueSel (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Sel
+ );
+
+EFI_STATUS
+VirtioMmioSetQueueAddress (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Address
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueAlignment (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Alignment
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetPageSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 PageSize
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetGuestFeatures (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Features
+ );
+
+#endif // _VIRTIO_MMIO_DEVICE_INTERNAL_H_
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c
index fa76f8ffc..3950c07f7 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c
@@ -1,304 +1,310 @@
-/** @file
-
- This driver produces Virtio Device Protocol instances for Virtio MMIO devices.
-
- Copyright (C) 2012, Red Hat, Inc.
- Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
- Copyright (C) 2013, ARM Ltd.
-
- 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 "VirtioMmioDevice.h"
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetDeviceFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *DeviceFeatures
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- if (DeviceFeatures == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- *DeviceFeatures = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_HOST_FEATURES);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetQueueAddress (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *QueueAddress
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- if (QueueAddress == NULL) {
-
- }
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- *QueueAddress = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_QUEUE_PFN);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetQueueSize (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT16 *QueueNumMax
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- if (QueueNumMax == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- *QueueNumMax = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_QUEUE_NUM_MAX) & 0xFFFF;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioGetDeviceStatus (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT8 *DeviceStatus
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- if (DeviceStatus == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- *DeviceStatus = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_STATUS) & 0xFF;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 QueueSize
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_NUM, QueueSize);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetDeviceStatus (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT8 DeviceStatus
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_STATUS, DeviceStatus);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueNotify (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 QueueNotify
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_NOTIFY, QueueNotify);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueAlignment (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Alignment
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_ALIGN, Alignment);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetPageSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 PageSize
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- ASSERT (PageSize == EFI_PAGE_SIZE);
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_PAGE_SIZE, PageSize);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetQueueSel (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Sel
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_SEL, Sel);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-VirtioMmioSetQueueAddress (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Address
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_PFN, Address);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioSetGuestFeatures (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Features
- )
-{
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_FEATURES, Features);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioDeviceWrite (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- )
-{
- UINTN DstBaseAddress;
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- // Double-check fieldsize
- if (FieldSize > 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((FieldSize != 1) && (FieldSize != 2) &&
- (FieldSize != 4) && (FieldSize != 8)) {
- return EFI_INVALID_PARAMETER;
- }
-
- // Compute base address
- DstBaseAddress = Device->BaseAddress +
- VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_MMIO + FieldOffset;
-
- //
- // The device-specific memory area of Virtio-MMIO can only be written in
- // byte accesses. This is not currently in the Virtio spec.
- //
- MmioWriteBuffer8 (DstBaseAddress, FieldSize, (UINT8*)&Value);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioMmioDeviceRead (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- )
-{
- UINTN SrcBaseAddress;
- VIRTIO_MMIO_DEVICE *Device;
-
- Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- // Parameter validation
- ASSERT (FieldSize == BufferSize);
-
- // Double-check fieldsize
- if (FieldSize > 8) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((FieldSize != 1) && (FieldSize != 2) &&
- (FieldSize != 4) && (FieldSize != 8)) {
- return EFI_INVALID_PARAMETER;
- }
-
- // Compute base address
- SrcBaseAddress = Device->BaseAddress +
- VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_MMIO + FieldOffset;
-
- //
- // The device-specific memory area of Virtio-MMIO can only be read in
- // byte reads. This is not currently in the Virtio spec.
- //
- MmioReadBuffer8 (SrcBaseAddress, BufferSize, Buffer);
-
- return EFI_SUCCESS;
-}
+/** @file
+
+ This driver produces Virtio Device Protocol instances for Virtio MMIO devices.
+
+ Copyright (C) 2012, Red Hat, Inc.
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2013, ARM Ltd.
+
+ 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 "VirtioMmioDevice.h"
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetDeviceFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *DeviceFeatures
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ if (DeviceFeatures == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ *DeviceFeatures = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_HOST_FEATURES);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetQueueAddress (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *QueueAddress
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ if (QueueAddress == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ *QueueAddress = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_QUEUE_PFN);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetQueueSize (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT16 *QueueNumMax
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ if (QueueNumMax == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ *QueueNumMax = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_QUEUE_NUM_MAX) & 0xFFFF;
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioGetDeviceStatus (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT8 *DeviceStatus
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ if (DeviceStatus == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ *DeviceStatus = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_STATUS) & 0xFF;
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 QueueSize
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_NUM, QueueSize);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetDeviceStatus (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT8 DeviceStatus
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_STATUS, DeviceStatus);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueNotify (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 QueueNotify
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_NOTIFY, QueueNotify);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueAlignment (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Alignment
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_ALIGN, Alignment);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetPageSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 PageSize
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ if (PageSize != EFI_PAGE_SIZE) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_PAGE_SIZE, PageSize);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetQueueSel (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Sel
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_SEL, Sel);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+VirtioMmioSetQueueAddress (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Address
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_QUEUE_PFN, Address);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioSetGuestFeatures (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Features
+ )
+{
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ VIRTIO_CFG_WRITE (Device, VIRTIO_MMIO_OFFSET_GUEST_FEATURES, Features);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioDeviceWrite (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ )
+{
+ UINTN DstBaseAddress;
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ //
+ // Double-check fieldsize
+ //
+ if ((FieldSize != 1) && (FieldSize != 2) &&
+ (FieldSize != 4) && (FieldSize != 8)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Compute base address
+ //
+ DstBaseAddress = Device->BaseAddress +
+ VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_MMIO + FieldOffset;
+
+ //
+ // The device-specific memory area of Virtio-MMIO can only be written in
+ // byte accesses. This is not currently in the Virtio spec.
+ //
+ MmioWriteBuffer8 (DstBaseAddress, FieldSize, (UINT8*)&Value);
+
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioMmioDeviceRead (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ )
+{
+ UINTN SrcBaseAddress;
+ VIRTIO_MMIO_DEVICE *Device;
+
+ Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ //
+ // Parameter validation
+ //
+ ASSERT (FieldSize == BufferSize);
+
+ //
+ // Double-check fieldsize
+ //
+ if ((FieldSize != 1) && (FieldSize != 2) &&
+ (FieldSize != 4) && (FieldSize != 8)) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Compute base address
+ //
+ SrcBaseAddress = Device->BaseAddress +
+ VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_MMIO + FieldOffset;
+
+ //
+ // The device-specific memory area of Virtio-MMIO can only be read in
+ // byte reads. This is not currently in the Virtio spec.
+ //
+ MmioReadBuffer8 (SrcBaseAddress, BufferSize, Buffer);
+
+ return EFI_SUCCESS;
+}
diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
index 0758375aa..2e266a9d4 100644
--- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
+++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
@@ -1,43 +1,42 @@
-## @file
-# This driver produces the VirtIo Device Protocol instances for VirtIo Mmio
-# Device
-#
-# Copyright (C) 2013, ARM Ltd
-#
-# 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 = 0x00010006
- BASE_NAME = VirtioMmioDeviceLib
- FILE_GUID = 3b6ed966-b5d1-46a8-965b-867ff22d9c89
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = VirtioMmioDeviceLib
-
-[Sources]
- VirtioMmioDevice.c
- VirtioMmioDeviceFunctions.c
-
-[Packages]
- MdePkg/MdePkg.dec
- OvmfPkg/OvmfPkg.dec
-
-[LibraryClasses]
- BaseMemoryLib
- DebugLib
- IoLib
- MemoryAllocationLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- UefiLib
-
-[Protocols]
- gVirtioDeviceProtocolGuid ## PRODUCES
+## @file
+# This driver produces the VirtIo Device Protocol instances for VirtIo Mmio
+# Device
+#
+# Copyright (C) 2013, ARM Ltd
+#
+# 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 = 0x00010006
+ BASE_NAME = VirtioMmioDeviceLib
+ FILE_GUID = 3b6ed966-b5d1-46a8-965b-867ff22d9c89
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = VirtioMmioDeviceLib
+
+[Sources]
+ VirtioMmioDevice.c
+ VirtioMmioDeviceFunctions.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ BaseMemoryLib
+ DebugLib
+ IoLib
+ MemoryAllocationLib
+ UefiBootServicesTableLib
+ UefiLib
+
+[Protocols]
+ gVirtioDeviceProtocolGuid ## PRODUCES
diff --git a/OvmfPkg/OvmfPkg.dec b/OvmfPkg/OvmfPkg.dec
index 3d4e7bcd9..9d7fedf4d 100644
--- a/OvmfPkg/OvmfPkg.dec
+++ b/OvmfPkg/OvmfPkg.dec
@@ -44,7 +44,7 @@
gEfiXenInfoGuid = {0xd3b46f3b, 0xd441, 0x1244, {0x9a, 0x12, 0x0, 0x12, 0x27, 0x3f, 0xc1, 0x4d}}
[Protocols]
- gVirtioDeviceProtocolGuid = {0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}}
+ gVirtioDeviceProtocolGuid = {0xfa920010, 0x6785, 0x4941, {0xb6, 0xec, 0x49, 0x8c, 0x57, 0x9f, 0x16, 0x0a}}
gBlockMmioProtocolGuid = {0x6b558ce3, 0x69e5, 0x4c67, {0xa6, 0x34, 0xf7, 0xfe, 0x72, 0xad, 0xbe, 0x84}}
[PcdsFixedAtBuild]
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 860a73e96..c7c90fb3d 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -127,6 +127,7 @@
!endif
[LibraryClasses.common.SEC]
+ QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
!ifdef $(DEBUG_ON_SERIAL_PORT)
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
!else
@@ -322,6 +323,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -386,7 +388,10 @@
UefiCpuPkg/CpuDxe/CpuDxe.inf
PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+ MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
+ <LibraryClasses>
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+ }
PcAtChipsetPkg/KbcResetDxe/Reset.inf
MdeModulePkg/Universal/Metronome/Metronome.inf {
<LibraryClasses>
@@ -407,7 +412,7 @@
}
OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+ OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index af3890c0e..c6e186f26 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -266,7 +266,7 @@ INF MdeModulePkg/Universal/Metronome/Metronome.inf
INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
-INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 829341ca8..b8c569a14 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -132,6 +132,7 @@
!endif
[LibraryClasses.common.SEC]
+ QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
!ifdef $(DEBUG_ON_SERIAL_PORT)
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
!else
@@ -328,6 +329,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -393,7 +395,10 @@
UefiCpuPkg/CpuDxe/CpuDxe.inf
PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+ MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
+ <LibraryClasses>
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+ }
PcAtChipsetPkg/KbcResetDxe/Reset.inf
MdeModulePkg/Universal/Metronome/Metronome.inf {
<LibraryClasses>
@@ -414,7 +419,7 @@
}
OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+ OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 9aa47740b..615451dbe 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -266,7 +266,7 @@ INF MdeModulePkg/Universal/Metronome/Metronome.inf
INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
-INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 96067f3e3..7b1fa5217 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -132,6 +132,7 @@
!endif
[LibraryClasses.common.SEC]
+ QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf
!ifdef $(DEBUG_ON_SERIAL_PORT)
DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
!else
@@ -327,6 +328,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE
################################################################################
@@ -391,7 +393,10 @@
UefiCpuPkg/CpuDxe/CpuDxe.inf
PcAtChipsetPkg/8254TimerDxe/8254Timer.inf
PcAtChipsetPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
+ MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf {
+ <LibraryClasses>
+ PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
+ }
PcAtChipsetPkg/KbcResetDxe/Reset.inf
MdeModulePkg/Universal/Metronome/Metronome.inf {
<LibraryClasses>
@@ -412,7 +417,7 @@
}
OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+ OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index d7221950b..911fe0898 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -266,7 +266,7 @@ INF MdeModulePkg/Universal/Metronome/Metronome.inf
INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.inf
INF OvmfPkg/BlockMmioToBlockIoDxe/BlockIo.inf
-INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
INF OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
INF OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 9f6ca1942..a1de76268 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -83,30 +83,23 @@ GetSystemMemorySizeAbove4gb (
return LShiftU64 (Size, 16);
}
-
/**
- Peform Memory Detection
+ Publish PEI core memory
@return EFI_SUCCESS The PEIM initialized successfully.
**/
-EFI_PHYSICAL_ADDRESS
-MemDetect (
+EFI_STATUS
+PublishPeiMemory (
+ VOID
)
{
EFI_STATUS Status;
EFI_PHYSICAL_ADDRESS MemoryBase;
UINT64 MemorySize;
UINT64 LowerMemorySize;
- UINT64 UpperMemorySize;
- DEBUG ((EFI_D_ERROR, "MemDetect called\n"));
-
- //
- // Determine total memory size available
- //
LowerMemorySize = GetSystemMemorySizeBelow4gb ();
- UpperMemorySize = GetSystemMemorySizeAbove4gb ();
//
// Determine the range of memory to use during PEI
@@ -124,14 +117,40 @@ MemDetect (
Status = PublishSystemMemory(MemoryBase, MemorySize);
ASSERT_EFI_ERROR (Status);
+ return Status;
+}
+
+
+/**
+ Peform Memory Detection
+
+ @return Top of memory
+
+**/
+EFI_PHYSICAL_ADDRESS
+MemDetect (
+ )
+{
+ UINT64 LowerMemorySize;
+ UINT64 UpperMemorySize;
+
+ DEBUG ((EFI_D_ERROR, "MemDetect called\n"));
+
+ //
+ // Determine total memory size available
+ //
+ LowerMemorySize = GetSystemMemorySizeBelow4gb ();
+ UpperMemorySize = GetSystemMemorySizeAbove4gb ();
+
+ PublishPeiMemory ();
+
//
// Create memory HOBs
//
- AddMemoryBaseSizeHob (MemoryBase, MemorySize);
- AddMemoryRangeHob (BASE_1MB, MemoryBase);
+ AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
- MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack);
+ MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, CacheWriteBack);
MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
@@ -141,6 +160,6 @@ MemDetect (
MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
}
- return MemoryBase + MemorySize;
+ return LowerMemorySize;
}
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index fb56e999e..7363702be 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -34,6 +34,10 @@
#include <Guid/MemoryTypeInformation.h>
#include <Ppi/MasterBootMode.h>
#include <IndustryStandard/Pci22.h>
+#include <Guid/XenInfo.h>
+#include <IndustryStandard/E820.h>
+#include <Library/ResourcePublicationLib.h>
+#include <Library/MtrrLib.h>
#include "Platform.h"
#include "Cmos.h"
@@ -163,6 +167,74 @@ AddUntestedMemoryRangeHob (
AddUntestedMemoryBaseSizeHob (MemoryBase, (UINT64)(MemoryLimit - MemoryBase));
}
+VOID
+XenMemMapInitialization (
+ VOID
+ )
+{
+ EFI_E820_ENTRY64 *E820Map;
+ UINT32 E820EntriesCount;
+ EFI_STATUS Status;
+
+ DEBUG ((EFI_D_INFO, "Using memory map provided by Xen\n"));
+
+ //
+ // Create Memory Type Information HOB
+ //
+ BuildGuidDataHob (
+ &gEfiMemoryTypeInformationGuid,
+ mDefaultMemoryTypeInformation,
+ sizeof(mDefaultMemoryTypeInformation)
+ );
+
+ //
+ // Add PCI IO Port space available for PCI resource allocations.
+ //
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_IO,
+ EFI_RESOURCE_ATTRIBUTE_PRESENT |
+ EFI_RESOURCE_ATTRIBUTE_INITIALIZED,
+ 0xC000,
+ 0x4000
+ );
+
+ //
+ // Video memory + Legacy BIOS region
+ //
+ AddIoMemoryRangeHob (0x0A0000, BASE_1MB);
+
+ //
+ // Parse RAM in E820 map
+ //
+ Status = XenGetE820Map(&E820Map, &E820EntriesCount);
+
+ ASSERT_EFI_ERROR (Status);
+
+ if (E820EntriesCount > 0) {
+ EFI_E820_ENTRY64 *Entry;
+ UINT32 Loop;
+
+ for (Loop = 0; Loop < E820EntriesCount; Loop++) {
+ Entry = E820Map + Loop;
+
+ //
+ // Only care about RAM
+ //
+ if (Entry->Type != EfiAcpiAddressRangeMemory) {
+ continue;
+ }
+
+ if (Entry->BaseAddr >= BASE_4GB) {
+ AddUntestedMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+ } else {
+ AddMemoryBaseSizeHob (Entry->BaseAddr, Entry->Length);
+ }
+
+ MtrrSetMemoryAttribute (Entry->BaseAddr, Entry->Length, CacheWriteBack);
+ }
+ }
+}
+
VOID
MemMapInitialization (
@@ -338,20 +410,37 @@ InitializePlatform (
)
{
EFI_PHYSICAL_ADDRESS TopOfMemory;
+ UINT32 XenLeaf;
+
+ TopOfMemory = 0;
DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n"));
DebugDumpCmos ();
- TopOfMemory = MemDetect ();
+ XenLeaf = XenDetect ();
+
+ if (XenLeaf != 0) {
+ PublishPeiMemory ();
+ PcdSetBool (PcdPciDisableBusEnumeration, TRUE);
+ } else {
+ TopOfMemory = MemDetect ();
+ }
- InitializeXen ();
+ if (XenLeaf != 0) {
+ DEBUG ((EFI_D_INFO, "Xen was detected\n"));
+ InitializeXen (XenLeaf);
+ }
ReserveEmuVariableNvStore ();
PeiFvInitialization ();
- MemMapInitialization (TopOfMemory);
+ if (XenLeaf != 0) {
+ XenMemMapInitialization ();
+ } else {
+ MemMapInitialization (TopOfMemory);
+ }
MiscInitialization ();
diff --git a/OvmfPkg/PlatformPei/Platform.h b/OvmfPkg/PlatformPei/Platform.h
index 383e6a436..5378b9d8e 100644
--- a/OvmfPkg/PlatformPei/Platform.h
+++ b/OvmfPkg/PlatformPei/Platform.h
@@ -15,6 +15,8 @@
#ifndef _PLATFORM_PEI_H_INCLUDED_
#define _PLATFORM_PEI_H_INCLUDED_
+#include <IndustryStandard/E820.h>
+
VOID
AddIoMemoryBaseSizeHob (
EFI_PHYSICAL_ADDRESS MemoryBase,
@@ -57,6 +59,11 @@ AddUntestedMemoryRangeHob (
EFI_PHYSICAL_ADDRESS MemoryLimit
);
+EFI_STATUS
+PublishPeiMemory (
+ VOID
+ );
+
EFI_PHYSICAL_ADDRESS
MemDetect (
VOID
@@ -69,7 +76,18 @@ PeiFvInitialization (
EFI_STATUS
InitializeXen (
+ UINT32 XenLeaf
+ );
+
+UINT32
+XenDetect (
VOID
);
+EFI_STATUS
+XenGetE820Map (
+ EFI_E820_ENTRY64 **Entries,
+ UINT32 *Count
+ );
+
#endif // _PLATFORM_PEI_H_INCLUDED_
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index 3d5cbbbc2..7fe9d471c 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -65,6 +65,7 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved
+ gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
[Ppis]
diff --git a/OvmfPkg/PlatformPei/Xen.c b/OvmfPkg/PlatformPei/Xen.c
index a720b91b9..8e5d79e8b 100644
--- a/OvmfPkg/PlatformPei/Xen.c
+++ b/OvmfPkg/PlatformPei/Xen.c
@@ -1,7 +1,7 @@
/**@file
Xen Platform PEI support
- Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2011, Andrei Warkentin <andreiw@motorola.com>
This program and the accompanying materials
@@ -29,9 +29,37 @@
#include <Guid/XenInfo.h>
#include "Platform.h"
+#include "Xen.h"
EFI_XEN_INFO mXenInfo;
+/**
+ Returns E820 map provided by Xen
+
+ @param Entries Pointer to E820 map
+ @param Count Number of entries
+
+ @return EFI_STATUS
+**/
+EFI_STATUS
+XenGetE820Map (
+ EFI_E820_ENTRY64 **Entries,
+ UINT32 *Count
+ )
+{
+ EFI_XEN_OVMF_INFO *Info =
+ (EFI_XEN_OVMF_INFO *)(UINTN) OVMF_INFO_PHYSICAL_ADDRESS;
+
+ if (AsciiStrCmp ((CHAR8 *) Info->Signature, "XenHVMOVMF")) {
+ return EFI_NOT_FOUND;
+ }
+
+ ASSERT (Info->E820 < MAX_ADDRESS);
+ *Entries = (EFI_E820_ENTRY64 *)(UINTN) Info->E820;
+ *Count = Info->E820EntriesCount;
+
+ return EFI_SUCCESS;
+}
/**
Connects to the Hypervisor.
@@ -119,19 +147,9 @@ XenDetect (
**/
EFI_STATUS
InitializeXen (
- VOID
+ UINT32 XenLeaf
)
{
- UINT32 XenLeaf;
-
- XenLeaf = XenDetect ();
-
- if (XenLeaf == 0) {
- return EFI_NOT_FOUND;
- }
-
- DEBUG ((EFI_D_INFO, "Xen was detected\n"));
-
XenConnect (XenLeaf);
//
diff --git a/OvmfPkg/PlatformPei/Xen.h b/OvmfPkg/PlatformPei/Xen.h
new file mode 100644
index 000000000..2a8a32be6
--- /dev/null
+++ b/OvmfPkg/PlatformPei/Xen.h
@@ -0,0 +1,45 @@
+/** @file
+ Ovmf info structure passed by Xen
+
+Copyright (c) 2013, Citrix Systems UK Ltd.<BR>
+
+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 __XEN_H__
+#define __XEN_H__
+
+#include <PiPei.h>
+
+// Physical address of OVMF info
+#define OVMF_INFO_PHYSICAL_ADDRESS 0x00001000
+
+// This structure must match the definition on Xen side
+#pragma pack(1)
+typedef struct {
+ CHAR8 Signature[14]; // XenHVMOVMF\0
+ UINT8 Length; // Length of this structure
+ UINT8 Checksum; // Set such that the sum over bytes 0..length == 0
+ //
+ // Physical address of an array of TablesCount elements.
+ //
+ // Each element contains the physical address of a BIOS table.
+ //
+ EFI_PHYSICAL_ADDRESS Tables;
+ UINT32 TablesCount;
+ //
+ // Physical address of the E820 table, contains E820EntriesCount entries.
+ //
+ EFI_PHYSICAL_ADDRESS E820;
+ UINT32 E820EntriesCount;
+} EFI_XEN_OVMF_INFO;
+#pragma pack()
+
+#endif /* __XEN_H__ */
diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
index a3fe7d874..f9c6f5c55 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.c
@@ -208,7 +208,7 @@ QemuFlashWrite (
// Restore flash to read mode
//
if (*NumBytes > 0) {
- *Ptr = READ_ARRAY_CMD;
+ *(Ptr - 1) = READ_ARRAY_CMD;
}
return EFI_SUCCESS;
diff --git a/OvmfPkg/QemuVideoDxe/Driver.c b/OvmfPkg/QemuVideoDxe/Driver.c
index 53718e1ae..b253ec734 100644
--- a/OvmfPkg/QemuVideoDxe/Driver.c
+++ b/OvmfPkg/QemuVideoDxe/Driver.c
@@ -209,6 +209,7 @@ QemuVideoControllerDriverStart (
PCI_TYPE00 Pci;
QEMU_VIDEO_CARD *Card;
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *MmioDesc;
+ EFI_PCI_IO_PROTOCOL *ChildPciIo;
PciAttributesSaved = FALSE;
//
@@ -419,6 +420,22 @@ QemuVideoControllerDriverStart (
&Private->GraphicsOutput,
NULL
);
+ if (EFI_ERROR (Status)) {
+ goto Error;
+ }
+
+ Status = gBS->OpenProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ (VOID **) &ChildPciIo,
+ This->DriverBindingHandle,
+ Private->Handle,
+ EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER
+ );
+
+ if (EFI_ERROR (Status)) {
+ goto Error;
+ }
}
Error:
@@ -440,7 +457,14 @@ Error:
// Close the PCI I/O Protocol
//
gBS->CloseProtocol (
- Private->Handle,
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Controller
+ );
+
+ gBS->CloseProtocol (
+ Controller,
&gEfiPciIoProtocolGuid,
This->DriverBindingHandle,
Private->Handle
@@ -533,6 +557,13 @@ QemuVideoControllerDriverStop (
Controller
);
+ gBS->CloseProtocol (
+ Controller,
+ &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle,
+ Private->Handle
+ );
+
//
// Free our instance data
//
diff --git a/OvmfPkg/README b/OvmfPkg/README
index f2c2fc799..be798063a 100644
--- a/OvmfPkg/README
+++ b/OvmfPkg/README
@@ -9,8 +9,6 @@ http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=OVMF
=== STATUS ===
-Current status: Alpha
-
Current capabilities:
* IA32 and X64 architectures
* QEMU (0.10.0 or later)
@@ -22,7 +20,6 @@ Current capabilities:
=== FUTURE PLANS ===
-* Stabilize UEFI Linux boot
* Test/Stabilize UEFI Self-Certification Tests (SCT) results
=== BUILDING OVMF ===
@@ -60,12 +57,23 @@ http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=How_to_build_OVM
=== RUNNING OVMF on QEMU ===
-* QEMU 0.9.1 or later is required.
-* Either copy, rename or symlink OVMF.FD => bios.bin
+* QEMU 0.12.2 or later is required.
* Be sure to use qemu-system-x86_64, if you are using and X64 firmware.
(qemu-system-x86_64 works for the IA32 firmware as well, of course.)
-* Use the QEMU -L parameter to specify the directory where the bios.bin
- file is located.
+* Use OVMF for QEMU firmware (3 options available)
+ - Option 1: QEMU 1.6 or newer; Use QEMU -pflash parameter
+ * QEMU/OVMF will use emulated flash, and fully support UEFI variables
+ * Run qemu with: -pflash path/to/OVMF.fd
+ - Option 2: Use QEMU -bios parameter
+ * Note that UEFI variables will be partially emulated, and non-volatile
+ variables may lose their contents after a reboot
+ * Run qemu with: -bios path/to/OVMF.fd
+ - Option 3: Use QEMU -L parameter
+ * Note that UEFI variables will be partially emulated, and non-volatile
+ variables may lose their contents after a reboot
+ * Either copy, rename or symlink OVMF.fd => bios.bin
+ * Use the QEMU -L parameter to specify the directory where the bios.bin
+ file is located.
* The EFI shell is built into OVMF builds at this time, so it should
run automatically if a UEFI boot application is not found on the
removable media.
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
index 08edf23fc..35fc88e35 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
@@ -36,14 +36,14 @@
/**
Convenience macros to read and write region 0 IO space elements of the
- virtio-blk device, for configuration purposes.
+ virtio-blk device, for configuration purposes.
The following macros make it possible to specify only the "core parameters"
for such accesses and to derive the rest. By the time VIRTIO_CFG_WRITE()
returns, the transaction will have been completed.
- @param[in] Dev Pointer to the VBLK_DEV structure whose VirtIo space
- we're accessing. Dev->VirtIo must be valid.
+ @param[in] Dev Pointer to the VBLK_DEV structure whose VirtIo space
+ we're accessing. Dev->VirtIo must be valid.
@param[in] Field A field name from VBLK_HDR, identifying the virtio-blk
configuration item to access.
@@ -56,23 +56,24 @@
one of UINT8, UINT16, UINT32, UINT64.
- @return Status code returned by Virtio->WriteDevice() / Virtio->ReadDevice().
+ @return Status code returned by Virtio->WriteDevice() /
+ Virtio->ReadDevice().
**/
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VBLK (Field), \
- SIZE_OF_VBLK (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VBLK (Field), \
+ SIZE_OF_VBLK (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VBLK (Field), \
- SIZE_OF_VBLK (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VBLK (Field), \
+ SIZE_OF_VBLK (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))
@@ -228,7 +229,7 @@ VerifyReadWriteRequest (
@retval EFI_SUCCESS Transfer complete.
- @retval EFI_DEVICE_ERROR Failed to notify host side via VirtIo write, or
+ @retval EFI_DEVICE_ERROR Failed to notify host side via VirtIo write, or
unable to parse host response, or host response
is not VIRTIO_BLK_S_OK.
@@ -323,7 +324,7 @@ SynchronousRequest (
//
// virtio-blk's only virtqueue is #0, called "requestq" (see Appendix D).
//
- if (VirtioFlush (Dev->VirtIo, 0, &Dev->Ring, &Indices) == EFI_SUCCESS &&
+ if (VirtioFlush (Dev->VirtIo, 0, &Dev->Ring, &Indices) == EFI_SUCCESS &&
HostStatus == VIRTIO_BLK_S_OK) {
return EFI_SUCCESS;
}
@@ -510,11 +511,11 @@ VirtioBlkFlushBlocks (
@retval EFI_SUCCESS The driver supports the device being probed.
- @retval EFI_UNSUPPORTED Based on virtio-blk discovery, we do not support
+ @retval EFI_UNSUPPORTED Based on virtio-blk discovery, we do not support
the device.
@return Error codes from the OpenProtocol() boot service or
- the VirtIo protocol.
+ the VirtIo protocol.
**/
@@ -527,36 +528,36 @@ VirtioBlkDriverBindingSupported (
)
{
EFI_STATUS Status;
- VIRTIO_DEVICE_PROTOCOL *VirtIo;
+ VIRTIO_DEVICE_PROTOCOL *VirtIo;
//
- // Attempt to open the device with the VirtIo set of interfaces. On success,
- // the protocol is "instantiated" for the VirtIo device. Covers duplicate open
- // attempts (EFI_ALREADY_STARTED).
+ // Attempt to open the device with the VirtIo set of interfaces. On success,
+ // the protocol is "instantiated" for the VirtIo device. Covers duplicate
+ // open attempts (EFI_ALREADY_STARTED).
//
Status = gBS->OpenProtocol (
DeviceHandle, // candidate device
- &gVirtioDeviceProtocolGuid, // for generic VirtIo access
- (VOID **)&VirtIo, // handle to instantiate
+ &gVirtioDeviceProtocolGuid, // for generic VirtIo access
+ (VOID **)&VirtIo, // handle to instantiate
This->DriverBindingHandle, // requestor driver identity
DeviceHandle, // ControllerHandle, according to
// the UEFI Driver Model
- EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
+ EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
// the device; to be released
);
if (EFI_ERROR (Status)) {
return Status;
}
- if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_BLOCK_DEVICE) {
- Status = EFI_UNSUPPORTED;
+ if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_BLOCK_DEVICE) {
+ Status = EFI_UNSUPPORTED;
}
//
- // We needed VirtIo access only transitorily, to see whether we support the
+ // We needed VirtIo access only transitorily, to see whether we support the
// device or not.
//
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
return Status;
}
@@ -568,8 +569,8 @@ VirtioBlkDriverBindingSupported (
device.
@param[in out] Dev The driver instance to configure. The caller is
- responsible for Dev->VirtIo's validity (ie. working IO
- access to the underlying virtio-blk device).
+ responsible for Dev->VirtIo's validity (ie. working IO
+ access to the underlying virtio-blk device).
@retval EFI_SUCCESS Setup complete.
@@ -594,46 +595,53 @@ VirtioBlkInit (
UINT32 Features;
UINT64 NumSectors;
UINT32 BlockSize;
+ UINT8 PhysicalBlockExp;
+ UINT8 AlignmentOffset;
+ UINT32 OptIoSize;
UINT16 QueueSize;
+ PhysicalBlockExp = 0;
+ AlignmentOffset = 0;
+ OptIoSize = 0;
+
//
// Execute virtio-0.9.5, 2.2.1 Device Initialization Sequence.
//
NextDevStat = 0; // step 1 -- reset device
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto Failed;
}
NextDevStat |= VSTAT_ACK; // step 2 -- acknowledge device presence
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto Failed;
}
NextDevStat |= VSTAT_DRIVER; // step 3 -- we know how to drive it
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ if (EFI_ERROR (Status)) {
+ goto Failed;
+ }
+
+ //
+ // Set Page Size - MMIO VirtIo Specific
+ //
+ Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
if (EFI_ERROR (Status)) {
goto Failed;
}
//
- // Set Page Size - MMIO VirtIo Specific
- //
- Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
- if (EFI_ERROR (Status)) {
- goto ReleaseQueue;
- }
-
- //
// step 4a -- retrieve and validate features
//
- Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
+ Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
if (EFI_ERROR (Status)) {
goto Failed;
}
-
- Status = VIRTIO_CFG_READ (Dev, Capacity, &NumSectors);
+
+ Status = VIRTIO_CFG_READ (Dev, Capacity, &NumSectors);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -643,7 +651,7 @@ VirtioBlkInit (
}
if (Features & VIRTIO_BLK_F_BLK_SIZE) {
- Status = VIRTIO_CFG_READ (Dev, BlkSize, &BlockSize);
+ Status = VIRTIO_CFG_READ (Dev, BlkSize, &BlockSize);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -661,14 +669,36 @@ VirtioBlkInit (
BlockSize = 512;
}
+ if (Features & VIRTIO_BLK_F_TOPOLOGY) {
+ Status = VIRTIO_CFG_READ (Dev, Topology.PhysicalBlockExp,
+ &PhysicalBlockExp);
+ if (EFI_ERROR (Status)) {
+ goto Failed;
+ }
+ if (PhysicalBlockExp >= 32) {
+ Status = EFI_UNSUPPORTED;
+ goto Failed;
+ }
+
+ Status = VIRTIO_CFG_READ (Dev, Topology.AlignmentOffset, &AlignmentOffset);
+ if (EFI_ERROR (Status)) {
+ goto Failed;
+ }
+
+ Status = VIRTIO_CFG_READ (Dev, Topology.OptIoSize, &OptIoSize);
+ if (EFI_ERROR (Status)) {
+ goto Failed;
+ }
+ }
+
//
// step 4b -- allocate virtqueue
//
- Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, 0);
+ Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, 0);
if (EFI_ERROR (Status)) {
goto Failed;
}
- Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
+ Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -683,31 +713,36 @@ VirtioBlkInit (
}
//
- // Additional steps for MMIO: align the queue appropriately, and set the size
- Dev->VirtIo->SetQueueNum (Dev->VirtIo, QueueSize);
- Status = Dev->VirtIo->SetQueueAlign (Dev->VirtIo, EFI_PAGE_SIZE);
- if (EFI_ERROR (Status)) {
- goto ReleaseQueue;
- }
-
- //
- // step 4c -- Report GPFN (guest-physical frame number) of queue. If anything
- // fails from here on, we must release the ring resources.
+ // Additional steps for MMIO: align the queue appropriately, and set the
+ // size. If anything fails from here on, we must release the ring resources.
//
- Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
- (UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT);
+ Status = Dev->VirtIo->SetQueueNum (Dev->VirtIo, QueueSize);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
-
+ Status = Dev->VirtIo->SetQueueAlign (Dev->VirtIo, EFI_PAGE_SIZE);
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+ //
+ // step 4c -- Report GPFN (guest-physical frame number) of queue.
+ //
+ Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
+ (UINT32) ((UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT));
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+
//
// step 5 -- Report understood features. There are no virtio-blk specific
// features to negotiate in virtio-0.9.5, plus we do not want any of the
// device-independent (known or unknown) VIRTIO_F_* capabilities (see
// Appendix B).
//
- Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, 0);
+ Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, 0);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
@@ -716,15 +751,14 @@ VirtioBlkInit (
// step 6 -- initialization complete
//
NextDevStat |= VSTAT_DRIVER_OK;
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
//
- // Populate the exported interface's attributes; see UEFI spec v2.3.1 +
- // Errata C, 12.8 EFI Block I/O Protocol. We stick to the lowest possible
- // EFI_BLOCK_IO_PROTOCOL revision for now.
+ // Populate the exported interface's attributes; see UEFI spec v2.4, 12.9 EFI
+ // Block I/O Protocol.
//
Dev->BlockIo.Revision = 0;
Dev->BlockIo.Media = &Dev->BlockIoMedia;
@@ -742,6 +776,24 @@ VirtioBlkInit (
Dev->BlockIoMedia.IoAlign = 0;
Dev->BlockIoMedia.LastBlock = DivU64x32 (NumSectors,
BlockSize / 512) - 1;
+
+ DEBUG ((DEBUG_INFO, "%a: LbaSize=0x%x[B] NumBlocks=0x%Lx[Lba]\n",
+ __FUNCTION__, Dev->BlockIoMedia.BlockSize,
+ Dev->BlockIoMedia.LastBlock + 1));
+
+ if (Features & VIRTIO_BLK_F_TOPOLOGY) {
+ Dev->BlockIo.Revision = EFI_BLOCK_IO_PROTOCOL_REVISION3;
+
+ Dev->BlockIoMedia.LowestAlignedLba = AlignmentOffset;
+ Dev->BlockIoMedia.LogicalBlocksPerPhysicalBlock = 1u << PhysicalBlockExp;
+ Dev->BlockIoMedia.OptimalTransferLengthGranularity = OptIoSize;
+
+ DEBUG ((DEBUG_INFO, "%a: FirstAligned=0x%Lx[Lba] PhysBlkSize=0x%x[Lba]\n",
+ __FUNCTION__, Dev->BlockIoMedia.LowestAlignedLba,
+ Dev->BlockIoMedia.LogicalBlocksPerPhysicalBlock));
+ DEBUG ((DEBUG_INFO, "%a: OptimalTransferLengthGranularity=0x%x[Lba]\n",
+ __FUNCTION__, Dev->BlockIoMedia.OptimalTransferLengthGranularity));
+ }
return EFI_SUCCESS;
ReleaseQueue:
@@ -750,10 +802,10 @@ ReleaseQueue:
Failed:
//
// Notify the host about our failure to setup: virtio-0.9.5, 2.2.2.1 Device
- // Status. VirtIo access failure here should not mask the original error.
+ // Status. VirtIo access failure here should not mask the original error.
//
NextDevStat |= VSTAT_FAILED;
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
return Status; // reached only via Failed above
}
@@ -780,7 +832,7 @@ VirtioBlkUninit (
// VIRTIO_CFG_WRITE() returns, the host will have learned to stay away from
// the old comms area.
//
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
VirtioRingUninit (&Dev->Ring);
@@ -807,13 +859,13 @@ VirtioBlkUninit (
@retval EFI_SUCCESS Driver instance has been created and
- initialized for the virtio-blk device, it
+ initialized for the virtio-blk device, it
is now accessibla via EFI_BLOCK_IO_PROTOCOL.
@retval EFI_OUT_OF_RESOURCES Memory allocation failed.
@return Error codes from the OpenProtocol() boot
- service, the VirtIo protocol, VirtioBlkInit(),
+ service, the VirtIo protocol, VirtioBlkInit(),
or the InstallProtocolInterface() boot service.
**/
@@ -834,23 +886,19 @@ VirtioBlkDriverBindingStart (
return EFI_OUT_OF_RESOURCES;
}
- Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
- (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
+ Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
if (EFI_ERROR (Status)) {
goto FreeVirtioBlk;
}
- if (Dev->VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_BLOCK_DEVICE) {
- return EFI_UNSUPPORTED;
- }
-
//
- // VirtIo access granted, configure virtio-blk device.
+ // VirtIo access granted, configure virtio-blk device.
//
Status = VirtioBlkInit (Dev);
if (EFI_ERROR (Status)) {
- goto CloseVirtIo;
+ goto CloseVirtIo;
}
//
@@ -869,8 +917,8 @@ VirtioBlkDriverBindingStart (
UninitDev:
VirtioBlkUninit (Dev);
-CloseVirtIo:
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+CloseVirtIo:
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
FreeVirtioBlk:
@@ -941,7 +989,7 @@ VirtioBlkDriverBindingStop (
VirtioBlkUninit (Dev);
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
FreePool (Dev);
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.h b/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
index 43dd5064d..789caf9a3 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.h
@@ -33,13 +33,13 @@ typedef struct {
// at various call depths. The table to the right should make it easier to
// track them.
//
- // field init function init dpth
- // --------------------- ------------------ ---------
- UINT32 Signature; // DriverBindingStart 0
- VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
- VRING Ring; // VirtioRingInit 2
- EFI_BLOCK_IO_PROTOCOL BlockIo; // VirtioBlkInit 1
- EFI_BLOCK_IO_MEDIA BlockIoMedia; // VirtioBlkInit 1
+ // field init function init dpth
+ // --------------------- ------------------ ---------
+ UINT32 Signature; // DriverBindingStart 0
+ VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
+ VRING Ring; // VirtioRingInit 2
+ EFI_BLOCK_IO_PROTOCOL BlockIo; // VirtioBlkInit 1
+ EFI_BLOCK_IO_MEDIA BlockIoMedia; // VirtioBlkInit 1
} VBLK_DEV;
#define VIRTIO_BLK_FROM_BLOCK_IO(BlockIoPointer) \
@@ -75,10 +75,10 @@ typedef struct {
@retval EFI_SUCCESS The driver supports the device being probed.
- @retval EFI_UNSUPPORTED Based on virtio-blk discovery, we do not support
+ @retval EFI_UNSUPPORTED Based on virtio-blk discovery, we do not support
the device.
- @return Error codes from the OpenProtocol() boot service.
+ @return Error codes from the OpenProtocol() boot service.
**/
@@ -109,14 +109,14 @@ VirtioBlkDriverBindingSupported (
@retval EFI_SUCCESS Driver instance has been created and
- initialized for the virtio-blk device, it
+ initialized for the virtio-blk device, it
is now accessibla via EFI_BLOCK_IO_PROTOCOL.
@retval EFI_OUT_OF_RESOURCES Memory allocation failed.
@return Error codes from the OpenProtocol() boot
- service, VirtioBlkInit(), or the
- InstallProtocolInterface() boot service.
+ service, VirtioBlkInit(), or the
+ InstallProtocolInterface() boot service.
**/
diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.inf b/OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
index 86266b26c..d5975b74e 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
@@ -38,5 +38,5 @@
VirtioLib
[Protocols]
- gEfiBlockIoProtocolGuid ## BY_START
- gVirtioDeviceProtocolGuid ## TO_START
+ gEfiBlockIoProtocolGuid ## BY_START
+ gVirtioDeviceProtocolGuid ## TO_START
diff --git a/OvmfPkg/VirtioNetDxe/ComponentName.c b/OvmfPkg/VirtioNetDxe/ComponentName.c
index 1a43448fd..2c96adbcb 100644
--- a/OvmfPkg/VirtioNetDxe/ComponentName.c
+++ b/OvmfPkg/VirtioNetDxe/ComponentName.c
@@ -139,20 +139,20 @@ VirtioNetGetControllerName (
}
//
- // confirm that the device is managed by this driver, using the VirtIo
+ // confirm that the device is managed by this driver, using the VirtIo
// Protocol
//
Status = EfiTestManagedDevice (
ControllerHandle,
gVirtioNetDriverBinding.DriverBindingHandle,
- &gVirtioDeviceProtocolGuid
+ &gVirtioDeviceProtocolGuid
);
if (EFI_ERROR (Status)) {
return Status;
}
//
- // we don't give different names to the bus (= parent) handle and the
+ // we don't give different names to the bus (= parent) handle and the
// child (= MAC) handle
//
return LookupUnicodeString2 (
diff --git a/OvmfPkg/VirtioNetDxe/DriverBinding.c b/OvmfPkg/VirtioNetDxe/DriverBinding.c
index f92a447f0..93995c635 100644
--- a/OvmfPkg/VirtioNetDxe/DriverBinding.c
+++ b/OvmfPkg/VirtioNetDxe/DriverBinding.c
@@ -49,8 +49,7 @@
unused.
@retval EFI_UNSUPPORTED The host doesn't supply a MAC address.
- @return Status codes from Dev->VirtIo->Io.Read(),
- VIRTIO_CFG_READ() and VIRTIO_CFG_WRITE().
+ @return Status codes from VirtIo protocol members.
@retval EFI_SUCCESS Configuration values retrieved.
*/
STATIC
@@ -66,6 +65,7 @@ VirtioNetGetFeatures (
EFI_STATUS Status;
UINT8 NextDevStat;
UINT32 Features;
+ UINTN MacIdx;
UINT16 LinkStatus;
//
@@ -73,19 +73,19 @@ VirtioNetGetFeatures (
// Initialization Sequence), but don't complete setting it up.
//
NextDevStat = 0; // step 1 -- reset device
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
return Status;
}
NextDevStat |= VSTAT_ACK; // step 2 -- acknowledge device presence
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto YieldDevice;
}
NextDevStat |= VSTAT_DRIVER; // step 3 -- we know how to drive it
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto YieldDevice;
}
@@ -93,7 +93,7 @@ VirtioNetGetFeatures (
//
// step 4a -- retrieve and validate features
//
- Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
+ Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
if (EFI_ERROR (Status)) {
goto YieldDevice;
}
@@ -105,15 +105,16 @@ VirtioNetGetFeatures (
Status = EFI_UNSUPPORTED;
goto YieldDevice;
}
- Status = Dev->VirtIo->ReadDevice (Dev->VirtIo,
- OFFSET_OF_VNET (Mac), // Offset
- sizeof(UINT8), // FieldSize
- SIZE_OF_VNET (Mac), // BufferSize
- MacAddress // Buffer
- );
-
- if (EFI_ERROR (Status)) {
- goto YieldDevice;
+ for (MacIdx = 0; MacIdx < SIZE_OF_VNET (Mac); ++MacIdx) {
+ Status = Dev->VirtIo->ReadDevice (Dev->VirtIo,
+ OFFSET_OF_VNET (Mac) + MacIdx, // Offset
+ 1, // FieldSize
+ 1, // BufferSize
+ &MacAddress->Addr[MacIdx] // Buffer
+ );
+ if (EFI_ERROR (Status)) {
+ goto YieldDevice;
+ }
}
//
@@ -124,7 +125,7 @@ VirtioNetGetFeatures (
}
else {
*MediaPresentSupported = TRUE;
- Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);
+ Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);
if (EFI_ERROR (Status)) {
goto YieldDevice;
}
@@ -132,7 +133,7 @@ VirtioNetGetFeatures (
}
YieldDevice:
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo,
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo,
EFI_ERROR (Status) ? VSTAT_FAILED : 0);
return Status;
@@ -205,9 +206,9 @@ VirtioNetSnpPopulate (
Dev->Snp.Mode = &Dev->Snm;
Dev->Snm.State = EfiSimpleNetworkStopped;
- Dev->Snm.HwAddressSize = SIZE_OF_VNET (Mac);
- Dev->Snm.MediaHeaderSize = SIZE_OF_VNET (Mac) + // dst MAC
- SIZE_OF_VNET (Mac) + // src MAC
+ Dev->Snm.HwAddressSize = SIZE_OF_VNET (Mac);
+ Dev->Snm.MediaHeaderSize = SIZE_OF_VNET (Mac) + // dst MAC
+ SIZE_OF_VNET (Mac) + // src MAC
2; // Ethertype
Dev->Snm.MaxPacketSize = 1500;
Dev->Snm.NvRamSize = 0;
@@ -220,7 +221,7 @@ VirtioNetSnpPopulate (
Dev->Snm.MacAddressChangeable = FALSE;
Dev->Snm.MultipleTxSupported = TRUE;
- ASSERT (SIZE_OF_VNET (Mac) <= sizeof (EFI_MAC_ADDRESS));
+ ASSERT (SIZE_OF_VNET (Mac) <= sizeof (EFI_MAC_ADDRESS));
Status = VirtioNetGetFeatures (Dev, &Dev->Snm.CurrentAddress,
&Dev->Snm.MediaPresentSupported, &Dev->Snm.MediaPresent);
@@ -228,8 +229,8 @@ VirtioNetSnpPopulate (
goto CloseWaitForPacket;
}
CopyMem (&Dev->Snm.PermanentAddress, &Dev->Snm.CurrentAddress,
- SIZE_OF_VNET (Mac));
- SetMem (&Dev->Snm.BroadcastAddress, SIZE_OF_VNET (Mac), 0xFF);
+ SIZE_OF_VNET (Mac));
+ SetMem (&Dev->Snm.BroadcastAddress, SIZE_OF_VNET (Mac), 0xFF);
//
// VirtioNetExitBoot() is queued by ExitBootServices(); its purpose is to
@@ -346,36 +347,36 @@ VirtioNetDriverBindingSupported (
)
{
EFI_STATUS Status;
- VIRTIO_DEVICE_PROTOCOL *VirtIo;
-
- //
- // Attempt to open the device with the VirtIo set of interfaces. On success,
- // the protocol is "instantiated" for the VirtIo device. Covers duplicate open
- // attempts (EFI_ALREADY_STARTED).
- //
- Status = gBS->OpenProtocol (
- DeviceHandle, // candidate device
- &gVirtioDeviceProtocolGuid, // for generic VirtIo access
- (VOID **)&VirtIo, // handle to instantiate
- This->DriverBindingHandle, // requestor driver identity
- DeviceHandle, // ControllerHandle, according to
- // the UEFI Driver Model
- EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
- // the device; to be released
- );
+ VIRTIO_DEVICE_PROTOCOL *VirtIo;
+
+ //
+ // Attempt to open the device with the VirtIo set of interfaces. On success,
+ // the protocol is "instantiated" for the VirtIo device. Covers duplicate open
+ // attempts (EFI_ALREADY_STARTED).
+ //
+ Status = gBS->OpenProtocol (
+ DeviceHandle, // candidate device
+ &gVirtioDeviceProtocolGuid, // for generic VirtIo access
+ (VOID **)&VirtIo, // handle to instantiate
+ This->DriverBindingHandle, // requestor driver identity
+ DeviceHandle, // ControllerHandle, according to
+ // the UEFI Driver Model
+ EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
+ // the device; to be released
+ );
if (EFI_ERROR (Status)) {
return Status;
}
- if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_NETWORK_CARD) {
- Status = EFI_UNSUPPORTED;
- }
+ if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_NETWORK_CARD) {
+ Status = EFI_UNSUPPORTED;
+ }
//
- // We needed VirtIo access only transitorily, to see whether we support the
- // device or not.
+ // We needed VirtIo access only transitorily, to see whether we support the
+ // device or not.
//
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
return Status;
}
@@ -441,7 +442,7 @@ VirtioNetDriverBindingStart (
VNET_DEV *Dev;
EFI_DEVICE_PATH_PROTOCOL *DevicePath;
MAC_ADDR_DEVICE_PATH MacNode;
- VOID *ChildVirtIo;
+ VOID *ChildVirtIo;
//
// allocate space for the driver instance
@@ -452,28 +453,24 @@ VirtioNetDriverBindingStart (
}
Dev->Signature = VNET_SIG;
- Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
- (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
+ Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
if (EFI_ERROR (Status)) {
goto FreeVirtioNet;
}
- if (Dev->VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_NETWORK_CARD) {
- return EFI_UNSUPPORTED;
- }
-
//
// now we can run a basic one-shot virtio-net initialization required to
// retrieve the MAC address
//
Status = VirtioNetSnpPopulate (Dev);
if (EFI_ERROR (Status)) {
- goto CloseVirtIo;
+ goto CloseVirtIo;
}
//
- // get the device path of the virtio-net device -- one-shot open
+ // get the device path of the virtio-net device -- one-shot open
//
Status = gBS->OpenProtocol (DeviceHandle, &gEfiDevicePathProtocolGuid,
(VOID **)&DevicePath, This->DriverBindingHandle,
@@ -511,11 +508,11 @@ VirtioNetDriverBindingStart (
}
//
- // make a note that we keep this device open with VirtIo for the sake of this
+ // make a note that we keep this device open with VirtIo for the sake of this
// child
//
- Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
- &ChildVirtIo, This->DriverBindingHandle,
+ Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ &ChildVirtIo, This->DriverBindingHandle,
Dev->MacHandle, EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER);
if (EFI_ERROR (Status)) {
goto UninstallMultiple;
@@ -535,8 +532,8 @@ FreeMacDevicePath:
Evacuate:
VirtioNetSnpEvacuate (Dev);
-CloseVirtIo:
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+CloseVirtIo:
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
FreeVirtioNet:
@@ -621,7 +618,7 @@ VirtioNetDriverBindingStop (
Status = EFI_DEVICE_ERROR;
}
else {
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, Dev->MacHandle);
gBS->UninstallMultipleProtocolInterfaces (Dev->MacHandle,
&gEfiDevicePathProtocolGuid, Dev->MacDevicePath,
@@ -639,7 +636,7 @@ VirtioNetDriverBindingStop (
//
// release remaining resources, tied directly to the parent handle
//
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
return EFI_SUCCESS;
diff --git a/OvmfPkg/VirtioNetDxe/Events.c b/OvmfPkg/VirtioNetDxe/Events.c
index 4889580f3..5be1af6ff 100644
--- a/OvmfPkg/VirtioNetDxe/Events.c
+++ b/OvmfPkg/VirtioNetDxe/Events.c
@@ -86,6 +86,6 @@ VirtioNetExitBoot (
Dev = Context;
if (Dev->Snm.State == EfiSimpleNetworkInitialized) {
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
}
}
diff --git a/OvmfPkg/VirtioNetDxe/SnpGetStatus.c b/OvmfPkg/VirtioNetDxe/SnpGetStatus.c
index b92011561..4393d243a 100644
--- a/OvmfPkg/VirtioNetDxe/SnpGetStatus.c
+++ b/OvmfPkg/VirtioNetDxe/SnpGetStatus.c
@@ -90,7 +90,7 @@ VirtioNetGetStatus (
if (Dev->Snm.MediaPresentSupported) {
UINT16 LinkStatus;
- Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);
+ Status = VIRTIO_CFG_READ (Dev, LinkStatus, &LinkStatus);
if (EFI_ERROR (Status)) {
goto Exit;
}
diff --git a/OvmfPkg/VirtioNetDxe/SnpInitialize.c b/OvmfPkg/VirtioNetDxe/SnpInitialize.c
index 4352ab96b..223030af9 100644
--- a/OvmfPkg/VirtioNetDxe/SnpInitialize.c
+++ b/OvmfPkg/VirtioNetDxe/SnpInitialize.c
@@ -57,15 +57,15 @@ VirtioNetInitRing (
//
// step 4b -- allocate selected queue
//
- Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, Selector);
+ Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, Selector);
if (EFI_ERROR (Status)) {
return Status;
}
- Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
+ Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
if (EFI_ERROR (Status)) {
return Status;
}
-
+
//
// For each packet (RX and TX alike), we need two descriptors:
// one for the virtio-net request header, and another one for the data
@@ -79,13 +79,33 @@ VirtioNetInitRing (
}
//
+ // Additional steps for MMIO: align the queue appropriately, and set the
+ // size. If anything fails from here on, we must release the ring resources.
+ //
+ Status = Dev->VirtIo->SetQueueNum (Dev->VirtIo, QueueSize);
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+ Status = Dev->VirtIo->SetQueueAlign (Dev->VirtIo, EFI_PAGE_SIZE);
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+ //
// step 4c -- report GPFN (guest-physical frame number) of queue
//
- Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
- (UINTN) Ring->Base >> EFI_PAGE_SHIFT);
+ Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
+ (UINT32) ((UINTN) Ring->Base >> EFI_PAGE_SHIFT));
if (EFI_ERROR (Status)) {
- VirtioRingUninit (Ring);
+ goto ReleaseQueue;
}
+
+ return EFI_SUCCESS;
+
+ReleaseQueue:
+ VirtioRingUninit (Ring);
+
return Status;
}
@@ -288,9 +308,9 @@ VirtioNetInitRx (
// virtio-0.9.5, 2.4.1.4 Notifying the Device
//
MemoryFence ();
- Status = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_RX);
+ Status = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_RX);
if (EFI_ERROR (Status)) {
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
FreePool (Dev->RxBuf);
}
@@ -366,34 +386,34 @@ VirtioNetInitialize (
// virtio-0.9.5 spec, 2.2.1 Device Initialization Sequence.
//
NextDevStat = VSTAT_ACK; // step 2 -- acknowledge device presence
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto InitFailed;
}
NextDevStat |= VSTAT_DRIVER; // step 3 -- we know how to drive it
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ if (EFI_ERROR (Status)) {
+ goto DeviceFailed;
+ }
+
+ //
+ // Set Page Size - MMIO VirtIo Specific
+ //
+ Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
if (EFI_ERROR (Status)) {
goto DeviceFailed;
}
//
- // Set Page Size - MMIO VirtIo Specific
- //
- Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
- if (EFI_ERROR (Status)) {
- goto ReleaseTxRing;
- }
-
- //
// step 4a -- retrieve features. Note that we're past validating required
// features in VirtioNetGetFeatures().
//
- Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
+ Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
if (EFI_ERROR (Status)) {
goto DeviceFailed;
}
-
+
ASSERT (Features & VIRTIO_NET_F_MAC);
ASSERT (Dev->Snm.MediaPresentSupported ==
!!(Features & VIRTIO_NET_F_STATUS));
@@ -415,7 +435,7 @@ VirtioNetInitialize (
// step 5 -- keep only the features we want
//
Features &= VIRTIO_NET_F_MAC | VIRTIO_NET_F_STATUS;
- Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);
+ Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo, Features);
if (EFI_ERROR (Status)) {
goto ReleaseTxRing;
}
@@ -424,7 +444,7 @@ VirtioNetInitialize (
// step 6 -- virtio-net initialization complete
//
NextDevStat |= VSTAT_DRIVER_OK;
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto ReleaseTxRing;
}
@@ -450,7 +470,7 @@ ReleaseTxAux:
VirtioNetShutdownTx (Dev);
AbortDevice:
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
ReleaseTxRing:
VirtioRingUninit (&Dev->TxRing);
@@ -462,7 +482,7 @@ DeviceFailed:
//
// restore device status invariant for the EfiSimpleNetworkStarted state
//
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
InitFailed:
gBS->RestoreTPL (OldTpl);
diff --git a/OvmfPkg/VirtioNetDxe/SnpReceive.c b/OvmfPkg/VirtioNetDxe/SnpReceive.c
index ce87978f1..99abd7ebe 100644
--- a/OvmfPkg/VirtioNetDxe/SnpReceive.c
+++ b/OvmfPkg/VirtioNetDxe/SnpReceive.c
@@ -147,14 +147,14 @@ VirtioNetReceive (
CopyMem (Buffer, RxPtr, RxLen);
if (DestAddr != NULL) {
- CopyMem (DestAddr, RxPtr, SIZE_OF_VNET (Mac));
+ CopyMem (DestAddr, RxPtr, SIZE_OF_VNET (Mac));
}
- RxPtr += SIZE_OF_VNET (Mac);
+ RxPtr += SIZE_OF_VNET (Mac);
if (SrcAddr != NULL) {
- CopyMem (SrcAddr, RxPtr, SIZE_OF_VNET (Mac));
+ CopyMem (SrcAddr, RxPtr, SIZE_OF_VNET (Mac));
}
- RxPtr += SIZE_OF_VNET (Mac);
+ RxPtr += SIZE_OF_VNET (Mac);
if (Protocol != NULL) {
*Protocol = (UINT16) ((RxPtr[0] << 8) | RxPtr[1]);
@@ -177,7 +177,7 @@ RecycleDesc:
*Dev->RxRing.Avail.Idx = AvailIdx;
MemoryFence ();
- NotifyStatus = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_RX);
+ NotifyStatus = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_RX);
if (!EFI_ERROR (Status)) { // earlier error takes precedence
Status = NotifyStatus;
}
diff --git a/OvmfPkg/VirtioNetDxe/SnpShutdown.c b/OvmfPkg/VirtioNetDxe/SnpShutdown.c
index c05a22f65..01409c0ce 100644
--- a/OvmfPkg/VirtioNetDxe/SnpShutdown.c
+++ b/OvmfPkg/VirtioNetDxe/SnpShutdown.c
@@ -63,7 +63,7 @@ VirtioNetShutdown (
break;
}
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
VirtioNetShutdownRx (Dev);
VirtioNetShutdownTx (Dev);
VirtioRingUninit (&Dev->TxRing);
diff --git a/OvmfPkg/VirtioNetDxe/SnpTransmit.c b/OvmfPkg/VirtioNetDxe/SnpTransmit.c
index b2a364b96..7ca40d5d0 100644
--- a/OvmfPkg/VirtioNetDxe/SnpTransmit.c
+++ b/OvmfPkg/VirtioNetDxe/SnpTransmit.c
@@ -127,15 +127,15 @@ VirtioNetTransmit (
goto Exit;
}
Ptr = Buffer;
- ASSERT (SIZE_OF_VNET (Mac) <= sizeof (EFI_MAC_ADDRESS));
+ ASSERT (SIZE_OF_VNET (Mac) <= sizeof (EFI_MAC_ADDRESS));
- CopyMem (Ptr, DestAddr, SIZE_OF_VNET (Mac));
- Ptr += SIZE_OF_VNET (Mac);
+ CopyMem (Ptr, DestAddr, SIZE_OF_VNET (Mac));
+ Ptr += SIZE_OF_VNET (Mac);
CopyMem (Ptr,
(SrcAddr == NULL) ? &Dev->Snm.CurrentAddress : SrcAddr,
- SIZE_OF_VNET (Mac));
- Ptr += SIZE_OF_VNET (Mac);
+ SIZE_OF_VNET (Mac));
+ Ptr += SIZE_OF_VNET (Mac);
*Ptr++ = (UINT8) (*Protocol >> 8);
*Ptr++ = (UINT8) *Protocol;
@@ -161,7 +161,7 @@ VirtioNetTransmit (
*Dev->TxRing.Avail.Idx = AvailIdx;
MemoryFence ();
- Status = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_TX);
+ Status = Dev->VirtIo->SetQueueNotify (Dev->VirtIo, VIRTIO_NET_Q_TX);
Exit:
gBS->RestoreTPL (OldTpl);
diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.h b/OvmfPkg/VirtioNetDxe/VirtioNet.h
index a0e0b4337..2d3f3d87e 100644
--- a/OvmfPkg/VirtioNetDxe/VirtioNet.h
+++ b/OvmfPkg/VirtioNetDxe/VirtioNet.h
@@ -74,7 +74,7 @@ typedef struct {
// field init function
// ------------------ ------------------------------
UINT32 Signature; // VirtioNetDriverBindingStart
- VIRTIO_DEVICE_PROTOCOL *VirtIo; // VirtioNetDriverBindingStart
+ VIRTIO_DEVICE_PROTOCOL *VirtIo; // VirtioNetDriverBindingStart
EFI_SIMPLE_NETWORK_PROTOCOL Snp; // VirtioNetSnpPopulate
EFI_SIMPLE_NETWORK_MODE Snm; // VirtioNetSnpPopulate
EFI_EVENT ExitBoot; // VirtioNetSnpPopulate
@@ -107,19 +107,19 @@ typedef struct {
#define VIRTIO_NET_FROM_SNP(SnpPointer) \
CR (SnpPointer, VNET_DEV, Snp, VNET_SIG)
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VNET (Field), \
- SIZE_OF_VNET (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VNET (Field), \
+ SIZE_OF_VNET (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VNET (Field), \
- SIZE_OF_VNET (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VNET (Field), \
+ SIZE_OF_VNET (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))
//
diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.inf b/OvmfPkg/VirtioNetDxe/VirtioNet.inf
index dea01f3b9..a855ad4ac 100644
--- a/OvmfPkg/VirtioNetDxe/VirtioNet.inf
+++ b/OvmfPkg/VirtioNetDxe/VirtioNet.inf
@@ -57,4 +57,4 @@
[Protocols]
gEfiSimpleNetworkProtocolGuid ## BY_START
gEfiDevicePathProtocolGuid ## BY_START
- gVirtioDeviceProtocolGuid ## TO_START
+ gVirtioDeviceProtocolGuid ## TO_START
diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c
index b120d5f2c..2647bd391 100644
--- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c
+++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c
@@ -1,667 +1,680 @@
-/** @file
-
- This driver produces Virtio Device Protocol instances for Virtio PCI devices.
-
- Copyright (C) 2012, Red Hat, Inc.
- Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
- Copyright (C) 2013, ARM Ltd.
-
- 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 <IndustryStandard/Pci.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-
-#include "VirtioPciDevice.h"
-
-STATIC VIRTIO_DEVICE_PROTOCOL mDeviceProtocolTemplate = {
- 0, // Revision
- 0, // SubSystemDeviceId
- VirtioPciGetDeviceFeatures, // GetDeviceFeatures
- VirtioPciSetGuestFeatures, // SetGuestFeatures
- VirtioPciGetQueueAddress, // GetQueueAddress
- VirtioPciSetQueueAddress, // SetQueueAddress
- VirtioPciSetQueueSel, // SetQueueSel
- VirtioPciSetQueueNotify, // SetQueueNotify
- VirtioPciSetQueueAlignment, // SetQueueAlignment
- VirtioPciSetPageSize, // SetPageSize
- VirtioPciGetQueueSize, // GetQueueNumMax
- VirtioPciSetQueueSize, // SetQueueNum
- VirtioPciGetDeviceStatus, // GetDeviceStatus
- VirtioPciSetDeviceStatus, // SetDeviceStatus
- VirtioPciDeviceWrite, // WriteDevice
- VirtioPciDeviceRead // ReadDevice
-};
-
-/**
-
- Read a word from Region 0 of the device specified by PciIo.
-
- Region 0 must be an iomem region. This is an internal function for the PCI
- implementation of the protocol.
-
- @param[in] Dev Virtio PCI device.
-
- @param[in] FieldOffset Source offset.
-
- @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] BufferSize Number of bytes available in the target buffer. Must
- equal FieldSize.
-
- @param[out] Buffer Target buffer.
-
-
- @return Status code returned by PciIo->Io.Read().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioPciIoRead (
- IN VIRTIO_PCI_DEVICE *Dev,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- )
-{
- UINTN Count;
- EFI_PCI_IO_PROTOCOL_WIDTH Width;
- EFI_PCI_IO_PROTOCOL *PciIo;
-
- // The BufferSize must be a multiple of FieldSize
- ASSERT ((BufferSize % FieldSize) == 0);
-
- PciIo = Dev->PciIo;
- Count = BufferSize / FieldSize;
-
- switch (FieldSize) {
- case 1:
- Width = EfiPciIoWidthUint8;
- break;
-
- case 2:
- Width = EfiPciIoWidthUint16;
- break;
-
- case 8:
- // The 64bit PCI I/O is broken down into two 32bit reads to prevent
- // any alignment or width issues.
- // The UEFI spec says under EFI_PCI_IO_PROTOCOL.Io.Write():
- //
- // The I/O operations are carried out exactly as requested. The caller
- // is responsible for any alignment and I/O width issues which the
- // bus, device, platform, or type of I/O might require. For example on
- // some platforms, width requests of EfiPciIoWidthUint64 do not work
- Count = Count * 2;
- // fall through
-
- case 4:
- Width = EfiPciIoWidthUint32;
- break;
-
- default:
- ASSERT (FALSE);
- return EFI_INVALID_PARAMETER;
- }
-
- return PciIo->Io.Read (
- PciIo,
- Width,
- PCI_BAR_IDX0,
- FieldOffset,
- Count,
- Buffer
- );
-}
-
-/**
-
- Write a word into Region 0 of the device specified by PciIo.
-
- Region 0 must be an iomem region. This is an internal function for the PCI
- implementation of the protocol.
-
- @param[in] Dev Virtio PCI device.
-
- @param[in] FieldOffset Destination offset.
-
- @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] Value Little endian value to write, converted to UINT64.
- The least significant FieldSize bytes will be used.
-
-
- @return Status code returned by PciIo->Io.Write().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioPciIoWrite (
- IN VIRTIO_PCI_DEVICE *Dev,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- )
-{
- UINTN Count;
- EFI_PCI_IO_PROTOCOL_WIDTH Width;
- EFI_PCI_IO_PROTOCOL *PciIo;
-
- PciIo = Dev->PciIo;
- Count = 1;
-
- switch (FieldSize) {
- case 1:
- Width = EfiPciIoWidthUint8;
- break;
-
- case 2:
- Width = EfiPciIoWidthUint16;
- break;
-
- case 8:
- // The 64bit PCI I/O is broken down into two 32bit writes to prevent
- // any alignment or width issues.
- // The UEFI spec says under EFI_PCI_IO_PROTOCOL.Io.Write():
- //
- // The I/O operations are carried out exactly as requested. The caller
- // is responsible for any alignment and I/O width issues which the
- // bus, device, platform, or type of I/O might require. For example on
- // some platforms, width requests of EfiPciIoWidthUint64 do not work
- Count = Count * 2;
- // fall through
-
- case 4:
- Width = EfiPciIoWidthUint32;
- break;
-
- default:
- ASSERT (FALSE);
- return EFI_INVALID_PARAMETER;
- }
-
- return PciIo->Io.Write (
- PciIo,
- Width,
- PCI_BAR_IDX0,
- FieldOffset,
- Count,
- &Value
- );
-}
-
-/**
-
- Device probe function for this driver.
-
- The DXE core calls this function for any given device in order to see if the
- driver can drive the device.
-
- @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
- incorporating this driver (independently of
- any device).
-
- @param[in] DeviceHandle The device to probe.
-
- @param[in] RemainingDevicePath Relevant only for bus drivers, ignored.
-
-
- @retval EFI_SUCCESS The driver supports the device being probed.
-
- @retval EFI_UNSUPPORTED Based on virtio-pci discovery, we do not support
- the device.
-
- @return Error codes from the OpenProtocol() boot service or
- the PciIo protocol.
-
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceBindingSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- PCI_TYPE00 Pci;
-
- //
- // Attempt to open the device with the PciIo set of interfaces. On success,
- // the protocol is "instantiated" for the PCI device. Covers duplicate open
- // attempts (EFI_ALREADY_STARTED).
- //
- Status = gBS->OpenProtocol (
- DeviceHandle, // candidate device
- &gEfiPciIoProtocolGuid, // for generic PCI access
- (VOID **)&PciIo, // handle to instantiate
- This->DriverBindingHandle, // requestor driver identity
- DeviceHandle, // ControllerHandle, according to
- // the UEFI Driver Model
- EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive PciIo access to
- // the device; to be released
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- //
- // Read entire PCI configuration header for more extensive check ahead.
- //
- Status = PciIo->Pci.Read (
- PciIo, // (protocol, device)
- // handle
- EfiPciIoWidthUint32, // access width & copy
- // mode
- 0, // Offset
- sizeof Pci / sizeof (UINT32), // Count
- &Pci // target buffer
- );
-
- if (Status == EFI_SUCCESS) {
- //
- // virtio-0.9.5, 2.1 PCI Discovery
- //
- if ((Pci.Hdr.VendorId == VIRTIO_VENDOR_ID) &&
- (Pci.Hdr.DeviceId >= 0x1000) &&
- (Pci.Hdr.DeviceId <= 0x103F) &&
- (Pci.Hdr.RevisionID == 0x00)) {
- Status = EFI_SUCCESS;
- } else {
- Status = EFI_UNSUPPORTED;
- }
- }
-
- //
- // We needed PCI IO access only transitorily, to see whether we support the
- // device or not.
- //
- gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
-
- return Status;
-}
-
-/**
-
- Initialize the VirtIo PCI Device
-
- @param[in, out] Dev The driver instance to configure. The caller is
- responsible for Device->PciIo's validity (ie. working IO
- access to the underlying virtio-pci device).
-
- @retval EFI_SUCCESS Setup complete.
-
- @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
- provided address offset and read size.
-
- @return Error codes from PciIo->Pci.Read().
-
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-VirtioPciInit (
- IN OUT VIRTIO_PCI_DEVICE *Device
- )
-{
- EFI_STATUS Status;
- EFI_PCI_IO_PROTOCOL *PciIo;
- PCI_TYPE00 Pci;
-
- ASSERT (Device != NULL);
- PciIo = Device->PciIo;
- ASSERT (PciIo != NULL);
- ASSERT (PciIo->Pci.Read != NULL);
-
- Status = PciIo->Pci.Read (
- PciIo, // (protocol, device)
- // handle
- EfiPciIoWidthUint32, // access width & copy
- // mode
- 0, // Offset
- sizeof (Pci) / sizeof (UINT32), // Count
- &Pci // target buffer
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- // Copy protocol template
- CopyMem (&Device->VirtioDevice, &mDeviceProtocolTemplate,
- sizeof (VIRTIO_DEVICE_PROTOCOL));
-
- // Initialize the protocol interface attributes
- Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
- Device->VirtioDevice.SubSystemDeviceId = Pci.Device.SubsystemID;
-
- // Note: We don't support the MSI-X capability. If we did,
- // the offset would become 24 after enabling MSI-X.
- Device->DeviceSpecificConfigurationOffset =
- VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_PCI;
-
- return EFI_SUCCESS;
-}
-
-/**
-
- Uninitialize the internals of a virtio-pci device that has been successfully
- set up with VirtioPciInit().
-
- @param[in, out] Dev The device to clean up.
-
-**/
-
-STATIC
-VOID
-EFIAPI
-VirtioPciUninit (
- IN OUT VIRTIO_PCI_DEVICE *Device
- )
-{
- // Note: This function mirrors VirtioPciInit() that does not allocate any
- // resources - there's nothing to free here.
-}
-
-/**
-
- After we've pronounced support for a specific device in
- DriverBindingSupported(), we start managing said device (passed in by the
- Driver Exeuction Environment) with the following service.
-
- See DriverBindingSupported() for specification references.
-
- @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
- incorporating this driver (independently of
- any device).
-
- @param[in] DeviceHandle The supported device to drive.
-
- @param[in] RemainingDevicePath Relevant only for bus drivers, ignored.
-
-
- @retval EFI_SUCCESS Driver instance has been created and
- initialized for the virtio-pci device, it
- is now accessible via VIRTIO_DEVICE_PROTOCOL.
-
- @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
-
- @return Error codes from the OpenProtocol() boot
- service, the PciIo protocol, VirtioPciInit(),
- or the InstallProtocolInterface() boot service.
-
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceBindingStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- VIRTIO_PCI_DEVICE *Device;
- EFI_STATUS Status;
-
- Device = (VIRTIO_PCI_DEVICE *) AllocateZeroPool (sizeof *Device);
- if (Device == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Status = gBS->OpenProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- (VOID **)&Device->PciIo, This->DriverBindingHandle,
- DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
- if (EFI_ERROR (Status)) {
- goto FreeVirtioPci;
- }
-
- //
- // We must retain and ultimately restore the original PCI attributes of the
- // device. See Driver Writer's Guide for UEFI 2.3.1 v1.01, 18.3 PCI drivers /
- // 18.3.2 Start() and Stop().
- //
- // The third parameter ("Attributes", input) is ignored by the Get operation.
- // The fourth parameter ("Result", output) is ignored by the Enable and Set
- // operations.
- //
- // For virtio-pci we only need IO space access.
- //
- Status = Device->PciIo->Attributes (Device->PciIo,
- EfiPciIoAttributeOperationGet, 0, &Device->OriginalPciAttributes);
- if (EFI_ERROR (Status)) {
- goto ClosePciIo;
- }
-
- Status = Device->PciIo->Attributes (Device->PciIo,
- EfiPciIoAttributeOperationEnable,
- EFI_PCI_IO_ATTRIBUTE_IO, NULL);
- if (EFI_ERROR (Status)) {
- goto ClosePciIo;
- }
-
- //
- // PCI IO access granted, configure protocol instance
- //
-
- Status = VirtioPciInit (Device);
- if (EFI_ERROR (Status)) {
- goto RestorePciAttributes;
- }
-
- //
- // Setup complete, attempt to export the driver instance's VirtioDevice
- // interface.
- //
- Device->Signature = VIRTIO_PCI_DEVICE_SIGNATURE;
- Status = gBS->InstallProtocolInterface (&DeviceHandle,
- &gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
- &Device->VirtioDevice);
- if (EFI_ERROR (Status)) {
- goto UninitDev;
- }
-
- return EFI_SUCCESS;
-
-UninitDev:
- VirtioPciUninit (Device);
-
-RestorePciAttributes:
- Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
- Device->OriginalPciAttributes, NULL);
-
-ClosePciIo:
- gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
-
-FreeVirtioPci:
- FreePool (Device);
-
- return Status;
-}
-
-/**
-
- Stop driving the Virtio PCI device
-
- @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
- incorporating this driver (independently of any
- device).
-
- @param[in] DeviceHandle Stop driving this device.
-
- @param[in] NumberOfChildren Since this function belongs to a device driver
- only (as opposed to a bus driver), the caller
- environment sets NumberOfChildren to zero, and
- we ignore it.
-
- @param[in] ChildHandleBuffer Ignored (corresponding to NumberOfChildren).
-
- @retval EFI_SUCCESS Driver instance has been stopped and the PCI
- configuration attributes have been restored.
-
- @return Error codes from the OpenProtocol() or
- CloseProtocol(), UninstallProtocolInterface()
- boot services.
-
-**/
-STATIC
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceBindingStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-{
- EFI_STATUS Status;
- VIRTIO_DEVICE_PROTOCOL *VirtioDevice;
- VIRTIO_PCI_DEVICE *Device;
-
- Status = gBS->OpenProtocol (
- DeviceHandle, // candidate device
- &gVirtioDeviceProtocolGuid, // retrieve the VirtIo iface
- (VOID **)&VirtioDevice, // target pointer
- This->DriverBindingHandle, // requestor driver identity
- DeviceHandle, // requesting lookup for dev.
- EFI_OPEN_PROTOCOL_GET_PROTOCOL // lookup only, no ref. added
- );
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Device = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (VirtioDevice);
-
- //
- // Handle Stop() requests for in-use driver instances gracefully.
- //
- Status = gBS->UninstallProtocolInterface (DeviceHandle,
- &gVirtioDeviceProtocolGuid, &Device->VirtioDevice);
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- VirtioPciUninit (Device);
-
- Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
- Device->OriginalPciAttributes, NULL);
-
- Status = gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
- This->DriverBindingHandle, DeviceHandle);
-
- FreePool (Device);
-
- return Status;
-}
-
-
-//
-// The static object that groups the Supported() (ie. probe), Start() and
-// Stop() functions of the driver together. Refer to UEFI Spec 2.3.1 + Errata
-// C, 10.1 EFI Driver Binding Protocol.
-//
-STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
- &VirtioPciDeviceBindingSupported,
- &VirtioPciDeviceBindingStart,
- &VirtioPciDeviceBindingStop,
- 0x10, // Version, must be in [0x10 .. 0xFFFFFFEF] for IHV-developed drivers
- NULL, // ImageHandle, to be overwritten by
- // EfiLibInstallDriverBindingComponentName2() in VirtioPciEntryPoint()
- NULL // DriverBindingHandle, ditto
-};
-
-
-//
-// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
-// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
-// in English, for display on standard console devices. This is recommended for
-// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
-// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
-//
-STATIC
-EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
- { "eng;en", L"Virtio PCI Driver" },
- { NULL, NULL }
-};
-
-STATIC
-EFI_COMPONENT_NAME_PROTOCOL gComponentName;
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- )
-{
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mDriverNameTable,
- DriverName,
- (BOOLEAN)(This == &gComponentName) // Iso639Language
- );
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDeviceName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE DeviceHandle,
- IN EFI_HANDLE ChildHandle,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-STATIC
-EFI_COMPONENT_NAME_PROTOCOL gComponentName = {
- &VirtioPciGetDriverName,
- &VirtioPciGetDeviceName,
- "eng" // SupportedLanguages, ISO 639-2 language codes
-};
-
-STATIC
-EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &VirtioPciGetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &VirtioPciGetDeviceName,
- "en" // SupportedLanguages, RFC 4646 language codes
-};
-
-
-//
-// Entry point of this driver.
-//
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return EfiLibInstallDriverBindingComponentName2 (
- ImageHandle,
- SystemTable,
- &gDriverBinding,
- ImageHandle,
- &gComponentName,
- &gComponentName2
- );
-}
+/** @file
+
+ This driver produces Virtio Device Protocol instances for Virtio PCI devices.
+
+ Copyright (C) 2012, Red Hat, Inc.
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2013, ARM Ltd.
+
+ 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 <IndustryStandard/Pci.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+
+#include "VirtioPciDevice.h"
+
+STATIC VIRTIO_DEVICE_PROTOCOL mDeviceProtocolTemplate = {
+ 0, // Revision
+ 0, // SubSystemDeviceId
+ VirtioPciGetDeviceFeatures, // GetDeviceFeatures
+ VirtioPciSetGuestFeatures, // SetGuestFeatures
+ VirtioPciGetQueueAddress, // GetQueueAddress
+ VirtioPciSetQueueAddress, // SetQueueAddress
+ VirtioPciSetQueueSel, // SetQueueSel
+ VirtioPciSetQueueNotify, // SetQueueNotify
+ VirtioPciSetQueueAlignment, // SetQueueAlignment
+ VirtioPciSetPageSize, // SetPageSize
+ VirtioPciGetQueueSize, // GetQueueNumMax
+ VirtioPciSetQueueSize, // SetQueueNum
+ VirtioPciGetDeviceStatus, // GetDeviceStatus
+ VirtioPciSetDeviceStatus, // SetDeviceStatus
+ VirtioPciDeviceWrite, // WriteDevice
+ VirtioPciDeviceRead // ReadDevice
+};
+
+/**
+
+ Read a word from Region 0 of the device specified by PciIo.
+
+ Region 0 must be an iomem region. This is an internal function for the PCI
+ implementation of the protocol.
+
+ @param[in] Dev Virtio PCI device.
+
+ @param[in] FieldOffset Source offset.
+
+ @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
+
+ @param[in] BufferSize Number of bytes available in the target buffer. Must
+ equal FieldSize.
+
+ @param[out] Buffer Target buffer.
+
+
+ @return Status code returned by PciIo->Io.Read().
+
+**/
+EFI_STATUS
+EFIAPI
+VirtioPciIoRead (
+ IN VIRTIO_PCI_DEVICE *Dev,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ )
+{
+ UINTN Count;
+ EFI_PCI_IO_PROTOCOL_WIDTH Width;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+
+ ASSERT (FieldSize == BufferSize);
+
+ PciIo = Dev->PciIo;
+ Count = 1;
+
+ switch (FieldSize) {
+ case 1:
+ Width = EfiPciIoWidthUint8;
+ break;
+
+ case 2:
+ Width = EfiPciIoWidthUint16;
+ break;
+
+ case 8:
+ //
+ // The 64bit PCI I/O is broken down into two 32bit reads to prevent
+ // any alignment or width issues.
+ // The UEFI spec says under EFI_PCI_IO_PROTOCOL.Io.Write():
+ //
+ // The I/O operations are carried out exactly as requested. The caller
+ // is responsible for any alignment and I/O width issues which the
+ // bus, device, platform, or type of I/O might require. For example on
+ // some platforms, width requests of EfiPciIoWidthUint64 do not work.
+ //
+ Count = 2;
+
+ //
+ // fall through
+ //
+ case 4:
+ Width = EfiPciIoWidthUint32;
+ break;
+
+ default:
+ ASSERT (FALSE);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ return PciIo->Io.Read (
+ PciIo,
+ Width,
+ PCI_BAR_IDX0,
+ FieldOffset,
+ Count,
+ Buffer
+ );
+}
+
+/**
+
+ Write a word into Region 0 of the device specified by PciIo.
+
+ Region 0 must be an iomem region. This is an internal function for the PCI
+ implementation of the protocol.
+
+ @param[in] Dev Virtio PCI device.
+
+ @param[in] FieldOffset Destination offset.
+
+ @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
+
+ @param[in] Value Little endian value to write, converted to UINT64.
+ The least significant FieldSize bytes will be used.
+
+
+ @return Status code returned by PciIo->Io.Write().
+
+**/
+EFI_STATUS
+EFIAPI
+VirtioPciIoWrite (
+ IN VIRTIO_PCI_DEVICE *Dev,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ )
+{
+ UINTN Count;
+ EFI_PCI_IO_PROTOCOL_WIDTH Width;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+
+ PciIo = Dev->PciIo;
+ Count = 1;
+
+ switch (FieldSize) {
+ case 1:
+ Width = EfiPciIoWidthUint8;
+ break;
+
+ case 2:
+ Width = EfiPciIoWidthUint16;
+ break;
+
+ case 8:
+ //
+ // The 64bit PCI I/O is broken down into two 32bit writes to prevent
+ // any alignment or width issues.
+ // The UEFI spec says under EFI_PCI_IO_PROTOCOL.Io.Write():
+ //
+ // The I/O operations are carried out exactly as requested. The caller
+ // is responsible for any alignment and I/O width issues which the
+ // bus, device, platform, or type of I/O might require. For example on
+ // some platforms, width requests of EfiPciIoWidthUint64 do not work
+ //
+ Count = Count * 2;
+
+ //
+ // fall through
+ //
+ case 4:
+ Width = EfiPciIoWidthUint32;
+ break;
+
+ default:
+ ASSERT (FALSE);
+ return EFI_INVALID_PARAMETER;
+ }
+
+ return PciIo->Io.Write (
+ PciIo,
+ Width,
+ PCI_BAR_IDX0,
+ FieldOffset,
+ Count,
+ &Value
+ );
+}
+
+/**
+
+ Device probe function for this driver.
+
+ The DXE core calls this function for any given device in order to see if the
+ driver can drive the device.
+
+ @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
+ incorporating this driver (independently of
+ any device).
+
+ @param[in] DeviceHandle The device to probe.
+
+ @param[in] RemainingDevicePath Relevant only for bus drivers, ignored.
+
+
+ @retval EFI_SUCCESS The driver supports the device being probed.
+
+ @retval EFI_UNSUPPORTED Based on virtio-pci discovery, we do not support
+ the device.
+
+ @return Error codes from the OpenProtocol() boot service or
+ the PciIo protocol.
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceBindingSupported (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ )
+{
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ PCI_TYPE00 Pci;
+
+ //
+ // Attempt to open the device with the PciIo set of interfaces. On success,
+ // the protocol is "instantiated" for the PCI device. Covers duplicate open
+ // attempts (EFI_ALREADY_STARTED).
+ //
+ Status = gBS->OpenProtocol (
+ DeviceHandle, // candidate device
+ &gEfiPciIoProtocolGuid, // for generic PCI access
+ (VOID **)&PciIo, // handle to instantiate
+ This->DriverBindingHandle, // requestor driver identity
+ DeviceHandle, // ControllerHandle, according to
+ // the UEFI Driver Model
+ EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive PciIo access to
+ // the device; to be released
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Read entire PCI configuration header for more extensive check ahead.
+ //
+ Status = PciIo->Pci.Read (
+ PciIo, // (protocol, device)
+ // handle
+ EfiPciIoWidthUint32, // access width & copy
+ // mode
+ 0, // Offset
+ sizeof Pci / sizeof (UINT32), // Count
+ &Pci // target buffer
+ );
+
+ if (Status == EFI_SUCCESS) {
+ //
+ // virtio-0.9.5, 2.1 PCI Discovery
+ //
+ if ((Pci.Hdr.VendorId == VIRTIO_VENDOR_ID) &&
+ (Pci.Hdr.DeviceId >= 0x1000) &&
+ (Pci.Hdr.DeviceId <= 0x103F) &&
+ (Pci.Hdr.RevisionID == 0x00)) {
+ Status = EFI_SUCCESS;
+ } else {
+ Status = EFI_UNSUPPORTED;
+ }
+ }
+
+ //
+ // We needed PCI IO access only transitorily, to see whether we support the
+ // device or not.
+ //
+ gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle, DeviceHandle);
+
+ return Status;
+}
+
+/**
+
+ Initialize the VirtIo PCI Device
+
+ @param[in, out] Dev The driver instance to configure. The caller is
+ responsible for Device->PciIo's validity (ie. working IO
+ access to the underlying virtio-pci device).
+
+ @retval EFI_SUCCESS Setup complete.
+
+ @retval EFI_UNSUPPORTED The underlying IO device doesn't support the
+ provided address offset and read size.
+
+ @return Error codes from PciIo->Pci.Read().
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+VirtioPciInit (
+ IN OUT VIRTIO_PCI_DEVICE *Device
+ )
+{
+ EFI_STATUS Status;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ PCI_TYPE00 Pci;
+
+ ASSERT (Device != NULL);
+ PciIo = Device->PciIo;
+ ASSERT (PciIo != NULL);
+ ASSERT (PciIo->Pci.Read != NULL);
+
+ Status = PciIo->Pci.Read (
+ PciIo, // (protocol, device)
+ // handle
+ EfiPciIoWidthUint32, // access width & copy
+ // mode
+ 0, // Offset
+ sizeof (Pci) / sizeof (UINT32), // Count
+ &Pci // target buffer
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ //
+ // Copy protocol template
+ //
+ CopyMem (&Device->VirtioDevice, &mDeviceProtocolTemplate,
+ sizeof (VIRTIO_DEVICE_PROTOCOL));
+
+ //
+ // Initialize the protocol interface attributes
+ //
+ Device->VirtioDevice.Revision = VIRTIO_SPEC_REVISION (0, 9, 5);
+ Device->VirtioDevice.SubSystemDeviceId = Pci.Device.SubsystemID;
+
+ //
+ // Note: We don't support the MSI-X capability. If we did,
+ // the offset would become 24 after enabling MSI-X.
+ //
+ Device->DeviceSpecificConfigurationOffset =
+ VIRTIO_DEVICE_SPECIFIC_CONFIGURATION_OFFSET_PCI;
+
+ return EFI_SUCCESS;
+}
+
+/**
+
+ Uninitialize the internals of a virtio-pci device that has been successfully
+ set up with VirtioPciInit().
+
+ @param[in, out] Dev The device to clean up.
+
+**/
+
+STATIC
+VOID
+EFIAPI
+VirtioPciUninit (
+ IN OUT VIRTIO_PCI_DEVICE *Device
+ )
+{
+ // Note: This function mirrors VirtioPciInit() that does not allocate any
+ // resources - there's nothing to free here.
+}
+
+/**
+
+ After we've pronounced support for a specific device in
+ DriverBindingSupported(), we start managing said device (passed in by the
+ Driver Exeuction Environment) with the following service.
+
+ See DriverBindingSupported() for specification references.
+
+ @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
+ incorporating this driver (independently of
+ any device).
+
+ @param[in] DeviceHandle The supported device to drive.
+
+ @param[in] RemainingDevicePath Relevant only for bus drivers, ignored.
+
+
+ @retval EFI_SUCCESS Driver instance has been created and
+ initialized for the virtio-pci device, it
+ is now accessible via VIRTIO_DEVICE_PROTOCOL.
+
+ @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
+
+ @return Error codes from the OpenProtocol() boot
+ service, the PciIo protocol, VirtioPciInit(),
+ or the InstallProtocolInterface() boot service.
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceBindingStart (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
+ )
+{
+ VIRTIO_PCI_DEVICE *Device;
+ EFI_STATUS Status;
+
+ Device = (VIRTIO_PCI_DEVICE *) AllocateZeroPool (sizeof *Device);
+ if (Device == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ Status = gBS->OpenProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
+ (VOID **)&Device->PciIo, This->DriverBindingHandle,
+ DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
+ if (EFI_ERROR (Status)) {
+ goto FreeVirtioPci;
+ }
+
+ //
+ // We must retain and ultimately restore the original PCI attributes of the
+ // device. See Driver Writer's Guide for UEFI 2.3.1 v1.01, 18.3 PCI drivers /
+ // 18.3.2 Start() and Stop().
+ //
+ // The third parameter ("Attributes", input) is ignored by the Get operation.
+ // The fourth parameter ("Result", output) is ignored by the Enable and Set
+ // operations.
+ //
+ // For virtio-pci we only need IO space access.
+ //
+ Status = Device->PciIo->Attributes (Device->PciIo,
+ EfiPciIoAttributeOperationGet, 0, &Device->OriginalPciAttributes);
+ if (EFI_ERROR (Status)) {
+ goto ClosePciIo;
+ }
+
+ Status = Device->PciIo->Attributes (Device->PciIo,
+ EfiPciIoAttributeOperationEnable,
+ EFI_PCI_IO_ATTRIBUTE_IO, NULL);
+ if (EFI_ERROR (Status)) {
+ goto ClosePciIo;
+ }
+
+ //
+ // PCI IO access granted, configure protocol instance
+ //
+
+ Status = VirtioPciInit (Device);
+ if (EFI_ERROR (Status)) {
+ goto RestorePciAttributes;
+ }
+
+ //
+ // Setup complete, attempt to export the driver instance's VirtioDevice
+ // interface.
+ //
+ Device->Signature = VIRTIO_PCI_DEVICE_SIGNATURE;
+ Status = gBS->InstallProtocolInterface (&DeviceHandle,
+ &gVirtioDeviceProtocolGuid, EFI_NATIVE_INTERFACE,
+ &Device->VirtioDevice);
+ if (EFI_ERROR (Status)) {
+ goto UninitDev;
+ }
+
+ return EFI_SUCCESS;
+
+UninitDev:
+ VirtioPciUninit (Device);
+
+RestorePciAttributes:
+ Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
+ Device->OriginalPciAttributes, NULL);
+
+ClosePciIo:
+ gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle, DeviceHandle);
+
+FreeVirtioPci:
+ FreePool (Device);
+
+ return Status;
+}
+
+/**
+
+ Stop driving the Virtio PCI device
+
+ @param[in] This The EFI_DRIVER_BINDING_PROTOCOL object
+ incorporating this driver (independently of any
+ device).
+
+ @param[in] DeviceHandle Stop driving this device.
+
+ @param[in] NumberOfChildren Since this function belongs to a device driver
+ only (as opposed to a bus driver), the caller
+ environment sets NumberOfChildren to zero, and
+ we ignore it.
+
+ @param[in] ChildHandleBuffer Ignored (corresponding to NumberOfChildren).
+
+ @retval EFI_SUCCESS Driver instance has been stopped and the PCI
+ configuration attributes have been restored.
+
+ @return Error codes from the OpenProtocol() or
+ CloseProtocol(), UninstallProtocolInterface()
+ boot services.
+
+**/
+STATIC
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceBindingStop (
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN UINTN NumberOfChildren,
+ IN EFI_HANDLE *ChildHandleBuffer
+ )
+{
+ EFI_STATUS Status;
+ VIRTIO_DEVICE_PROTOCOL *VirtioDevice;
+ VIRTIO_PCI_DEVICE *Device;
+
+ Status = gBS->OpenProtocol (
+ DeviceHandle, // candidate device
+ &gVirtioDeviceProtocolGuid, // retrieve the VirtIo iface
+ (VOID **)&VirtioDevice, // target pointer
+ This->DriverBindingHandle, // requestor driver identity
+ DeviceHandle, // requesting lookup for dev.
+ EFI_OPEN_PROTOCOL_GET_PROTOCOL // lookup only, no ref. added
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ Device = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (VirtioDevice);
+
+ //
+ // Handle Stop() requests for in-use driver instances gracefully.
+ //
+ Status = gBS->UninstallProtocolInterface (DeviceHandle,
+ &gVirtioDeviceProtocolGuid, &Device->VirtioDevice);
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ VirtioPciUninit (Device);
+
+ Device->PciIo->Attributes (Device->PciIo, EfiPciIoAttributeOperationSet,
+ Device->OriginalPciAttributes, NULL);
+
+ Status = gBS->CloseProtocol (DeviceHandle, &gEfiPciIoProtocolGuid,
+ This->DriverBindingHandle, DeviceHandle);
+
+ FreePool (Device);
+
+ return Status;
+}
+
+
+//
+// The static object that groups the Supported() (ie. probe), Start() and
+// Stop() functions of the driver together. Refer to UEFI Spec 2.3.1 + Errata
+// C, 10.1 EFI Driver Binding Protocol.
+//
+STATIC EFI_DRIVER_BINDING_PROTOCOL gDriverBinding = {
+ &VirtioPciDeviceBindingSupported,
+ &VirtioPciDeviceBindingStart,
+ &VirtioPciDeviceBindingStop,
+ 0x10, // Version, must be in [0x10 .. 0xFFFFFFEF] for IHV-developed drivers
+ NULL, // ImageHandle, to be overwritten by
+ // EfiLibInstallDriverBindingComponentName2() in VirtioPciEntryPoint()
+ NULL // DriverBindingHandle, ditto
+};
+
+
+//
+// The purpose of the following scaffolding (EFI_COMPONENT_NAME_PROTOCOL and
+// EFI_COMPONENT_NAME2_PROTOCOL implementation) is to format the driver's name
+// in English, for display on standard console devices. This is recommended for
+// UEFI drivers that follow the UEFI Driver Model. Refer to the Driver Writer's
+// Guide for UEFI 2.3.1 v1.01, 11 UEFI Driver and Controller Names.
+//
+STATIC
+EFI_UNICODE_STRING_TABLE mDriverNameTable[] = {
+ { "eng;en", L"Virtio PCI Driver" },
+ { NULL, NULL }
+};
+
+STATIC
+EFI_COMPONENT_NAME_PROTOCOL gComponentName;
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDriverName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN CHAR8 *Language,
+ OUT CHAR16 **DriverName
+ )
+{
+ return LookupUnicodeString2 (
+ Language,
+ This->SupportedLanguages,
+ mDriverNameTable,
+ DriverName,
+ (BOOLEAN)(This == &gComponentName) // Iso639Language
+ );
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDeviceName (
+ IN EFI_COMPONENT_NAME_PROTOCOL *This,
+ IN EFI_HANDLE DeviceHandle,
+ IN EFI_HANDLE ChildHandle,
+ IN CHAR8 *Language,
+ OUT CHAR16 **ControllerName
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+STATIC
+EFI_COMPONENT_NAME_PROTOCOL gComponentName = {
+ &VirtioPciGetDriverName,
+ &VirtioPciGetDeviceName,
+ "eng" // SupportedLanguages, ISO 639-2 language codes
+};
+
+STATIC
+EFI_COMPONENT_NAME2_PROTOCOL gComponentName2 = {
+ (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) &VirtioPciGetDriverName,
+ (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) &VirtioPciGetDeviceName,
+ "en" // SupportedLanguages, RFC 4646 language codes
+};
+
+
+//
+// Entry point of this driver.
+//
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceEntryPoint (
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
+ )
+{
+ return EfiLibInstallDriverBindingComponentName2 (
+ ImageHandle,
+ SystemTable,
+ &gDriverBinding,
+ ImageHandle,
+ &gComponentName,
+ &gComponentName2
+ );
+}
diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h
index bbad164f6..6311ae849 100644
--- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h
+++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h
@@ -1,166 +1,166 @@
-/** @file
-
- Internal definitions for the VirtIo PCI Device driver
-
- Copyright (C) 2013, ARM Ltd
-
- 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 _VIRTIO_PCI_DEVICE_DXE_H_
-#define _VIRTIO_PCI_DEVICE_DXE_H_
-
-#include <Protocol/ComponentName.h>
-#include <Protocol/DriverBinding.h>
-#include <Protocol/PciIo.h>
-#include <Protocol/VirtioDevice.h>
-
-#include <IndustryStandard/Virtio.h>
-
-#define VIRTIO_PCI_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'P', 'C', 'I')
-
-typedef struct {
- UINT32 Signature;
- VIRTIO_DEVICE_PROTOCOL VirtioDevice;
- EFI_PCI_IO_PROTOCOL *PciIo;
- UINT64 OriginalPciAttributes;
- UINT32 DeviceSpecificConfigurationOffset;
-} VIRTIO_PCI_DEVICE;
-
-#define VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE(Device) \
- CR (Device, VIRTIO_PCI_DEVICE, VirtioDevice, VIRTIO_PCI_DEVICE_SIGNATURE)
-
-
-EFI_STATUS
-EFIAPI
-VirtioPciIoRead (
- IN VIRTIO_PCI_DEVICE *Dev,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciIoWrite (
- IN VIRTIO_PCI_DEVICE *Dev,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- );
-
-/********************************************
- * PCI Functions for VIRTIO_DEVICE_PROTOCOL
- *******************************************/
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceRead (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceWrite (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDeviceFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *DeviceFeatures
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetQueueAddress (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *QueueAddress
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetQueueSize (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT16 *QueueNumMax
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueAlignment (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Alignment
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetPageSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 PageSize
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDeviceStatus (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT8 *DeviceStatus
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetGuestFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Features
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueAddress (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Address
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueSel (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Sel
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueNotify (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Index
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Size
- );
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetDeviceStatus (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT8 DeviceStatus
- );
-
-#endif // _VIRTIO_PCI_DEVICE_DXE_H_
+/** @file
+
+ Internal definitions for the VirtIo PCI Device driver
+
+ Copyright (C) 2013, ARM Ltd
+
+ 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 _VIRTIO_PCI_DEVICE_DXE_H_
+#define _VIRTIO_PCI_DEVICE_DXE_H_
+
+#include <Protocol/ComponentName.h>
+#include <Protocol/DriverBinding.h>
+#include <Protocol/PciIo.h>
+#include <Protocol/VirtioDevice.h>
+
+#include <IndustryStandard/Virtio.h>
+
+#define VIRTIO_PCI_DEVICE_SIGNATURE SIGNATURE_32 ('V', 'P', 'C', 'I')
+
+typedef struct {
+ UINT32 Signature;
+ VIRTIO_DEVICE_PROTOCOL VirtioDevice;
+ EFI_PCI_IO_PROTOCOL *PciIo;
+ UINT64 OriginalPciAttributes;
+ UINT32 DeviceSpecificConfigurationOffset;
+} VIRTIO_PCI_DEVICE;
+
+#define VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE(Device) \
+ CR (Device, VIRTIO_PCI_DEVICE, VirtioDevice, VIRTIO_PCI_DEVICE_SIGNATURE)
+
+
+EFI_STATUS
+EFIAPI
+VirtioPciIoRead (
+ IN VIRTIO_PCI_DEVICE *Dev,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciIoWrite (
+ IN VIRTIO_PCI_DEVICE *Dev,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ );
+
+/********************************************
+ * PCI Functions for VIRTIO_DEVICE_PROTOCOL
+ *******************************************/
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceRead (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceWrite (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDeviceFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *DeviceFeatures
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetQueueAddress (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *QueueAddress
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetQueueSize (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT16 *QueueNumMax
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueAlignment (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Alignment
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetPageSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 PageSize
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDeviceStatus (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT8 *DeviceStatus
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetGuestFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 Features
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueAddress (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Address
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueSel (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Sel
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueNotify (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Index
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Size
+ );
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetDeviceStatus (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT8 DeviceStatus
+ );
+
+#endif // _VIRTIO_PCI_DEVICE_DXE_H_
diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
index 90a5dbc2b..4b5d1a493 100644
--- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
+++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
@@ -1,43 +1,43 @@
-## @file
-# This driver produces the VirtIo Device Protocol instances for VirtIo PCI
-# Device
-#
-# Copyright (C) 2013, ARM Ltd
-#
-# 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 = 0x00010006
- BASE_NAME = VirtioPciDeviceDxe
- FILE_GUID = 83dd3b39-7caf-4fac-a542-e050b767e3a7
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = VirtioPciDeviceEntryPoint
-
-[Sources]
- VirtioPciDevice.c
- VirtioPciFunctions.c
-
-[Packages]
- MdePkg/MdePkg.dec
- OvmfPkg/OvmfPkg.dec
-
-[LibraryClasses]
- BaseMemoryLib
- DebugLib
- MemoryAllocationLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- UefiLib
-
-[Protocols]
- gEfiPciIoProtocolGuid ## TO_START
- gVirtioDeviceProtocolGuid ## BY_START
+## @file
+# This driver produces the VirtIo Device Protocol instances for VirtIo PCI
+# Device
+#
+# Copyright (C) 2013, ARM Ltd
+#
+# 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 = 0x00010006
+ BASE_NAME = VirtioPciDeviceDxe
+ FILE_GUID = 83dd3b39-7caf-4fac-a542-e050b767e3a7
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = VirtioPciDeviceEntryPoint
+
+[Sources]
+ VirtioPciDevice.c
+ VirtioPciFunctions.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ OvmfPkg/OvmfPkg.dec
+
+[LibraryClasses]
+ BaseMemoryLib
+ DebugLib
+ MemoryAllocationLib
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+ UefiLib
+
+[Protocols]
+ gEfiPciIoProtocolGuid ## TO_START
+ gVirtioDeviceProtocolGuid ## BY_START
diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c
index e9e48b945..9c40fd94a 100644
--- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c
+++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c
@@ -1,285 +1,283 @@
-/** @file
-
- This driver produces Virtio Device Protocol instances for Virtio PCI devices.
-
- Copyright (C) 2012, Red Hat, Inc.
- Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
- Copyright (C) 2013, ARM Ltd.
-
- 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 <Library/BaseMemoryLib.h>
-#include <Library/DebugLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include "VirtioPciDevice.h"
-
-/**
-
- Read a word from Region 0 of the device specified by PciIo.
-
- The function implements the ReadDevice protocol member of
- VIRTIO_DEVICE_PROTOCOL.
-
- @param[in] PciIo Source PCI device.
-
- @param[in] FieldOffset Source offset.
-
- @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] BufferSize Number of bytes available in the target buffer. Must
- equal FieldSize.
-
- @param[out] Buffer Target buffer.
-
-
- @return Status code returned by PciIo->Io.Read().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceRead (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoRead (Dev,
- Dev->DeviceSpecificConfigurationOffset + FieldOffset,
- FieldSize, BufferSize, Buffer);
-}
-
-/**
-
- Write a word into Region 0 of the device specified by VirtIo Device protocol.
-
- @param[in] This VirtIo Device protocol.
-
- @param[in] FieldOffset Destination offset.
-
- @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
-
- @param[in] Value Little endian value to write, converted to UINT64.
- The least significant FieldSize bytes will be used.
-
-
- @return Status code returned by PciIo->Io.Write().
-
-**/
-EFI_STATUS
-EFIAPI
-VirtioPciDeviceWrite (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINTN FieldOffset,
- IN UINTN FieldSize,
- IN UINT64 Value
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev,
- Dev->DeviceSpecificConfigurationOffset + FieldOffset, FieldSize, Value);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDeviceFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *DeviceFeatures
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- if (DeviceFeatures == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_DEVICE_FEATURES, sizeof (UINT32),
- sizeof (UINT32), DeviceFeatures);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetQueueAddress (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT32 *QueueAddress
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- if (QueueAddress == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32),
- sizeof (UINT32), QueueAddress);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetQueueSize (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT16 *QueueNumMax
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- if (QueueNumMax == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_SIZE, sizeof (UINT16),
- sizeof (UINT16), QueueNumMax);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciGetDeviceStatus (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- OUT UINT8 *DeviceStatus
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- if (DeviceStatus == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
- sizeof (UINT8), sizeof (UINT8), DeviceStatus);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetGuestFeatures (
- IN VIRTIO_DEVICE_PROTOCOL *This,
- IN UINT32 Features
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_GUEST_FEATURES,
- sizeof (UINT32), Features);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueAddress (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Address
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32),
- Address);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueSel (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Sel
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_SELECT, sizeof (UINT16),
- Sel);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueAlignment (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 Alignment
- )
-{
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetPageSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT32 PageSize
- )
-{
- ASSERT (PageSize == EFI_PAGE_SIZE);
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueNotify (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Index
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_NOTIFY, sizeof (UINT16),
- Index);
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetQueueSize (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT16 Size
- )
-{
- //
- // This function is only applicable in Virtio-MMIO.
- // (The QueueSize field is read-only in Virtio proper (PCI))
- //
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-VirtioPciSetDeviceStatus (
- VIRTIO_DEVICE_PROTOCOL *This,
- UINT8 DeviceStatus
- )
-{
- VIRTIO_PCI_DEVICE *Dev;
-
- Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
-
- return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
- sizeof (UINT8), DeviceStatus);
-}
+/** @file
+
+ This driver produces Virtio Device Protocol instances for Virtio PCI devices.
+
+ Copyright (C) 2012, Red Hat, Inc.
+ Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (C) 2013, ARM Ltd.
+
+ 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 <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiLib.h>
+#include "VirtioPciDevice.h"
+
+/**
+
+ Read a word from Region 0 of the device specified by VirtIo Device protocol.
+
+ The function implements the ReadDevice protocol member of
+ VIRTIO_DEVICE_PROTOCOL.
+
+ @param[in] This VirtIo Device protocol.
+
+ @param[in] FieldOffset Source offset.
+
+ @param[in] FieldSize Source field size, must be in { 1, 2, 4, 8 }.
+
+ @param[in] BufferSize Number of bytes available in the target buffer. Must
+ equal FieldSize.
+
+ @param[out] Buffer Target buffer.
+
+
+ @return Status code returned by PciIo->Io.Read().
+
+**/
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceRead (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINTN BufferSize,
+ OUT VOID *Buffer
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoRead (Dev,
+ Dev->DeviceSpecificConfigurationOffset + FieldOffset,
+ FieldSize, BufferSize, Buffer);
+}
+
+/**
+
+ Write a word into Region 0 of the device specified by VirtIo Device protocol.
+
+ @param[in] This VirtIo Device protocol.
+
+ @param[in] FieldOffset Destination offset.
+
+ @param[in] FieldSize Destination field size, must be in { 1, 2, 4, 8 }.
+
+ @param[in] Value Little endian value to write, converted to UINT64.
+ The least significant FieldSize bytes will be used.
+
+
+ @return Status code returned by PciIo->Io.Write().
+
+**/
+EFI_STATUS
+EFIAPI
+VirtioPciDeviceWrite (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINTN FieldOffset,
+ IN UINTN FieldSize,
+ IN UINT64 Value
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev,
+ Dev->DeviceSpecificConfigurationOffset + FieldOffset, FieldSize, Value);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDeviceFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *DeviceFeatures
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ if (DeviceFeatures == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_DEVICE_FEATURES, sizeof (UINT32),
+ sizeof (UINT32), DeviceFeatures);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetQueueAddress (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT32 *QueueAddress
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ if (QueueAddress == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32),
+ sizeof (UINT32), QueueAddress);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetQueueSize (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT16 *QueueNumMax
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ if (QueueNumMax == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_SIZE, sizeof (UINT16),
+ sizeof (UINT16), QueueNumMax);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciGetDeviceStatus (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ OUT UINT8 *DeviceStatus
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ if (DeviceStatus == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
+ sizeof (UINT8), sizeof (UINT8), DeviceStatus);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetGuestFeatures (
+ IN VIRTIO_DEVICE_PROTOCOL *This,
+ IN UINT32 Features
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_GUEST_FEATURES,
+ sizeof (UINT32), Features);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueAddress (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Address
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32),
+ Address);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueSel (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Sel
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_SELECT, sizeof (UINT16),
+ Sel);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueAlignment (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 Alignment
+ )
+{
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetPageSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT32 PageSize
+ )
+{
+ return (PageSize == EFI_PAGE_SIZE) ? EFI_SUCCESS : EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueNotify (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Index
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_NOTIFY, sizeof (UINT16),
+ Index);
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetQueueSize (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT16 Size
+ )
+{
+ //
+ // This function is only applicable in Virtio-MMIO.
+ // (The QueueSize field is read-only in Virtio proper (PCI))
+ //
+ return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+VirtioPciSetDeviceStatus (
+ VIRTIO_DEVICE_PROTOCOL *This,
+ UINT8 DeviceStatus
+ )
+{
+ VIRTIO_PCI_DEVICE *Dev;
+
+ Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This);
+
+ return VirtioPciIoWrite (Dev, VIRTIO_PCI_OFFSET_QUEUE_DEVICE_STATUS,
+ sizeof (UINT8), DeviceStatus);
+}
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
index 3b6c3ade8..e6154cd22 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c
@@ -50,14 +50,14 @@
/**
- Convenience macros to read and write region 0 IO space elements of the
- virtio-scsi VirtIo device, for configuration purposes.
+ Convenience macros to read and write configuration elements of the
+ virtio-scsi VirtIo device.
The following macros make it possible to specify only the "core parameters"
for such accesses and to derive the rest. By the time VIRTIO_CFG_WRITE()
returns, the transaction will have been completed.
- @param[in] Dev Pointer to the VirtIo Device Protocol
+ @param[in] Dev Pointer to the VSCSI_DEV structure.
@param[in] Field A field name from VSCSI_HDR, identifying the virtio-scsi
configuration item to access.
@@ -70,23 +70,23 @@
one of UINT8, UINT16, UINT32, UINT64.
- @return Status codes returned by Virtio->WriteDevice() / Virtio->ReadDevice().
+ @return Status codes returned by Virtio->WriteDevice() / Virtio->ReadDevice().
**/
-#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VSCSI (Field), \
- SIZE_OF_VSCSI (Field), \
- (Value) \
+#define VIRTIO_CFG_WRITE(Dev, Field, Value) ((Dev)->VirtIo->WriteDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VSCSI (Field), \
+ SIZE_OF_VSCSI (Field), \
+ (Value) \
))
-#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
- (Dev)->VirtIo, \
- OFFSET_OF_VSCSI (Field), \
- SIZE_OF_VSCSI (Field), \
- sizeof *(Pointer), \
- (Pointer) \
+#define VIRTIO_CFG_READ(Dev, Field, Pointer) ((Dev)->VirtIo->ReadDevice ( \
+ (Dev)->VirtIo, \
+ OFFSET_OF_VSCSI (Field), \
+ SIZE_OF_VSCSI (Field), \
+ sizeof *(Pointer), \
+ (Pointer) \
))
@@ -469,7 +469,7 @@ VirtioScsiPassThru (
// EFI_NOT_READY would save us the effort, but it would also suggest that the
// caller retry.
//
- if (VirtioFlush (Dev->VirtIo, VIRTIO_SCSI_REQUEST_QUEUE, &Dev->Ring,
+ if (VirtioFlush (Dev->VirtIo, VIRTIO_SCSI_REQUEST_QUEUE, &Dev->Ring,
&Indices) != EFI_SUCCESS) {
Packet->InTransferLength = 0;
Packet->OutTransferLength = 0;
@@ -716,41 +716,41 @@ VirtioScsiInit (
// Execute virtio-0.9.5, 2.2.1 Device Initialization Sequence.
//
NextDevStat = 0; // step 1 -- reset device
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto Failed;
}
NextDevStat |= VSTAT_ACK; // step 2 -- acknowledge device presence
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto Failed;
}
NextDevStat |= VSTAT_DRIVER; // step 3 -- we know how to drive it
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ if (EFI_ERROR (Status)) {
+ goto Failed;
+ }
+
+ //
+ // Set Page Size - MMIO VirtIo Specific
+ //
+ Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
if (EFI_ERROR (Status)) {
goto Failed;
}
//
- // Set Page Size - MMIO VirtIo Specific
- //
- Status = Dev->VirtIo->SetPageSize (Dev->VirtIo, EFI_PAGE_SIZE);
- if (EFI_ERROR (Status)) {
- goto ReleaseQueue;
- }
-
- //
// step 4a -- retrieve and validate features
//
- Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
+ Status = Dev->VirtIo->GetDeviceFeatures (Dev->VirtIo, &Features);
if (EFI_ERROR (Status)) {
goto Failed;
}
Dev->InOutSupported = !!(Features & VIRTIO_SCSI_F_INOUT);
- Status = VIRTIO_CFG_READ (Dev, MaxChannel, &MaxChannel);
+ Status = VIRTIO_CFG_READ (Dev, MaxChannel, &MaxChannel);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -762,7 +762,7 @@ VirtioScsiInit (
goto Failed;
}
- Status = VIRTIO_CFG_READ (Dev, NumQueues, &NumQueues);
+ Status = VIRTIO_CFG_READ (Dev, NumQueues, &NumQueues);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -771,7 +771,7 @@ VirtioScsiInit (
goto Failed;
}
- Status = VIRTIO_CFG_READ (Dev, MaxTarget, &Dev->MaxTarget);
+ Status = VIRTIO_CFG_READ (Dev, MaxTarget, &Dev->MaxTarget);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -779,7 +779,7 @@ VirtioScsiInit (
Dev->MaxTarget = PcdGet16 (PcdVirtioScsiMaxTargetLimit);
}
- Status = VIRTIO_CFG_READ (Dev, MaxLun, &Dev->MaxLun);
+ Status = VIRTIO_CFG_READ (Dev, MaxLun, &Dev->MaxLun);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -787,7 +787,7 @@ VirtioScsiInit (
Dev->MaxLun = PcdGet32 (PcdVirtioScsiMaxLunLimit);
}
- Status = VIRTIO_CFG_READ (Dev, MaxSectors, &Dev->MaxSectors);
+ Status = VIRTIO_CFG_READ (Dev, MaxSectors, &Dev->MaxSectors);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -803,11 +803,11 @@ VirtioScsiInit (
//
// step 4b -- allocate request virtqueue
//
- Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, VIRTIO_SCSI_REQUEST_QUEUE);
+ Status = Dev->VirtIo->SetQueueSel (Dev->VirtIo, VIRTIO_SCSI_REQUEST_QUEUE);
if (EFI_ERROR (Status)) {
goto Failed;
}
- Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
+ Status = Dev->VirtIo->GetQueueNumMax (Dev->VirtIo, &QueueSize);
if (EFI_ERROR (Status)) {
goto Failed;
}
@@ -825,11 +825,24 @@ VirtioScsiInit (
}
//
- // step 4c -- Report GPFN (guest-physical frame number) of queue. If anything
- // fails from here on, we must release the ring resources.
+ // Additional steps for MMIO: align the queue appropriately, and set the
+ // size. If anything fails from here on, we must release the ring resources.
//
- Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
- (UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT);
+ Status = Dev->VirtIo->SetQueueNum (Dev->VirtIo, QueueSize);
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+ Status = Dev->VirtIo->SetQueueAlign (Dev->VirtIo, EFI_PAGE_SIZE);
+ if (EFI_ERROR (Status)) {
+ goto ReleaseQueue;
+ }
+
+ //
+ // step 4c -- Report GPFN (guest-physical frame number) of queue.
+ //
+ Status = Dev->VirtIo->SetQueueAddress (Dev->VirtIo,
+ (UINT32) ((UINTN) Dev->Ring.Base >> EFI_PAGE_SHIFT));
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
@@ -839,8 +852,8 @@ VirtioScsiInit (
// the known (or unknown) VIRTIO_SCSI_F_* or VIRTIO_F_* capabilities (see
// virtio-0.9.5, Appendices B and I), except bidirectional transfers.
//
- Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo,
- Features & VIRTIO_SCSI_F_INOUT);
+ Status = Dev->VirtIo->SetGuestFeatures (Dev->VirtIo,
+ Features & VIRTIO_SCSI_F_INOUT);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
@@ -849,11 +862,11 @@ VirtioScsiInit (
// We expect these maximum sizes from the host. Since they are
// guest-negotiable, ask for them rather than just checking them.
//
- Status = VIRTIO_CFG_WRITE (Dev, CdbSize, VIRTIO_SCSI_CDB_SIZE);
+ Status = VIRTIO_CFG_WRITE (Dev, CdbSize, VIRTIO_SCSI_CDB_SIZE);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
- Status = VIRTIO_CFG_WRITE (Dev, SenseSize, VIRTIO_SCSI_SENSE_SIZE);
+ Status = VIRTIO_CFG_WRITE (Dev, SenseSize, VIRTIO_SCSI_SENSE_SIZE);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
@@ -862,7 +875,7 @@ VirtioScsiInit (
// step 6 -- initialization complete
//
NextDevStat |= VSTAT_DRIVER_OK;
- Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Status = Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
if (EFI_ERROR (Status)) {
goto ReleaseQueue;
}
@@ -906,10 +919,10 @@ ReleaseQueue:
Failed:
//
// Notify the host about our failure to setup: virtio-0.9.5, 2.2.2.1 Device
- // Status. VirtIo access failure here should not mask the original error.
+ // Status. VirtIo access failure here should not mask the original error.
//
NextDevStat |= VSTAT_FAILED;
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, NextDevStat);
Dev->InOutSupported = FALSE;
Dev->MaxTarget = 0;
@@ -933,7 +946,7 @@ VirtioScsiUninit (
// VIRTIO_CFG_WRITE() returns, the host will have learned to stay away from
// the old comms area.
//
- Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
+ Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
Dev->InOutSupported = FALSE;
Dev->MaxTarget = 0;
@@ -970,37 +983,37 @@ VirtioScsiDriverBindingSupported (
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
- EFI_STATUS Status;
- VIRTIO_DEVICE_PROTOCOL *VirtIo;
+ EFI_STATUS Status;
+ VIRTIO_DEVICE_PROTOCOL *VirtIo;
//
- // Attempt to open the device with the VirtIo set of interfaces. On success,
- // the protocol is "instantiated" for the VirtIo device. Covers duplicate open
+ // Attempt to open the device with the VirtIo set of interfaces. On success,
+ // the protocol is "instantiated" for the VirtIo device. Covers duplicate open
// attempts (EFI_ALREADY_STARTED).
//
Status = gBS->OpenProtocol (
DeviceHandle, // candidate device
- &gVirtioDeviceProtocolGuid, // for generic VirtIo access
- (VOID **)&VirtIo, // handle to instantiate
+ &gVirtioDeviceProtocolGuid, // for generic VirtIo access
+ (VOID **)&VirtIo, // handle to instantiate
This->DriverBindingHandle, // requestor driver identity
DeviceHandle, // ControllerHandle, according to
// the UEFI Driver Model
- EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
+ EFI_OPEN_PROTOCOL_BY_DRIVER // get exclusive VirtIo access to
// the device; to be released
);
if (EFI_ERROR (Status)) {
return Status;
}
- if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_SCSI_HOST) {
- Status = EFI_UNSUPPORTED;
+ if (VirtIo->SubSystemDeviceId != VIRTIO_SUBSYSTEM_SCSI_HOST) {
+ Status = EFI_UNSUPPORTED;
}
//
- // We needed VirtIo access only transitorily, to see whether we support the
+ // We needed VirtIo access only transitorily, to see whether we support the
// device or not.
//
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
return Status;
}
@@ -1022,19 +1035,19 @@ VirtioScsiDriverBindingStart (
return EFI_OUT_OF_RESOURCES;
}
- Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
- (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
+ Status = gBS->OpenProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ (VOID **)&Dev->VirtIo, This->DriverBindingHandle,
DeviceHandle, EFI_OPEN_PROTOCOL_BY_DRIVER);
if (EFI_ERROR (Status)) {
goto FreeVirtioScsi;
}
//
- // VirtIo access granted, configure virtio-scsi device.
+ // VirtIo access granted, configure virtio-scsi device.
//
Status = VirtioScsiInit (Dev);
if (EFI_ERROR (Status)) {
- goto CloseVirtIo;
+ goto CloseVirtIo;
}
//
@@ -1054,8 +1067,8 @@ VirtioScsiDriverBindingStart (
UninitDev:
VirtioScsiUninit (Dev);
-CloseVirtIo:
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+CloseVirtIo:
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
FreeVirtioScsi:
@@ -1103,7 +1116,7 @@ VirtioScsiDriverBindingStop (
VirtioScsiUninit (Dev);
- gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
+ gBS->CloseProtocol (DeviceHandle, &gVirtioDeviceProtocolGuid,
This->DriverBindingHandle, DeviceHandle);
FreePool (Dev);
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.h b/OvmfPkg/VirtioScsiDxe/VirtioScsi.h
index 42d8ed765..0d3181d14 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.h
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.h
@@ -48,17 +48,17 @@ typedef struct {
// at various call depths. The table to the right should make it easier to
// track them.
//
- // field init function init depth
- // ---------------- ------------------ ----------
- UINT32 Signature; // DriverBindingStart 0
- VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
- BOOLEAN InOutSupported; // VirtioScsiInit 1
- UINT16 MaxTarget; // VirtioScsiInit 1
- UINT32 MaxLun; // VirtioScsiInit 1
- UINT32 MaxSectors; // VirtioScsiInit 1
- VRING Ring; // VirtioRingInit 2
- EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru; // VirtioScsiInit 1
- EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode; // VirtioScsiInit 1
+ // field init function init depth
+ // ---------------- ------------------ ----------
+ UINT32 Signature; // DriverBindingStart 0
+ VIRTIO_DEVICE_PROTOCOL *VirtIo; // DriverBindingStart 0
+ BOOLEAN InOutSupported; // VirtioScsiInit 1
+ UINT16 MaxTarget; // VirtioScsiInit 1
+ UINT32 MaxLun; // VirtioScsiInit 1
+ UINT32 MaxSectors; // VirtioScsiInit 1
+ VRING Ring; // VirtioRingInit 2
+ EFI_EXT_SCSI_PASS_THRU_PROTOCOL PassThru; // VirtioScsiInit 1
+ EFI_EXT_SCSI_PASS_THRU_MODE PassThruMode; // VirtioScsiInit 1
} VSCSI_DEV;
#define VIRTIO_SCSI_FROM_PASS_THRU(PassThruPointer) \
diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.inf b/OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
index e98780db8..755811239 100644
--- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
+++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
@@ -40,7 +40,7 @@
[Protocols]
gEfiExtScsiPassThruProtocolGuid ## BY_START
- gVirtioDeviceProtocolGuid ## TO_START
+ gVirtioDeviceProtocolGuid ## TO_START
[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdVirtioScsiMaxTargetLimit ## CONSUMES
diff --git a/OvmfPkg/create-release.py b/OvmfPkg/create-release.py
index 6a6017a9f..a15d2473c 100755
--- a/OvmfPkg/create-release.py
+++ b/OvmfPkg/create-release.py
@@ -1,6 +1,6 @@
#!/usr/bin/python
#
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -11,8 +11,6 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
-release_type = 'alpha'
-
import os
import re
import StringIO
@@ -33,11 +31,6 @@ if not os.path.exists(os.path.join('OvmfPkg', 'OvmfPkgX64.dsc')):
print "OvmfPkg/OvmfPkgX64.dsc doesn't exist"
sys.exit(-1)
-if 'TOOLCHAIN' in os.environ:
- TOOLCHAIN = os.environ['TOOLCHAIN']
-else:
- TOOLCHAIN = 'GCC44'
-
def run_and_capture_output(args, checkExitCode = True):
p = subprocess.Popen(args=args, stdout=subprocess.PIPE)
stdout = p.stdout.read()
@@ -46,12 +39,37 @@ def run_and_capture_output(args, checkExitCode = True):
assert ret_code == 0
return stdout
-def git_svn_info():
+gcc_version = run_and_capture_output(args=('gcc', '--version'))
+gcc_re = re.compile(r'\s*\S+\s+\([^\)]+?\)\s+(\d+(?:\.\d+)*)(?:\s+.*)?')
+mo = gcc_re.match(gcc_version)
+if not mo:
+ print "Unable to find GCC version"
+ sys.exit(-1)
+gcc_version = map(lambda n: int(n), mo.group(1).split('.'))
+
+if 'TOOLCHAIN' in os.environ:
+ TOOLCHAIN = os.environ['TOOLCHAIN']
+else:
+ assert(gcc_version[0] == 4)
+ minor = max(4, min(7, gcc_version[1]))
+ TOOLCHAIN = 'GCC4' + str(minor)
+
+def git_based_version():
dir = os.getcwd()
- os.chdir('OvmfPkg')
- stdout = run_and_capture_output(args=('git', 'svn', 'info'))
+ if not os.path.exists('.git'):
+ os.chdir('OvmfPkg')
+ stdout = run_and_capture_output(args=('git', 'log',
+ '-n', '1',
+ '--abbrev-commit'))
+ regex = re.compile(r'^\s*git-svn-id:\s+\S+@(\d+)\s+[0-9a-f\-]+$',
+ re.MULTILINE)
+ mo = regex.search(stdout)
+ if mo:
+ version = 'r' + mo.group(1)
+ else:
+ version = stdout.split(None, 3)[1]
os.chdir(dir)
- return stdout
+ return version
def svn_info():
dir = os.getcwd()
@@ -60,18 +78,18 @@ def svn_info():
os.chdir(dir)
return stdout
-def get_svn_info_output():
- if os.path.exists(os.path.join('OvmfPkg', '.svn')):
- return svn_info()
- else:
- return git_svn_info()
+def svn_based_version():
+ buf = svn_info()
+ revision_re = re.compile('^Revision\:\s*([\da-f]+)$', re.MULTILINE)
+ mo = revision_re.search(buf)
+ assert(mo is not None)
+ return 'r' + mo.group(1)
def get_revision():
- buf = get_svn_info_output()
- revision_re = re.compile('^Revision\:\s*(\d+)$', re.MULTILINE)
- mo = revision_re.search(buf)
- if mo is not None:
- return int(mo.group(1))
+ if os.path.exists(os.path.join('OvmfPkg', '.svn')):
+ return svn_based_version()
+ else:
+ return git_based_version()
revision = get_revision()
@@ -84,8 +102,7 @@ def gen_build_info():
machine = run_and_capture_output(args=('uname', '-m')).strip()
- gcc_version = run_and_capture_output(args=('gcc', '--version'))
- gcc_version = gcc_version.split('\n')[0].split()[-1]
+ gcc_version_str = '.'.join(map(lambda v: str(v), gcc_version))
ld_version = run_and_capture_output(args=('ld', '--version'))
ld_version = ld_version.split('\n')[0].split()[-1]
@@ -95,13 +112,19 @@ def gen_build_info():
iasl_version = iasl_version.split(' version ')[1].strip()
sb = StringIO.StringIO()
- print >> sb, 'edk2: ', 'r%d' % revision
- print >> sb, 'compiler: GCC', gcc_version
+ print >> sb, 'edk2: ', revision
+ print >> sb, 'compiler: GCC', gcc_version_str, '(' + TOOLCHAIN + ')'
print >> sb, 'binutils:', ld_version
print >> sb, 'iasl: ', iasl_version
print >> sb, 'system: ', distro, machine.replace('_', '-')
return to_dos_text(sb.getvalue())
+def read_file(filename):
+ f = open(filename)
+ d = f.read()
+ f.close()
+ return d
+
LICENSE = to_dos_text(
'''This OVMF binary release is built from source code licensed under
the BSD open source license. The BSD license is documented at
@@ -116,76 +139,22 @@ and a copy is shown below (following the normal BSD license).
=== BSD license: START ===
-Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-* Neither the name of the Intel Corporation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+''')
+
+LICENSE += read_file(os.path.join('MdePkg', 'License.txt'))
+LICENSE += to_dos_text(
+'''
=== BSD license: END ===
=== FAT filesystem driver license: START ===
-Copyright (c) 2004, Intel Corporation. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-* Neither the name of Intel nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-Additional terms:
-In addition to the forgoing, redistribution and use of the code is
-conditioned upon the FAT 32 File System Driver and all derivative
-works thereof being used for and designed only to read and/or write
-to a file system that is directly managed by an Extensible Firmware
-Interface (EFI) implementation or by an emulator of an EFI
-implementation.
+''')
+
+LICENSE += read_file(os.path.join('FatBinPkg', 'License.txt'))
+LICENSE += to_dos_text(
+'''
=== FAT filesystem driver license: END ===
''')
@@ -210,7 +179,7 @@ def build(arch):
def create_zip(arch):
global build_info
- filename = 'OVMF-%s-r%d-%s.zip' % (arch, revision, release_type)
+ filename = 'OVMF-%s-%s.zip' % (arch, revision)
print 'Creating', filename, '...',
sys.stdout.flush()
if os.path.exists(filename):
diff --git a/PandaBoardPkg/Library/PandaBoardLib/PandaBoardHelper.S b/PandaBoardPkg/Library/PandaBoardLib/PandaBoardHelper.S
index 49fcf533a..6f21ed08a 100644
--- a/PandaBoardPkg/Library/PandaBoardLib/PandaBoardHelper.S
+++ b/PandaBoardPkg/Library/PandaBoardLib/PandaBoardHelper.S
@@ -25,6 +25,7 @@ GCC_ASM_EXPORT(ArmPlatformGetCorePosition)
GCC_ASM_EXPORT(ArmPlatformIsPrimaryCore)
GCC_ASM_EXPORT(ArmPlatformPeiBootAction)
+GCC_ASM_EXPORT(ArmPlatformGetPrimaryCoreMpId)
/**
ArmPlatformPrePiBootAction
@@ -117,3 +118,12 @@ ASM_PFX(ArmPlatformPeiBootAction):
mov pc, lr
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
+
+//UINTN
+//ArmPlatformGetPrimaryCoreMpId (
+// VOID
+// );
+ASM_PFX(ArmPlatformGetPrimaryCoreMpId):
+ LoadConstantToReg (_gPcd_FixedAtBuild_PcdArmPrimaryCore, r0)
+ ldr r0, [r0]
+ bx lr
diff --git a/PandaBoardPkg/Library/PandaBoardLib/PandaBoardMem.c b/PandaBoardPkg/Library/PandaBoardLib/PandaBoardMem.c
index 334cb094e..fe082c2a6 100755
--- a/PandaBoardPkg/Library/PandaBoardLib/PandaBoardMem.c
+++ b/PandaBoardPkg/Library/PandaBoardLib/PandaBoardMem.c
@@ -55,9 +55,9 @@ ArmPlatformGetVirtualMemoryMap (
}
// ReMap (Either NOR Flash or DRAM)
- VirtualMemoryTable[Index].PhysicalBase = PcdGet32(PcdSystemMemoryBase);
- VirtualMemoryTable[Index].VirtualBase = PcdGet32(PcdSystemMemoryBase);
- VirtualMemoryTable[Index].Length = PcdGet32(PcdSystemMemorySize);
+ VirtualMemoryTable[Index].PhysicalBase = PcdGet64(PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].VirtualBase = PcdGet64(PcdSystemMemoryBase);
+ VirtualMemoryTable[Index].Length = PcdGet64(PcdSystemMemorySize);
VirtualMemoryTable[Index].Attributes = CacheAttributes;
// SOC Registers. L3 interconnects
diff --git a/PandaBoardPkg/PandaBoardPkg.dsc b/PandaBoardPkg/PandaBoardPkg.dsc
index 21a75cfb8..b6a9617fb 100644
--- a/PandaBoardPkg/PandaBoardPkg.dsc
+++ b/PandaBoardPkg/PandaBoardPkg.dsc
@@ -133,8 +133,7 @@
[LibraryClasses.common.SEC]
ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibPrePi.inf
ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.inf
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
+ ArmGicLib|ArmPkg/Drivers/ArmGic/ArmGicLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
@@ -409,7 +408,7 @@
}
ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
+ ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
diff --git a/PandaBoardPkg/PandaBoardPkg.fdf b/PandaBoardPkg/PandaBoardPkg.fdf
index 88881084f..d78dea9d3 100644
--- a/PandaBoardPkg/PandaBoardPkg.fdf
+++ b/PandaBoardPkg/PandaBoardPkg.fdf
@@ -96,7 +96,7 @@ READ_LOCK_STATUS = TRUE
# PI DXE Drivers producing Architectural Protocols (EFI Services)
#
INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
+ INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dec b/PcAtChipsetPkg/PcAtChipsetPkg.dec
index 8defe3b4b..7bf0760c5 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.dec
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dec
@@ -4,7 +4,7 @@
# This package is designed to public interfaces and implementation which follows
# PcAt defacto standard.
#
-# Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -20,7 +20,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = PcAtChipsetPkg
PACKAGE_GUID = B728689A-52D3-4b8c-AE89-2CE5514CC6DC
- PACKAGE_VERSION = 0.2
+ PACKAGE_VERSION = 0.3
[Includes]
Include
diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.dsc b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
index c86661dd6..a91f094ce 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.dsc
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.dsc
@@ -1,7 +1,7 @@
## @file
# PC/AT Chipset Package
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,7 +16,7 @@
[Defines]
PLATFORM_NAME = PcAtChipset
PLATFORM_GUID = a653167b-34d7-4b91-bfe3-f0c7608f48da
- PLATFORM_VERSION = 0.2
+ PLATFORM_VERSION = 0.3
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/PcAtChipset
SUPPORTED_ARCHITECTURES = IA32|X64
diff --git a/SamsungPlatformPkg/ArndaleBoardPkg/Library/ArndaleBoardLib/Exynos5250/BoardMem.c b/SamsungPlatformPkg/ArndaleBoardPkg/Library/ArndaleBoardLib/Exynos5250/BoardMem.c
index 051776d42..fcb13f8ec 100755
--- a/SamsungPlatformPkg/ArndaleBoardPkg/Library/ArndaleBoardLib/Exynos5250/BoardMem.c
+++ b/SamsungPlatformPkg/ArndaleBoardPkg/Library/ArndaleBoardLib/Exynos5250/BoardMem.c
@@ -61,8 +61,8 @@ ArmPlatformGetVirtualMemoryMap (
DEBUG ((EFI_D_ERROR, "++%a:%d\n", __FUNCTION__, __LINE__));
- UINTN MemoryBase_Pcd = PcdGet32(PcdSystemMemoryBase);
- UINTN MemorySize_Pcd = PcdGet32(PcdSystemMemorySize);
+ UINTN MemoryBase_Pcd = PcdGet64(PcdSystemMemoryBase);
+ UINTN MemorySize_Pcd = PcdGet64(PcdSystemMemorySize);
UINTN FrameBufferBase_Pcd = PcdGet32(PcdFrameBufferBase);
UINTN FrameBufferSize_Pcd = PcdGet32(PcdFrameBufferSize);
UINTN MpSharedArgsBase_Pcd = PcdGet32(PcdMpSharedArgsBase);
diff --git a/SamsungPlatformPkg/ExynosPkg/Exynos5250/MemoryInitPei/MemoryInitPeiLib.c b/SamsungPlatformPkg/ExynosPkg/Exynos5250/MemoryInitPei/MemoryInitPeiLib.c
index affc7da58..a24da2f60 100644
--- a/SamsungPlatformPkg/ExynosPkg/Exynos5250/MemoryInitPei/MemoryInitPeiLib.c
+++ b/SamsungPlatformPkg/ExynosPkg/Exynos5250/MemoryInitPei/MemoryInitPeiLib.c
@@ -101,16 +101,16 @@ MemoryPeim (
BuildResourceDescriptorHob (
EFI_RESOURCE_SYSTEM_MEMORY,
ResourceAttributes,
- PcdGet32 (PcdSystemMemoryBase),
- PcdGet32 (PcdSystemMemorySize)
+ PcdGet64 (PcdSystemMemoryBase),
+ PcdGet64 (PcdSystemMemorySize)
);
- SystemMemoryTop = PcdGet32 (PcdSystemMemoryBase) + PcdGet32 (PcdSystemMemorySize);
+ SystemMemoryTop = PcdGet64 (PcdSystemMemoryBase) + PcdGet64 (PcdSystemMemorySize);
FdTop = PcdGet32(PcdFdBaseAddress) + PcdGet32(PcdFdSize);
// EDK2 does not have the concept of boot firmware copied into DRAM. To avoid the DXE
// core to overwrite this area we must mark the region with the attribute non-present
- if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet32 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
+ if ((PcdGet32 (PcdFdBaseAddress) >= PcdGet64 (PcdSystemMemoryBase)) && (FdTop <= SystemMemoryTop)) {
Found = FALSE;
// Search for System Memory Hob that contains the firmware
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec b/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
deleted file mode 100644
index dee89469c..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
+++ /dev/null
@@ -1,55 +0,0 @@
-#/** @file
-# Arm RealView EB package.
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-#
-# 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 = ExynosPkg
- PACKAGE_GUID = ec1a4982-4a00-47e7-8df5-69c8ce895427
- PACKAGE_VERSION = 0.1
-
-################################################################################
-#
-# Include Section - list of Include Paths that are provided by this package.
-# Comments are used for Keywords and Module Types.
-#
-# Supported Module Types:
-# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
-#
-################################################################################
-[Includes.common]
- Include # Root include for the package
-
-[Guids.common]
- gExynosPkgTokenSpaceGuid = { 0x70b6655a, 0x7a03, 0x11e0, { 0xbe, 0x19, 0x00, 0x26, 0xb9, 0x73, 0x3e, 0x2c} }
-
-[PcdsFeatureFlag.common]
-
-[PcdsFixedAtBuild.common]
- gExynosPkgTokenSpaceGuid.PcdPeiServicePtrAddr|0|UINT32|0x00000003
- gExynosPkgTokenSpaceGuid.PcdConsoleUartBase|0|UINT32|0x00000004
- gExynosPkgTokenSpaceGuid.PcdCmuBase|0|UINT32|0x00000005
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase|0|UINT32|0x00000006
- gExynosPkgTokenSpaceGuid.PcdPmuBase|0|UINT32|0x00000007
- gExynosPkgTokenSpaceGuid.PcdGdbUartBase|0|UINT32|0x00000008
- gExynosPkgTokenSpaceGuid.PcdGpioPart1Base|0|UINT32|0x00000009
- gExynosPkgTokenSpaceGuid.PcdGpioPart2Base|0|UINT32|0x0000000a
- gExynosPkgTokenSpaceGuid.PcdSdMmcBase|0|UINT32|0x0000000b
- gExynosPkgTokenSpaceGuid.PcdSysBase|0|UINT32|0x0000000c
- gExynosPkgTokenSpaceGuid.PcdFIMD0Base|0|UINT32|0x0000000d
- gExynosPkgTokenSpaceGuid.PcdGICBase|0|UINT32|0x0000000e
- gExynosPkgTokenSpaceGuid.PcdTZPCBase|0|UINT32|0x0000000f
-
-# Samsung specific GUID = be26dd4f-9d02-413c-aa4f-dcd4aa334122
-[Protocols.common]
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dsc b/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dsc
deleted file mode 100644
index 82581d97b..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dsc
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# Copyright (c) 2011, Samsung Electronics Co. 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 = ExynosPkg
- PLATFORM_GUID = 216e3ea0-f2b3-4d6f-a286-4d71431185c6
- PLATFORM_VERSION = 0.1
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/ExynosPkg
- SUPPORTED_ARCHITECTURES = ARM
- BUILD_TARGETS = DEBUG|RELEASE
- SKUID_IDENTIFIER = DEFAULT
- DEFINE TARGET_HACK = DEBUG
-
-[LibraryClasses.common]
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
-
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
-
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
-
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
-
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-
- DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
- TimerLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf
- UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAllocationLib/DebugUncachedMemoryAllocationLib.inf
-
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- ExynosLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
-
-[LibraryClasses.ARM]
- #
- # It is not possible to prevent the ARM compiler for generic intrinsic functions.
- # This library provides the instrinsic functions generate by a given compiler.
- # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
-[BuildOptions]
- RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A9 --thumb --fpu=softvfp
- RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A9
- RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- GCC:*_*_ARM_ARCHCC_FLAGS == -march=armv7-a -mthumb
- GCC:*_*_ARM_ARCHASM_FLAGS == -march=armv7-a
- GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- XCODE:*_*_ARM_ARCHCC_FLAGS == -arch armv7 -march=armv7
- XCODE:*_*_ARM_ARCHASM_FLAGS == -arch armv7
- XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7
- XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
-
-################################################################################
-#
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-
-[PcdsFeatureFlag.common]
-
-[PcdsFixedAtBuild.common]
-
- gExynosPkgTokenSpaceGuid.PcdGdbUartBase|0x1000a000
- gExynosPkgTokenSpaceGuid.PcdConsoleUartBase|0x13810000
- gExynosPkgTokenSpaceGuid.PcdCmuBase|0x10030000
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase|0x139d0000
- gExynosPkgTokenSpaceGuid.PcdPmuBase|0x10020000
- gExynosPkgTokenSpaceGuid.PcdGpioPart1Base|0x11400000
- gExynosPkgTokenSpaceGuid.PcdGpioPart2Base|0x11000000
- gExynosPkgTokenSpaceGuid.PcdSdMmcBase|0x12530000
- gExynosPkgTokenSpaceGuid.PcdSysBase|0x10010000
- gExynosPkgTokenSpaceGuid.PcdFIMD0Base|0x11C00000
- gExynosPkgTokenSpaceGuid.PcdGICBase|0x10500000
- gExynosPkgTokenSpaceGuid.PcdTZPCBase|0x10100000
-
-################################################################################
-#
-# Components Section - list of all EDK II Modules needed by this Platform
-#
-################################################################################
-[Components.common]
- SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
-
- SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.c b/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.c
deleted file mode 100644
index 68234c444..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.c
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @file
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <Uefi.h>
-
-#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Protocol/ExynosGpio.h>
-#include <Platform/ArmPlatform.h>
-#include <Library/ExynosLib.h>
-
-
-
-EFI_STATUS
-Get (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- OUT UINTN *Value
- )
-{
- UINTN Port;
- UINTN Pin;
- UINT32 DataInRegister;
-
- if (Value == NULL)
- {
- return EFI_UNSUPPORTED;
- }
-
- Port = GPIO_PORT(Gpio);
- Pin = GPIO_PIN(Gpio);
-
- DataInRegister = GpioBase(Port) + GPIO_DATAIN;
-
- if (MmioRead32 (DataInRegister) & GPIO_DATAIN_MASK(Pin)) {
- *Value = 1;
- } else {
- *Value = 0;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-Set (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_MODE Mode
- )
-{
- UINTN Port;
- UINTN Pin;
- UINT32 OutputRegister;
-
- Port = GPIO_PORT(Gpio);
- Pin = GPIO_PIN(Gpio);
- OutputRegister = GpioBase(Port) + GPIO_CON;
- switch (Mode)
- {
- case GPIO_MODE_INPUT:
- break;
- case GPIO_MODE_OUTPUT_0:
- MmioAndThenOr32(OutputRegister, ~GPIO_SFN_MASK(Pin), GPIO_OP_EN(Pin));
- MmioAndThenOr32((GpioBase(Port) + GPIO_DATAIN), ~GPIO_DATAIN_MASK(Pin), GPIO_DATA_LOW(Pin));
- break;
- case GPIO_MODE_OUTPUT_1:
- MmioAndThenOr32(OutputRegister, ~GPIO_SFN_MASK(Pin), GPIO_OP_EN(Pin));
- MmioAndThenOr32((GpioBase(Port) + GPIO_DATAIN), ~GPIO_DATAIN_MASK(Pin), GPIO_DATA_HIGH(Pin));
- break;
- case GPIO_MODE_SPECIAL_FUNCTION_2:
- MmioAndThenOr32(OutputRegister, ~GPIO_SFN_MASK(Pin), GPIO_SFN_EN(Pin));
- break;
- default:
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-GetMode (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- OUT EXYNOS_GPIO_MODE *Mode
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-EFI_STATUS
-SetPull (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_PULL Direction
- )
-{
- UINTN Port;
- UINTN Pin;
- UINT32 OutputRegister;
-
- Port = GPIO_PORT(Gpio);
- Pin = GPIO_PIN(Gpio);
- OutputRegister = GpioBase(Port) + GPIO_PUD;
- switch (Direction)
- {
- case GPIO_PULL_NONE:
- MmioAndThenOr32(OutputRegister, ~GPIO_PUD_MASK(Pin), GPIO_PUD_DIS(Pin));
- break;
- case GPIO_PULL_UP:
- MmioAndThenOr32(OutputRegister, ~GPIO_PUD_MASK(Pin), GPIO_PUP_EN(Pin));
- break;
- case GPIO_PULL_DOWN:
- MmioAndThenOr32(OutputRegister, ~GPIO_PUD_MASK(Pin), GPIO_PDN_EN(Pin));
- break;
- default:
- return EFI_UNSUPPORTED;
- }
-
- return EFI_SUCCESS;
-}
-
-
-
-EFI_STATUS
-SetStrength (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_STRN Strength
- )
-{
- UINTN Port;
- UINTN Pin;
- UINT32 OutputRegister;
-
- Port = GPIO_PORT(Gpio);
- Pin = GPIO_PIN(Gpio);
- OutputRegister = GpioBase(Port) + GPIO_DRV;
- MmioAndThenOr32(OutputRegister, ~GPIO_DRV_MASK(Pin), GPIO_DRV_SET(Strength,Pin));
-
- return EFI_SUCCESS;
-}
-
-
-
-EXYNOS_GPIO Gpio = {
- Get,
- Set,
- GetMode,
- SetPull,
- SetStrength
-};
-
-EFI_STATUS
-GpioInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->InstallMultipleProtocolInterfaces(&ImageHandle, &gSamsungPlatformGpioProtocolGuid, &Gpio, NULL);
- return Status;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf
deleted file mode 100644
index 9fab02437..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf
+++ /dev/null
@@ -1,46 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = Gpio
- FILE_GUID = E7D9CAE1-6930-46E3-BDF9-0027446E7DF2
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = GpioInitialize
-
-
-[Sources.common]
- Gpio.c
-
-[Packages]
- MdePkg/MdePkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
- SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec
-
-[LibraryClasses]
- IoLib
- UefiDriverEntryPoint
- ExynosLib
- DebugLib
-
-[Guids]
-
-[Protocols]
- gSamsungPlatformGpioProtocolGuid
-
-[Pcd]
-
-[depex]
- TRUE
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ComponentName.c b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ComponentName.c
deleted file mode 100755
index 1918cf862..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ComponentName.c
+++ /dev/null
@@ -1,182 +0,0 @@
-/** @file
- UEFI Component Name(2) protocol implementation for GraphicsConsole driver.
-
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
-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 "GraphicsConsole.h"
-
-//
-// EFI Component Name Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName = {
- GraphicsConsoleComponentNameGetDriverName,
- GraphicsConsoleComponentNameGetControllerName,
- "eng"
-};
-
-//
-// EFI Component Name 2 Protocol
-//
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2 = {
- (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) GraphicsConsoleComponentNameGetDriverName,
- (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) GraphicsConsoleComponentNameGetControllerName,
- "en"
-};
-
-
-GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mGraphicsConsoleDriverNameTable[] = {
- {
- "eng;en",
- (CHAR16 *)L"UGA Console Driver"
- },
- {
- NULL,
- NULL
- }
-};
-
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- )
-{
- return LookupUnicodeString2 (
- Language,
- This->SupportedLanguages,
- mGraphicsConsoleDriverNameTable,
- DriverName,
- (BOOLEAN)(This == &gGraphicsConsoleComponentName)
- );
-}
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- )
-{
- return EFI_UNSUPPORTED;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.c b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.c
deleted file mode 100755
index 72e9f8ac3..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.c
+++ /dev/null
@@ -1,575 +0,0 @@
-/** @file
- Template for Timer Architecture Protocol driver of the ARM flavor
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <PiDxe.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Library/TimerLib.h>
-#include <Protocol/GraphicsOutput.h>
-#include <Protocol/ExynosGpio.h>
-#include <Platform/ArmPlatform.h>
-#include "ExynosGop.h"
-#include "GraphicsConsole.h"
-
-
-//#define LCD_AMS369FG06
-#define LCD_WA101S
-
-#ifdef LCD_AMS369FG06
-#define LCD_WIDTH 480
-#define LCD_HEIGHT 800
-#define VCLK 24360000
-#endif
-
-#ifdef LCD_WA101S
-#define LCD_WIDTH 1366
-#define LCD_HEIGHT 768
-#define VCLK 72332000
-#endif
-
-#define SRC_CLK 133333333
-#define FB_ADDR 0x4E000000
-
-/**
- This function configures the Power Domain of the LCD 0 Module to Normal Mode.
-**/
-VOID ConfigureLcdPower(VOID)
-{
- UINT32 PrevGateState;
-
- /* Enable LCD0 power domain */
- PrevGateState = MmioRead32((PcdGet32(PcdCmuBase) + CLKGATE_IP_LCD0_OFFSET));
-
- MmioAndThenOr32((PcdGet32(PcdCmuBase) + CLKGATE_IP_LCD0_OFFSET), \
- ~CLK_PPMULCD0_MASK,CLK_PPMULCD0_MASK);
- MmioWrite32((PcdGet32(PcdPmuBase) + PMU_LCD0_CONF_OFFSET), \
- LCD0_PWR_NRML_MODE);
- while( (MmioRead32((PcdGet32(PcdPmuBase) + PMU_LCD0_STAT_OFFSET)) \
- & LCD0_PWR_NRML_MODE) != LCD0_PWR_NRML_MODE);
-
- MmioWrite32((PcdGet32(PcdCmuBase) + CLKGATE_IP_LCD0_OFFSET), PrevGateState);
-}
-
-/**
- This function configures Clock Source,Clock gating,Clock Divider and Mask values for the
- FIMD0 in the LCD0 Module
-
-**/
-VOID ConfigureLcd0Clk(VOID)
-{
- MmioAndThenOr32((PcdGet32(PcdCmuBase) + CLKGATE_IP_LCD0_OFFSET), \
- ~CLKGATE_FIMD0_MASK,CLKGATE_FIMD0_MASK);
- /* MPLL is the clock source of FIMD0 IP */
- MmioAndThenOr32((PcdGet32(PcdCmuBase) + CLKSRC_LCD0_OFFSET), \
- ~CLKSRC_FIMD0_MASK, CLKSRC_FIMD0_SEL(FIMD0_SCLKMPLL));
-
- /* Considering MPLL=800000000(800 MHz), SCLK_FIMD0=133333333(133.33 MHz) => DIV => (800/133.33) => 6
- The DIV value to be programmed should be (6 -1) = 5 */
- MmioAndThenOr32((PcdGet32(PcdCmuBase) + CLKDIV_LCD0_OFFSET), \
- ~CLKDIV_FIMD0_MASK, CLKDIV_FIMD0_SEL(FIMD0_CLK_DIV));
-
- MmioOr32((PcdGet32(PcdCmuBase) + CLKSRC_MASK_LCD0_OFFSET), FIMD0_UNMASK);
-}
-
-/**
- This function does the necessary GPIO configuration for the Initialization of the LCD
-
-**/
-#ifdef LCD_WA101S
-VOID ConfigureLcdGpio(VOID)
-{
- EFI_STATUS Status;
- EXYNOS_GPIO *Gpio;
-
- Status = gBS->LocateProtocol(&gSamsungPlatformGpioProtocolGuid, NULL, (VOID **)&Gpio);
- ASSERT_EFI_ERROR(Status);
-
-/********************************************************************************
- GPIO Control
- Pull Up/Down
- Driving strenght Setting of GPIO Port F0 for LCD
-********************************************************************************/
- Gpio->Set(Gpio,LCD_HSYNC,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VSYNC,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VDEN,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VCLK,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_0,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_1,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_2,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_3,GPIO_MODE_SPECIAL_FUNCTION_2);
-
- Gpio->SetPull(Gpio,LCD_HSYNC,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VSYNC,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VDEN,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VCLK,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_0,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_1,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_2,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_3,GPIO_PULL_NONE);
-
-
- Gpio->SetStrength(Gpio,LCD_HSYNC,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VSYNC,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VDEN,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VCLK,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_0,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_1,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_2,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_3,GPIO_DRV_4X);
-
-/********************************************************************************
- GPIO Control
- Pull Up/Down
- Driving strenght Setting of GPIO Port F1 for LCD
-********************************************************************************/
- Gpio->Set(Gpio,LCD_VD_4,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_5,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_6,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_7,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_8,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_9,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_10,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_11,GPIO_MODE_SPECIAL_FUNCTION_2);
-
- Gpio->SetPull(Gpio,LCD_VD_4,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_5,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_6,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_7,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_8,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_9,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_10,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_11,GPIO_PULL_NONE);
-
-
- Gpio->SetStrength(Gpio,LCD_VD_4,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_5,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_6,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_7,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_8,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_9,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_10,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_11,GPIO_DRV_4X);
-
-/********************************************************************************
- GPIO Control
- Pull Up/Down
- Driving strenght Setting of GPIO Port F2 for LCD
-********************************************************************************/
- Gpio->Set(Gpio,LCD_VD_12,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_13,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_14,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_15,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_16,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_17,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_18,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_19,GPIO_MODE_SPECIAL_FUNCTION_2);
-
- Gpio->SetPull(Gpio,LCD_VD_12,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_13,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_14,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_15,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_16,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_17,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_18,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_19,GPIO_PULL_NONE);
-
-
- Gpio->SetStrength(Gpio,LCD_VD_12,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_13,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_14,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_15,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_16,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_17,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_18,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_19,GPIO_DRV_4X);
-
-/********************************************************************************
- GPIO Control
- Pull Up/Down
- Driving strenght Setting of GPIO Port F3 for LCD
-********************************************************************************/
- Gpio->Set(Gpio,LCD_VD_20,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_21,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_22,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,LCD_VD_23,GPIO_MODE_SPECIAL_FUNCTION_2);
-
- Gpio->SetPull(Gpio,LCD_VD_20,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_21,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_22,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,LCD_VD_23,GPIO_PULL_NONE);
-
-
- Gpio->SetStrength(Gpio,LCD_VD_20,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_21,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_22,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,LCD_VD_23,GPIO_DRV_4X);
-
- /* Set FIMD0 bypass */
- MmioOr32((PcdGet32(PcdSysBase) + SYS_DISPLAY_CONTROL_OFFSET), FIMDBYPASS_LBLK0);
-
-}
-
-/**
- This function configures POrt D0 Pin1 as the Output Pin to control the Enable/Disable of
- LCD BackLight
-
-**/
-VOID EnableBackLight(VOID)
-{
- EFI_STATUS Status;
- EXYNOS_GPIO *Gpio;
-
- Status = gBS->LocateProtocol(&gSamsungPlatformGpioProtocolGuid, NULL, (VOID **)&Gpio);
- ASSERT_EFI_ERROR(Status);
-
- Gpio->Set(Gpio,LCD_BACKLIGHT,GPIO_MODE_OUTPUT_1);
-}
-
-VOID lcd_on(VOID)
-{
-}
-#endif
-
-
-VOID LCD_Initialize(VOID)
-{
- UINTN div;
- UINT32 Fimd0BaseAddr;
- gBS->SetMem((VOID *)FB_ADDR, (LCD_WIDTH*LCD_HEIGHT*4), 0x0);
-
- Fimd0BaseAddr = PcdGet32(PcdFIMD0Base);
- ConfigureLcdPower();
- ConfigureLcdGpio();
- ConfigureLcd0Clk();
-
- /* Configure FIMD */
- MmioAndThenOr32(Fimd0BaseAddr + VIDCON0_OFFSET, ~S5P_VIDCON0_VIDOUT_MASK, S5P_VIDCON0_VIDOUT_RGB);
-
- MmioAndThenOr32(Fimd0BaseAddr + VIDCON2_OFFSET, ~(S5P_VIDCON2_WB_MASK | S5P_VIDCON2_TVFORMATSEL_MASK | \
- S5P_VIDCON2_TVFORMATSEL_YUV_MASK), S5P_VIDCON2_WB_DISABLE);
-
- MmioAndThenOr32(Fimd0BaseAddr + VIDCON0_OFFSET, ~S5P_VIDCON0_PNRMODE_MASK, S5P_VIDCON0_PNRMODE_RGB_P);
-
-#ifdef LCD_WA101S
- MmioOr32(Fimd0BaseAddr + VIDCON1_OFFSET, (S5P_VIDCON1_IVCLK_RISING_EDGE | S5P_VIDCON1_IHSYNC_INVERT | \
- S5P_VIDCON1_IVSYNC_INVERT | S5P_VIDCON1_IVDEN_NORMAL));
-
- MmioOr32(Fimd0BaseAddr + VIDTCON0_OFFSET, (S5P_VIDTCON0_VBPDE(-1) | S5P_VIDTCON0_VBPD(13) | \
- S5P_VIDTCON0_VFPD(2) | S5P_VIDTCON0_VSPW(4)));
-
- MmioOr32(Fimd0BaseAddr + VIDTCON1_OFFSET, (S5P_VIDTCON1_VFPDE(-1) | S5P_VIDTCON1_HBPD(79) | \
- S5P_VIDTCON1_HFPD(47) | S5P_VIDTCON1_HSPW(31)));
-
-#endif
-
- MmioOr32(Fimd0BaseAddr + VIDTCON2_OFFSET, (S5P_VIDTCON2_HOZVAL(LCD_WIDTH - 1) | S5P_VIDTCON2_LINEVAL(LCD_HEIGHT - 1)));
-
- MmioAndThenOr32(Fimd0BaseAddr + WINCON_OFFSET(0), ~(S5P_WINCON_BITSWP_ENABLE | S5P_WINCON_BYTESWP_ENABLE | \
- S5P_WINCON_HAWSWP_ENABLE | S5P_WINCON_WSWP_ENABLE | S5P_WINCON_BURSTLEN_MASK | \
- S5P_WINCON_BPPMODE_MASK | S5P_WINCON_INRGB_MASK | S5P_WINCON_DATAPATH_MASK), \
- (S5P_WINCON_WSWP_ENABLE | S5P_WINCON_BURSTLEN_16WORD | \
- S5P_WINCON_BPPMODE_24BPP_888));
-
- MmioOr32(Fimd0BaseAddr + WINSHMAP_OFFSET, S5P_WINSHMAP_PROTECT(0));
- MmioWrite32(Fimd0BaseAddr + VIDOSD_A_OFFSET(0), (S5P_VIDOSD_LEFT_X(0) | S5P_VIDOSD_TOP_Y(0)));
- MmioWrite32(Fimd0BaseAddr + VIDOSD_B_OFFSET(0), (S5P_VIDOSD_RIGHT_X(LCD_WIDTH - 1) | \
- S5P_VIDOSD_BOTTOM_Y(LCD_HEIGHT - 1)));
- MmioAnd32(Fimd0BaseAddr + WINSHMAP_OFFSET, ~(S5P_WINSHMAP_PROTECT(0)));
-
- MmioWrite32(Fimd0BaseAddr + VIDOSD_C_OFFSET(0), S5P_VIDOSD_SIZE(LCD_WIDTH * LCD_HEIGHT));
-
- MmioOr32(Fimd0BaseAddr + WINSHMAP_OFFSET, S5P_WINSHMAP_PROTECT(0));
- MmioWrite32(Fimd0BaseAddr + VIDADDR_START0_OFFSET(0), FB_ADDR);
- MmioWrite32(Fimd0BaseAddr + VIDADDR_END0_OFFSET(0), (FB_ADDR + (LCD_WIDTH * LCD_HEIGHT * 4)));
- MmioAnd32(Fimd0BaseAddr + WINSHMAP_OFFSET, ~(S5P_WINSHMAP_PROTECT(0)));
-
- MmioWrite32(Fimd0BaseAddr + VIDADDR_SIZE_OFFSET(0), (S5P_VIDADDR_PAGEWIDTH(LCD_WIDTH * 4) | S5P_VIDADDR_OFFSIZE(0)));
-
- div = SRC_CLK / VCLK;
- if(SRC_CLK % VCLK)
- div++;
-
- MmioAndThenOr32(Fimd0BaseAddr + VIDCON0_OFFSET, ~(S5P_VIDCON0_CLKVALUP_MASK | S5P_VIDCON0_VCLKEN_MASK), \
- (S5P_VIDCON0_CLKVALUP_ALWAYS | S5P_VIDCON0_VCLKEN_NORMAL | \
- S5P_VIDCON0_CLKVAL_F(div - 1)));
-
- MmioOr32(Fimd0BaseAddr + WINCON_OFFSET(0), S5P_WINCON_ENWIN_ENABLE);
- MmioOr32(Fimd0BaseAddr + WINSHMAP_OFFSET, S5P_WINSHMAP_CH_ENABLE(0));
-
- MmioOr32(Fimd0BaseAddr + VIDCON0_OFFSET, (S5P_VIDCON0_ENVID_ENABLE | S5P_VIDCON0_ENVID_F_ENABLE));
-
- EnableBackLight();
-
- lcd_on();
-}
-
-EFI_STATUS
-EFIAPI
-DisplayQueryMode(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber,
- OUT UINTN *SizeOfInfo,
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
- );
-
-EFI_STATUS
-EFIAPI
-DisplaySetMode(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber
- );
-
-EFI_STATUS
-EFIAPI
-DisplayBlt(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- );
-
-EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplay = {
- DisplayQueryMode,
- DisplaySetMode,
- DisplayBlt,
- NULL
-};
-
-
-EFI_STATUS
-EFIAPI
-DisplayQueryMode(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber,
- OUT UINTN *SizeOfInfo,
- OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->AllocatePool(
- EfiBootServicesData,
- sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
- (VOID **)Info
- );
- ASSERT_EFI_ERROR(Status);
-
- *SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
-
- (*Info)->Version = This->Mode->Info->Version;
- (*Info)->HorizontalResolution = This->Mode->Info->HorizontalResolution;
- (*Info)->VerticalResolution = This->Mode->Info->VerticalResolution;
- (*Info)->PixelFormat = This->Mode->Info->PixelFormat;
- (*Info)->PixelsPerScanLine = This->Mode->Info->PixelsPerScanLine;
-
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-DisplaySetMode(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN UINT32 ModeNumber
- )
-{
- return EFI_SUCCESS;
-}
-
-EFI_STATUS
-EFIAPI
-DisplayBlt(
- IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
- IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
- IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
- IN UINTN SourceX,
- IN UINTN SourceY,
- IN UINTN DestinationX,
- IN UINTN DestinationY,
- IN UINTN Width,
- IN UINTN Height,
- IN UINTN Delta OPTIONAL
- )
-{
- UINT8 *VidBuf, *BltBuf, *VidBuf1;
- UINTN i, j;
-
- switch(BltOperation) {
- case EfiBltVideoFill:
- BltBuf = (UINT8 *)BltBuffer;
-
- for(i=0;i<Height;i++) {
- VidBuf = (UINT8 *)((UINT32)This->Mode->FrameBufferBase + \
- (DestinationY + i)*This->Mode->Info->PixelsPerScanLine*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + \
- DestinationX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- for(j=0;j<Width;j++) {
- gBS->CopyMem((VOID *)VidBuf, (VOID *)BltBuf, sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- VidBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- }
- }
- break;
-
- case EfiBltVideoToBltBuffer:
- if(Delta == 0)
- Delta = Width * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
-
- for(i=0;i<Height;i++) {
- VidBuf = (UINT8 *)((UINT32)This->Mode->FrameBufferBase + \
- (SourceY + i)*This->Mode->Info->PixelsPerScanLine*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + \
- SourceX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- BltBuf = (UINT8 *)((UINT32)BltBuffer + (DestinationY + i)*Delta + DestinationX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- for(j=0;j<Width;j++) {
- gBS->CopyMem((VOID *)BltBuf, (VOID *)VidBuf, sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- VidBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- BltBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- }
- }
- break;
-
- case EfiBltBufferToVideo:
- if(Delta == 0)
- Delta = Width * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
-
- for(i=0;i<Height;i++) {
- VidBuf = (UINT8 *)((UINT32)This->Mode->FrameBufferBase + \
- (DestinationY + i)*This->Mode->Info->PixelsPerScanLine*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + \
- DestinationX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- BltBuf = (UINT8 *)((UINT32)BltBuffer + (SourceY + i)*Delta + SourceX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- for(j=0;j<Width;j++) {
- gBS->CopyMem((VOID *)VidBuf, (VOID *)BltBuf, sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- VidBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- BltBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- }
- }
- break;
-
- case EfiBltVideoToVideo:
- for(i=0;i<Height;i++) {
- VidBuf = (UINT8 *)((UINT32)This->Mode->FrameBufferBase + \
- (SourceY + i)*This->Mode->Info->PixelsPerScanLine*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + \
- SourceX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- VidBuf1 = (UINT8 *)((UINT32)This->Mode->FrameBufferBase + \
- (DestinationY + i)*This->Mode->Info->PixelsPerScanLine*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL) + \
- DestinationX*sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
-
- for(j=0;j<Width;j++) {
- gBS->CopyMem((VOID *)VidBuf1, (VOID *)VidBuf, sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- VidBuf += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- VidBuf1 += sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
- }
- }
- break;
-
- default:
- ASSERT_EFI_ERROR(Status);
- }
-
- return EFI_SUCCESS;
-}
-
-
-
-
-/**
- Initialize the state information for the GOP Architectural Protocol
-
- @param ImageHandle of the loaded driver
- @param SystemTable Pointer to the System Table
-
- @retval EFI_SUCCESS Protocol registered
- @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure
- @retval EFI_DEVICE_ERROR Hardware problems
-
-**/
-EFI_STATUS
-ExynosGopConstructor (
- IN GRAPHICS_CONSOLE_DEV *Private
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
- /* Initialize Display */
- LCD_Initialize();
- if(Private->GraphicsOutput->Mode == NULL){
- Status = gBS->AllocatePool(
- EfiBootServicesData,
- sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE),
- (VOID **)&Private->GraphicsOutput->Mode
- );
- ASSERT_EFI_ERROR(Status);
- ZeroMem(Private->GraphicsOutput->Mode,sizeof(EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE));
- }
- if(Private->GraphicsOutput->Mode->Info==NULL){
- Status = gBS->AllocatePool(
- EfiBootServicesData,
- sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION),
- (VOID **)&Private->GraphicsOutput->Mode->Info
- );
- ASSERT_EFI_ERROR(Status);
- ZeroMem(Private->GraphicsOutput->Mode->Info,sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION));
- }
- /* Fill out mode information */
- Private->GraphicsOutput->Mode->MaxMode = 1;
- Private->GraphicsOutput->Mode->Mode = 0;
- Private->GraphicsOutput->Mode->Info->Version = 0;
- Private->GraphicsOutput->Mode->Info->HorizontalResolution = LCD_WIDTH;
- Private->GraphicsOutput->Mode->Info->VerticalResolution = LCD_HEIGHT;
- Private->GraphicsOutput->Mode->Info->PixelFormat = PixelBlueGreenRedReserved8BitPerColor;
- Private->GraphicsOutput->Mode->Info->PixelsPerScanLine = LCD_WIDTH;
- Private->GraphicsOutput->Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION);
- Private->GraphicsOutput->Mode->FrameBufferBase = FB_ADDR;
- Private->GraphicsOutput->Mode->FrameBufferSize = (LCD_WIDTH * LCD_HEIGHT * 4);
- return Status;
-}
-
-EFI_STATUS
-ExynosGopDestructor (
- GRAPHICS_CONSOLE_DEV *Private
- )
-{
- //
- // Free graphics output protocol occupied resource
- //
- if(Private != NULL){
- if(Private->GraphicsOutput != NULL){
- if (Private->GraphicsOutput->Mode != NULL) {
- if (Private->GraphicsOutput->Mode->Info != NULL) {
- gBS->FreePool (Private->GraphicsOutput->Mode->Info);
- Private->GraphicsOutput->Mode->Info =NULL;
- }
- gBS->FreePool (Private->GraphicsOutput->Mode);
- Private->GraphicsOutput->Mode=NULL;
- }
- }
- }
- return EFI_SUCCESS;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.h b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.h
deleted file mode 100755
index ebf30644a..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/ExynosGop.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/** @file
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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.
-*
-**/
-
-
-#ifndef _ExynosGop_H__
-#define _ExynosGop_H__
-
-/*
- * Bit Definitions
-*/
-
-/* VIDCON0 */
-#define S5P_VIDCON0_DSI_DISABLE (0 << 30)
-#define S5P_VIDCON0_DSI_ENABLE (1 << 30)
-#define S5P_VIDCON0_SCAN_PROGRESSIVE (0 << 29)
-#define S5P_VIDCON0_SCAN_INTERLACE (1 << 29)
-#define S5P_VIDCON0_SCAN_MASK (1 << 29)
-#define S5P_VIDCON0_VIDOUT_RGB (0 << 26)
-#define S5P_VIDCON0_VIDOUT_ITU (1 << 26)
-#define S5P_VIDCON0_VIDOUT_I80LDI0 (2 << 26)
-#define S5P_VIDCON0_VIDOUT_I80LDI1 (3 << 26)
-#define S5P_VIDCON0_VIDOUT_WB_RGB (4 << 26)
-#define S5P_VIDCON0_VIDOUT_WB_I80LDI0 (6 << 26)
-#define S5P_VIDCON0_VIDOUT_WB_I80LDI1 (7 << 26)
-#define S5P_VIDCON0_VIDOUT_MASK (7 << 26)
-#define S5P_VIDCON0_PNRMODE_RGB_P (0 << 17)
-#define S5P_VIDCON0_PNRMODE_BGR_P (1 << 17)
-#define S5P_VIDCON0_PNRMODE_RGB_S (2 << 17)
-#define S5P_VIDCON0_PNRMODE_BGR_S (3 << 17)
-#define S5P_VIDCON0_PNRMODE_MASK (3 << 17)
-#define S5P_VIDCON0_PNRMODE_SHIFT (17)
-#define S5P_VIDCON0_CLKVALUP_ALWAYS (0 << 16)
-#define S5P_VIDCON0_CLKVALUP_START_FRAME (1 << 16)
-#define S5P_VIDCON0_CLKVALUP_MASK (1 << 16)
-#define S5P_VIDCON0_CLKVAL_F(x) (((x) & 0xff) << 6)
-#define S5P_VIDCON0_VCLKEN_NORMAL (0 << 5)
-#define S5P_VIDCON0_VCLKEN_FREERUN (1 << 5)
-#define S5P_VIDCON0_VCLKEN_MASK (1 << 5)
-#define S5P_VIDCON0_CLKDIR_DIRECTED (0 << 4)
-#define S5P_VIDCON0_CLKDIR_DIVIDED (1 << 4)
-#define S5P_VIDCON0_CLKDIR_MASK (1 << 4)
-#define S5P_VIDCON0_CLKSEL_HCLK (0 << 2)
-#define S5P_VIDCON0_CLKSEL_SCLK (1 << 2)
-#define S5P_VIDCON0_CLKSEL_MASK (1 << 2)
-#define S5P_VIDCON0_ENVID_ENABLE (1 << 1)
-#define S5P_VIDCON0_ENVID_DISABLE (0 << 1)
-#define S5P_VIDCON0_ENVID_F_ENABLE (1 << 0)
-#define S5P_VIDCON0_ENVID_F_DISABLE (0 << 0)
-
-/* VIDCON1 */
-#define S5P_VIDCON1_IVCLK_FALLING_EDGE (0 << 7)
-#define S5P_VIDCON1_IVCLK_RISING_EDGE (1 << 7)
-#define S5P_VIDCON1_IHSYNC_NORMAL (0 << 6)
-#define S5P_VIDCON1_IHSYNC_INVERT (1 << 6)
-#define S5P_VIDCON1_IVSYNC_NORMAL (0 << 5)
-#define S5P_VIDCON1_IVSYNC_INVERT (1 << 5)
-#define S5P_VIDCON1_IVDEN_NORMAL (0 << 4)
-#define S5P_VIDCON1_IVDEN_INVERT (1 << 4)
-
-/* VIDCON2 */
-#define S5P_VIDCON2_EN601_DISABLE (0 << 23)
-#define S5P_VIDCON2_EN601_ENABLE (1 << 23)
-#define S5P_VIDCON2_EN601_MASK (1 << 23)
-#define S5P_VIDCON2_WB_DISABLE (0 << 15)
-#define S5P_VIDCON2_WB_ENABLE (1 << 15)
-#define S5P_VIDCON2_WB_MASK (1 << 15)
-#define S5P_VIDCON2_TVFORMATSEL_HW (0 << 14)
-#define S5P_VIDCON2_TVFORMATSEL_SW (1 << 14)
-#define S5P_VIDCON2_TVFORMATSEL_MASK (1 << 14)
-#define S5P_VIDCON2_TVFORMATSEL_YUV422 (1 << 12)
-#define S5P_VIDCON2_TVFORMATSEL_YUV444 (2 << 12)
-#define S5P_VIDCON2_TVFORMATSEL_YUV_MASK (3 << 12)
-#define S5P_VIDCON2_ORGYUV_YCBCR (0 << 8)
-#define S5P_VIDCON2_ORGYUV_CBCRY (1 << 8)
-#define S5P_VIDCON2_ORGYUV_MASK (1 << 8)
-#define S5P_VIDCON2_YUVORD_CBCR (0 << 7)
-#define S5P_VIDCON2_YUVORD_CRCB (1 << 7)
-#define S5P_VIDCON2_YUVORD_MASK (1 << 7)
-
-/* PRTCON */
-#define S5P_PRTCON_UPDATABLE (0 << 11)
-#define S5P_PRTCON_PROTECT (1 << 11)
-
-/* VIDTCON0 */
-#define S5P_VIDTCON0_VBPDE(x) (((x) & 0xff) << 24)
-#define S5P_VIDTCON0_VBPD(x) (((x) & 0xff) << 16)
-#define S5P_VIDTCON0_VFPD(x) (((x) & 0xff) << 8)
-#define S5P_VIDTCON0_VSPW(x) (((x) & 0xff) << 0)
-
-/* VIDTCON1 */
-#define S5P_VIDTCON1_VFPDE(x) (((x) & 0xff) << 24)
-#define S5P_VIDTCON1_HBPD(x) (((x) & 0xff) << 16)
-#define S5P_VIDTCON1_HFPD(x) (((x) & 0xff) << 8)
-#define S5P_VIDTCON1_HSPW(x) (((x) & 0xff) << 0)
-
-/* VIDTCON2 */
-#define S5P_VIDTCON2_LINEVAL(x) (((x) & 0x7ff) << 11)
-#define S5P_VIDTCON2_HOZVAL(x) (((x) & 0x7ff) << 0)
-
-/* Window 0~4 Control - WINCONx */
-#define S5P_WINCON_DATAPATH_DMA (0 << 22)
-#define S5P_WINCON_DATAPATH_LOCAL (1 << 22)
-#define S5P_WINCON_DATAPATH_MASK (1 << 22)
-#define S5P_WINCON_BUFSEL_0 (0 << 20)
-#define S5P_WINCON_BUFSEL_1 (1 << 20)
-#define S5P_WINCON_BUFSEL_MASK (1 << 20)
-#define S5P_WINCON_BUFSEL_SHIFT (20)
-#define S5P_WINCON_BUFAUTO_DISABLE (0 << 19)
-#define S5P_WINCON_BUFAUTO_ENABLE (1 << 19)
-#define S5P_WINCON_BUFAUTO_MASK (1 << 19)
-#define S5P_WINCON_BITSWP_DISABLE (0 << 18)
-#define S5P_WINCON_BITSWP_ENABLE (1 << 18)
-#define S5P_WINCON_BITSWP_SHIFT (18)
-#define S5P_WINCON_BYTESWP_DISABLE (0 << 17)
-#define S5P_WINCON_BYTESWP_ENABLE (1 << 17)
-#define S5P_WINCON_BYTESWP_SHIFT (17)
-#define S5P_WINCON_HAWSWP_DISABLE (0 << 16)
-#define S5P_WINCON_HAWSWP_ENABLE (1 << 16)
-#define S5P_WINCON_HAWSWP_SHIFT (16)
-#define S5P_WINCON_WSWP_DISABLE (0 << 15)
-#define S5P_WINCON_WSWP_ENABLE (1 << 15)
-#define S5P_WINCON_WSWP_SHIFT (15)
-#define S5P_WINCON_INRGB_RGB (0 << 13)
-#define S5P_WINCON_INRGB_YUV (1 << 13)
-#define S5P_WINCON_INRGB_MASK (1 << 13)
-#define S5P_WINCON_BURSTLEN_16WORD (0 << 9)
-#define S5P_WINCON_BURSTLEN_8WORD (1 << 9)
-#define S5P_WINCON_BURSTLEN_4WORD (2 << 9)
-#define S5P_WINCON_BURSTLEN_MASK (3 << 9)
-#define S5P_WINCON_ALPHA_MULTI_DISABLE (0 << 7)
-#define S5P_WINCON_ALPHA_MULTI_ENABLE (1 << 7)
-#define S5P_WINCON_BLD_PLANE (0 << 6)
-#define S5P_WINCON_BLD_PIXEL (1 << 6)
-#define S5P_WINCON_BLD_MASK (1 << 6)
-#define S5P_WINCON_BPPMODE_1BPP (0 << 2)
-#define S5P_WINCON_BPPMODE_2BPP (1 << 2)
-#define S5P_WINCON_BPPMODE_4BPP (2 << 2)
-#define S5P_WINCON_BPPMODE_8BPP_PAL (3 << 2)
-#define S5P_WINCON_BPPMODE_8BPP (4 << 2)
-#define S5P_WINCON_BPPMODE_16BPP_565 (5 << 2)
-#define S5P_WINCON_BPPMODE_16BPP_A555 (6 << 2)
-#define S5P_WINCON_BPPMODE_18BPP_666 (8 << 2)
-#define S5P_WINCON_BPPMODE_18BPP_A665 (9 << 2)
-#define S5P_WINCON_BPPMODE_24BPP_888 (0xb << 2)
-#define S5P_WINCON_BPPMODE_24BPP_A887 (0xc << 2)
-#define S5P_WINCON_BPPMODE_32BPP (0xd << 2)
-#define S5P_WINCON_BPPMODE_16BPP_A444 (0xe << 2)
-#define S5P_WINCON_BPPMODE_15BPP_555 (0xf << 2)
-#define S5P_WINCON_BPPMODE_MASK (0xf << 2)
-#define S5P_WINCON_BPPMODE_SHIFT (2)
-#define S5P_WINCON_ALPHA0_SEL (0 << 1)
-#define S5P_WINCON_ALPHA1_SEL (1 << 1)
-#define S5P_WINCON_ALPHA_SEL_MASK (1 << 1)
-#define S5P_WINCON_ENWIN_DISABLE (0 << 0)
-#define S5P_WINCON_ENWIN_ENABLE (1 << 0)
-
-/* WINCON1 special */
-#define S5P_WINCON1_VP_DISABLE (0 << 24)
-#define S5P_WINCON1_VP_ENABLE (1 << 24)
-#define S5P_WINCON1_LOCALSEL_FIMC1 (0 << 23)
-#define S5P_WINCON1_LOCALSEL_VP (1 << 23)
-#define S5P_WINCON1_LOCALSEL_MASK (1 << 23)
-
-/* WINSHMAP */
-#define S5P_WINSHMAP_PROTECT(x) (((x) & 0x1f) << 10)
-#define S5P_WINSHMAP_CH_ENABLE(x) (1 << (x))
-#define S5P_WINSHMAP_CH_DISABLE(x) (1 << (x))
-#define S5P_WINSHMAP_LOCAL_ENABLE(x) (0x20 << (x))
-#define S5P_WINSHMAP_LOCAL_DISABLE(x) (0x20 << (x))
-
-
-/* VIDOSDxA, VIDOSDxB */
-#define S5P_VIDOSD_LEFT_X(x) (((x) & 0x7ff) << 11)
-#define S5P_VIDOSD_TOP_Y(x) (((x) & 0x7ff) << 0)
-#define S5P_VIDOSD_RIGHT_X(x) (((x) & 0x7ff) << 11)
-#define S5P_VIDOSD_BOTTOM_Y(x) (((x) & 0x7ff) << 0)
-
-/* VIDOSD0C, VIDOSDxD */
-#define S5P_VIDOSD_SIZE(x) (((x) & 0xffffff) << 0)
-
-/* VIDOSDxC (1~4) */
-#define S5P_VIDOSD_ALPHA0_R(x) (((x) & 0xf) << 20)
-#define S5P_VIDOSD_ALPHA0_G(x) (((x) & 0xf) << 16)
-#define S5P_VIDOSD_ALPHA0_B(x) (((x) & 0xf) << 12)
-#define S5P_VIDOSD_ALPHA1_R(x) (((x) & 0xf) << 8)
-#define S5P_VIDOSD_ALPHA1_G(x) (((x) & 0xf) << 4)
-#define S5P_VIDOSD_ALPHA1_B(x) (((x) & 0xf) << 0)
-#define S5P_VIDOSD_ALPHA0_SHIFT (12)
-#define S5P_VIDOSD_ALPHA1_SHIFT (0)
-
-/* Start Address */
-#define S5P_VIDADDR_START_VBANK(x) (((x) & 0xff) << 24)
-#define S5P_VIDADDR_START_VBASEU(x) (((x) & 0xffffff) << 0)
-
-/* End Address */
-#define S5P_VIDADDR_END_VBASEL(x) (((x) & 0xffffff) << 0)
-
-/* Buffer Size */
-#define S5P_VIDADDR_OFFSIZE(x) (((x) & 0x1fff) << 13)
-#define S5P_VIDADDR_PAGEWIDTH(x) (((x) & 0x1fff) << 0)
-
-/* WIN Color Map */
-#define S5P_WINMAP_COLOR(x) ((x) & 0xffffff)
-
-/* VIDINTCON0 */
-#define S5P_VIDINTCON0_SYSMAINCON_DISABLE (0 << 19)
-#define S5P_VIDINTCON0_SYSMAINCON_ENABLE (1 << 19)
-#define S5P_VIDINTCON0_SYSSUBCON_DISABLE (0 << 18)
-#define S5P_VIDINTCON0_SYSSUBCON_ENABLE (1 << 18)
-#define S5P_VIDINTCON0_SYSIFDONE_DISABLE (0 << 17)
-#define S5P_VIDINTCON0_SYSIFDONE_ENABLE (1 << 17)
-#define S5P_VIDINTCON0_FRAMESEL0_BACK (0 << 15)
-#define S5P_VIDINTCON0_FRAMESEL0_VSYNC (1 << 15)
-#define S5P_VIDINTCON0_FRAMESEL0_ACTIVE (2 << 15)
-#define S5P_VIDINTCON0_FRAMESEL0_FRONT (3 << 15)
-#define S5P_VIDINTCON0_FRAMESEL0_MASK (3 << 15)
-#define S5P_VIDINTCON0_FRAMESEL1_NONE (0 << 13)
-#define S5P_VIDINTCON0_FRAMESEL1_BACK (1 << 13)
-#define S5P_VIDINTCON0_FRAMESEL1_VSYNC (2 << 13)
-#define S5P_VIDINTCON0_FRAMESEL1_FRONT (3 << 13)
-#define S5P_VIDINTCON0_INTFRMEN_DISABLE (0 << 12)
-#define S5P_VIDINTCON0_INTFRMEN_ENABLE (1 << 12)
-#define S5P_VIDINTCON0_FIFOSEL_WIN4 (1 << 11)
-#define S5P_VIDINTCON0_FIFOSEL_WIN3 (1 << 10)
-#define S5P_VIDINTCON0_FIFOSEL_WIN2 (1 << 9)
-#define S5P_VIDINTCON0_FIFOSEL_WIN1 (1 << 6)
-#define S5P_VIDINTCON0_FIFOSEL_WIN0 (1 << 5)
-#define S5P_VIDINTCON0_FIFOSEL_ALL (0x73 << 5)
-#define S5P_VIDINTCON0_FIFOSEL_MASK (0x73 << 5)
-#define S5P_VIDINTCON0_FIFOLEVEL_25 (0 << 2)
-#define S5P_VIDINTCON0_FIFOLEVEL_50 (1 << 2)
-#define S5P_VIDINTCON0_FIFOLEVEL_75 (2 << 2)
-#define S5P_VIDINTCON0_FIFOLEVEL_EMPTY (3 << 2)
-#define S5P_VIDINTCON0_FIFOLEVEL_FULL (4 << 2)
-#define S5P_VIDINTCON0_FIFOLEVEL_MASK (7 << 2)
-#define S5P_VIDINTCON0_INTFIFO_DISABLE (0 << 1)
-#define S5P_VIDINTCON0_INTFIFO_ENABLE (1 << 1)
-#define S5P_VIDINTCON0_INT_DISABLE (0 << 0)
-#define S5P_VIDINTCON0_INT_ENABLE (1 << 0)
-#define S5P_VIDINTCON0_INT_MASK (1 << 0)
-
-/* VIDINTCON1 */
-#define S5P_VIDINTCON1_INTVPPEND (1 << 5)
-#define S5P_VIDINTCON1_INTI80PEND (1 << 2)
-#define S5P_VIDINTCON1_INTFRMPEND (1 << 1)
-#define S5P_VIDINTCON1_INTFIFOPEND (1 << 0)
-
-/* WINMAP */
-#define S5P_WINMAP_ENABLE (1 << 24)
-
-/* WxKEYCON0 (1~4) */
-#define S5P_KEYCON0_KEYBLEN_DISABLE (0 << 26)
-#define S5P_KEYCON0_KEYBLEN_ENABLE (1 << 26)
-#define S5P_KEYCON0_KEY_DISABLE (0 << 25)
-#define S5P_KEYCON0_KEY_ENABLE (1 << 25)
-#define S5P_KEYCON0_DIRCON_MATCH_FG (0 << 24)
-#define S5P_KEYCON0_DIRCON_MATCH_BG (1 << 24)
-#define S5P_KEYCON0_COMPKEY(x) (((x) & 0xffffff) << 0)
-
-/* WxKEYCON1 (1~4) */
-#define S5P_KEYCON1_COLVAL(x) (((x) & 0xffffff) << 0)
-
-#endif // _ExynosGop_H__
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.c b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.c
deleted file mode 100755
index 2c6129ae6..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.c
+++ /dev/null
@@ -1,2011 +0,0 @@
-/** @file
- This is the main routine for initializing the Graphics Console support routines.
-
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
-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 "GraphicsConsole.h"
-
-//#define BIG_FONT
-
-#ifdef BIG_FONT
-
-#ifdef EFI_GLYPH_WIDTH
-
-#undef EFI_GLYPH_WIDTH
-#define EFI_GLYPH_WIDTH 12
-
-#endif // EFI_GLYPH_WIDTH
-
-#ifdef EFI_GLYPH_HEIGHT
-
-#undef EFI_GLYPH_HEIGHT
-#define EFI_GLYPH_HEIGHT 28
-
-#endif // EFI_GLYPH_HEIGHT
-
-#endif // BIG_FONT
-
-//
-// Graphics Console Device Private Data template
-//
-GRAPHICS_CONSOLE_DEV mGraphicsConsoleDevTemplate = {
- GRAPHICS_CONSOLE_DEV_SIGNATURE,
- (EFI_GRAPHICS_OUTPUT_PROTOCOL *) NULL,
- (EFI_UGA_DRAW_PROTOCOL *) NULL,
- {
- GraphicsConsoleConOutReset,
- GraphicsConsoleConOutOutputString,
- GraphicsConsoleConOutTestString,
- GraphicsConsoleConOutQueryMode,
- GraphicsConsoleConOutSetMode,
- GraphicsConsoleConOutSetAttribute,
- GraphicsConsoleConOutClearScreen,
- GraphicsConsoleConOutSetCursorPosition,
- GraphicsConsoleConOutEnableCursor,
- (EFI_SIMPLE_TEXT_OUTPUT_MODE *) NULL
- },
- {
- 0,
- 0,
- EFI_TEXT_ATTR(EFI_LIGHTGRAY, EFI_BLACK),
- 0,
- 0,
- TRUE
- },
- {
- { 80, 25, 0, 0, 0, 0 }, // Mode 0
- { 80, 50, 0, 0, 0, 0 }, // Mode 1
- { 100,31, 0, 0, 0, 0 }, // Mode 2
- { 0, 0, 0, 0, 0, 0 } // Mode 3
- },
- (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) NULL
-};
-
-EFI_HII_DATABASE_PROTOCOL *mHiiDatabase;
-EFI_HII_FONT_PROTOCOL *mHiiFont;
-EFI_HII_HANDLE mHiiHandle;
-EFI_EVENT mHiiRegistration;
-
-EFI_GUID mFontPackageListGuid = {0xf5f219d3, 0x7006, 0x4648, {0xac, 0x8d, 0xd6, 0x1d, 0xfb, 0x7b, 0xc6, 0xad}};
-
-CHAR16 mCrLfString[3] = { CHAR_CARRIAGE_RETURN, CHAR_LINEFEED, CHAR_NULL };
-
-EFI_GRAPHICS_OUTPUT_BLT_PIXEL mGraphicsEfiColors[16] = {
- //
- // B G R reserved
- //
- {0x00, 0x00, 0x00, 0x00}, // BLACK
- {0x98, 0x00, 0x00, 0x00}, // LIGHTBLUE
- {0x00, 0x98, 0x00, 0x00}, // LIGHGREEN
- {0x98, 0x98, 0x00, 0x00}, // LIGHCYAN
- {0x00, 0x00, 0x98, 0x00}, // LIGHRED
- {0x98, 0x00, 0x98, 0x00}, // MAGENTA
- {0x00, 0x98, 0x98, 0x00}, // BROWN
- {0x98, 0x98, 0x98, 0x00}, // LIGHTGRAY
- {0x30, 0x30, 0x30, 0x00}, // DARKGRAY - BRIGHT BLACK
- {0xff, 0x00, 0x00, 0x00}, // BLUE
- {0x00, 0xff, 0x00, 0x00}, // LIME
- {0xff, 0xff, 0x00, 0x00}, // CYAN
- {0x00, 0x00, 0xff, 0x00}, // RED
- {0xff, 0x00, 0xff, 0x00}, // FUCHSIA
- {0x00, 0xff, 0xff, 0x00}, // YELLOW
- {0xff, 0xff, 0xff, 0x00} // WHITE
-};
-
-EFI_NARROW_GLYPH mCursorGlyph = {
- 0x0000,
- 0x00,
- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF }
-};
-
-CHAR16 SpaceStr[] = { NARROW_CHAR, ' ', 0 };
-
-EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding = {
- GraphicsConsoleControllerDriverSupported,
- GraphicsConsoleControllerDriverStart,
- GraphicsConsoleControllerDriverStop,
- 0xa,
- NULL,
- NULL
-};
-
-/**
- Test to see if Graphics Console could be supported on the Controller.
-
- Graphics Console could be supported if Graphics Output Protocol or UGA Draw
- Protocol exists on the Controller. (UGA Draw Protocol could be skipped
- if PcdUgaConsumeSupport is set to FALSE.)
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to test.
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device.
- @retval other This driver does not support this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- EFI_STATUS Status;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
-
- GraphicsOutput = NULL;
- UgaDraw = NULL;
- //
- // Open the IO Abstraction(s) needed to perform the supported test
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiGraphicsOutputProtocolGuid,
- (VOID **) &GraphicsOutput,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- if (EFI_ERROR (Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Open Graphics Output Protocol failed, try to open UGA Draw Protocol
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- (VOID **) &UgaDraw,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- }
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
-#if 0
- //
- // We need to ensure that we do not layer on top of a virtual handle.
- // We need to ensure that the handles produced by the conspliter do not
- // get used.
- //
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- (VOID **) &DevicePath,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- if (!EFI_ERROR (Status)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiDevicePathProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- } else {
- goto Error;
- }
-#endif
-
- //
- // Does Hii Exist? If not, we aren't ready to run
- //
- Status = EfiLocateHiiProtocol ();
-
- //
- // Close the I/O Abstraction(s) used to perform the supported test
- //
-//Error:
- if (GraphicsOutput != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiGraphicsOutputProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
- return Status;
-}
-
-
-/**
- Start this driver on Controller by opening Graphics Output protocol or
- UGA Draw protocol, and installing Simple Text Out protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to bind driver to
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver is added to Controller.
- @retval other This driver does not support this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- )
-{
- EFI_STATUS Status;
- GRAPHICS_CONSOLE_DEV *Private;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- UINTN MaxMode;
- UINTN Columns;
- UINTN Rows;
- UINT32 ModeNumber;
- EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE *Mode;
- ModeNumber = 0;
-
- //
- // Initialize the Graphics Console device instance
- //
- Private = AllocateCopyPool (
- sizeof (GRAPHICS_CONSOLE_DEV),
- &mGraphicsConsoleDevTemplate
- );
- if (Private == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
- Private->SimpleTextOutput.Mode = &(Private->SimpleTextOutputMode);
-
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiGraphicsOutputProtocolGuid,
- (VOID **) &Private->GraphicsOutput,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
-
- Status = ExynosGopConstructor(Private);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- if (EFI_ERROR(Status) && FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- (VOID **) &Private->UgaDraw,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
- );
- }
-
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- //
- // If the current mode information can not be retrieved, then attempt to set the default mode
- // of 800x600, 32 bit color, 60 Hz refresh.
- //
- HorizontalResolution = 800;
- VerticalResolution = 600;
-
- if (Private->GraphicsOutput != NULL) {
- //
- // The console is build on top of Graphics Output Protocol, find the mode number
- // for the user-defined mode; if there are multiple video devices,
- // graphic console driver will set all the video devices to the same mode.
- //
- Status = CheckModeSupported (
- Private->GraphicsOutput,
- CURRENT_HORIZONTAL_RESOLUTION,
- CURRENT_VERTICAL_RESOLUTION,
- &ModeNumber
- );
- if (!EFI_ERROR(Status)) {
- //
- // Update default mode to current mode
- //
- HorizontalResolution = CURRENT_HORIZONTAL_RESOLUTION;
- VerticalResolution = CURRENT_VERTICAL_RESOLUTION;
- } else {
- //
- // if not supporting current mode, try 800x600 which is required by UEFI/EFI spec
- //
- Status = CheckModeSupported (
- Private->GraphicsOutput,
- 800,
- 600,
- &ModeNumber
- );
- }
-
- Mode = Private->GraphicsOutput->Mode;
-
- if (EFI_ERROR (Status) || (Mode->MaxMode != 0)) {
- //
- // Set default mode failed or device don't support default mode, then get the current mode information
- //
- HorizontalResolution = Mode->Info->HorizontalResolution;
- VerticalResolution = Mode->Info->VerticalResolution;
- ModeNumber = Mode->Mode;
- }
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // At first try to set user-defined resolution
- //
- ColorDepth = 32;
- RefreshRate = 60;
- Status = Private->UgaDraw->SetMode (
- Private->UgaDraw,
- CURRENT_HORIZONTAL_RESOLUTION,
- CURRENT_VERTICAL_RESOLUTION,
- ColorDepth,
- RefreshRate
- );
- if (!EFI_ERROR (Status)) {
- HorizontalResolution = CURRENT_HORIZONTAL_RESOLUTION;
- VerticalResolution = CURRENT_VERTICAL_RESOLUTION;
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Try to set 800*600 which is required by UEFI/EFI spec
- //
- Status = Private->UgaDraw->SetMode (
- Private->UgaDraw,
- HorizontalResolution,
- VerticalResolution,
- ColorDepth,
- RefreshRate
- );
- if (EFI_ERROR (Status)) {
- Status = Private->UgaDraw->GetMode (
- Private->UgaDraw,
- &HorizontalResolution,
- &VerticalResolution,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status)) {
- goto Error;
- }
- }
- } else {
- Status = EFI_UNSUPPORTED;
- goto Error;
- }
- }
-
- //
- // Compute the maximum number of text Rows and Columns that this current graphics mode can support
- //
- Columns = HorizontalResolution / EFI_GLYPH_WIDTH;
- Rows = VerticalResolution / EFI_GLYPH_HEIGHT;
-
- //
- // See if the mode is too small to support the required 80x25 text mode
- //
- if (Columns < 80 || Rows < 25) {
- goto Error;
- }
- //
- // Add Mode #0 that must be 80x25
- //
- MaxMode = 0;
- Private->ModeData[MaxMode].GopWidth = HorizontalResolution;
- Private->ModeData[MaxMode].GopHeight = VerticalResolution;
- Private->ModeData[MaxMode].GopModeNumber = ModeNumber;
- Private->ModeData[MaxMode].DeltaX = (HorizontalResolution - (80 * EFI_GLYPH_WIDTH)) >> 1;
- Private->ModeData[MaxMode].DeltaY = (VerticalResolution - (25 * EFI_GLYPH_HEIGHT)) >> 1;
- MaxMode++;
-
- //
- // If it is possible to support Mode #1 - 80x50, than add it as an active mode
- //
- if (Rows >= 50) {
- Private->ModeData[MaxMode].GopWidth = HorizontalResolution;
- Private->ModeData[MaxMode].GopHeight = VerticalResolution;
- Private->ModeData[MaxMode].GopModeNumber = ModeNumber;
- Private->ModeData[MaxMode].DeltaX = (HorizontalResolution - (80 * EFI_GLYPH_WIDTH)) >> 1;
- Private->ModeData[MaxMode].DeltaY = (VerticalResolution - (50 * EFI_GLYPH_HEIGHT)) >> 1;
- MaxMode++;
- }
-
- //
- // If it is not to support Mode #1 - 80x50, then skip it
- //
- if (MaxMode < 2) {
- Private->ModeData[MaxMode].Columns = 0;
- Private->ModeData[MaxMode].Rows = 0;
- Private->ModeData[MaxMode].GopWidth = HorizontalResolution;
- Private->ModeData[MaxMode].GopHeight = VerticalResolution;
- Private->ModeData[MaxMode].GopModeNumber = ModeNumber;
- Private->ModeData[MaxMode].DeltaX = 0;
- Private->ModeData[MaxMode].DeltaY = 0;
- MaxMode++;
- }
-
- //
- // Add Mode #2 that must be 100x31 (graphic mode >= 800x600)
- //
- if (Columns >= 100 && Rows >= 31) {
- Private->ModeData[MaxMode].GopWidth = HorizontalResolution;
- Private->ModeData[MaxMode].GopHeight = VerticalResolution;
- Private->ModeData[MaxMode].GopModeNumber = ModeNumber;
- Private->ModeData[MaxMode].DeltaX = (HorizontalResolution - (100 * EFI_GLYPH_WIDTH)) >> 1;
- Private->ModeData[MaxMode].DeltaY = (VerticalResolution - (31 * EFI_GLYPH_HEIGHT)) >> 1;
- MaxMode++;
- }
-
- //
- // Add Mode #3 that uses the entire display for user-defined mode
- //
- if (HorizontalResolution > 800 && VerticalResolution > 600) {
- Private->ModeData[MaxMode].Columns = HorizontalResolution/EFI_GLYPH_WIDTH;
- Private->ModeData[MaxMode].Rows = VerticalResolution/EFI_GLYPH_HEIGHT;
- Private->ModeData[MaxMode].GopWidth = HorizontalResolution;
- Private->ModeData[MaxMode].GopHeight = VerticalResolution;
- Private->ModeData[MaxMode].GopModeNumber = ModeNumber;
- Private->ModeData[MaxMode].DeltaX = (HorizontalResolution % EFI_GLYPH_WIDTH) >> 1;
- Private->ModeData[MaxMode].DeltaY = (VerticalResolution % EFI_GLYPH_HEIGHT) >> 1;
- MaxMode++;
- }
-
- //
- // Update the maximum number of modes
- //
- Private->SimpleTextOutputMode.MaxMode = (INT32) MaxMode;
-
- //
- // Determine the number of text modes that this protocol can support
- //
- Status = GraphicsConsoleConOutSetMode (&Private->SimpleTextOutput, 0);
- if (EFI_ERROR (Status)) {
- goto Error;
- }
-
- DEBUG_CODE_BEGIN ();
- GraphicsConsoleConOutOutputString (&Private->SimpleTextOutput, (CHAR16 *)L"Graphics Console Started\n\r");
- DEBUG_CODE_END ();
-
- //
- // Install protocol interfaces for the Graphics Console device.
- //
- Status = gBS->InstallMultipleProtocolInterfaces (
- &Controller,
- &gEfiSimpleTextOutProtocolGuid,
- &Private->SimpleTextOutput,
- NULL
- );
-
- if(!EFI_ERROR (Status)) {
- gST->ConOut = &Private->SimpleTextOutput;
- }
-
-Error:
- if (EFI_ERROR (Status)) {
- //
- // Close the GOP and UGA Draw Protocol
- //
- if (Private->GraphicsOutput != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiGraphicsOutputProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
-
- if (Private->LineBuffer != NULL) {
- FreePool (Private->LineBuffer);
- }
-
- //
- // Free private data
- //
- FreePool (Private);
- }
-
- return Status;
-}
-
-/**
- Stop this driver on Controller by removing Simple Text Out protocol
- and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to stop driver on
- @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS This driver is removed Controller.
- @retval EFI_NOT_STARTED Simple Text Out protocol could not be found the
- Controller.
- @retval other This driver was not removed from this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- )
-{
- EFI_STATUS Status;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *SimpleTextOutput;
- GRAPHICS_CONSOLE_DEV *Private=NULL;
-
- Status = gBS->OpenProtocol (
- Controller,
- &gEfiSimpleTextOutProtocolGuid,
- (VOID **) &SimpleTextOutput,
- This->DriverBindingHandle,
- Controller,
- EFI_OPEN_PROTOCOL_GET_PROTOCOL
- );
- if (EFI_ERROR (Status)) {
- return EFI_NOT_STARTED;
- }
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (SimpleTextOutput);
- Status = gBS->UninstallProtocolInterface (
- Controller,
- &gEfiSimpleTextOutProtocolGuid,
- &Private->SimpleTextOutput
- );
-
- if (!EFI_ERROR (Status)) {
- //
- // Close the GOP or UGA IO Protocol
- //
- Status = ExynosGopDestructor(Private);
- if (EFI_ERROR (Status)) {
- ASSERT(Status);
- }
- if (Private->GraphicsOutput != NULL) {
- gBS->CloseProtocol (
- Controller,
- &gEfiGraphicsOutputProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- gBS->CloseProtocol (
- Controller,
- &gEfiUgaDrawProtocolGuid,
- This->DriverBindingHandle,
- Controller
- );
- }
-
- if (Private->LineBuffer != NULL) {
- FreePool (Private->LineBuffer);
- }
- //
- // Free our instance data
- //
- FreePool (Private);
- }
-
- return Status;
-}
-
-/**
- Check if the current specific mode supported the user defined resolution
- for the Graphics Console device based on Graphics Output Protocol.
-
- If yes, set the graphic devcice's current mode to this specific mode.
-
- @param GraphicsOutput Graphics Output Protocol instance pointer.
- @param HorizontalResolution User defined horizontal resolution
- @param VerticalResolution User defined vertical resolution.
- @param CurrentModeNumber Current specific mode to be check.
-
- @retval EFI_SUCCESS The mode is supported.
- @retval EFI_UNSUPPORTED The specific mode is out of range of graphics
- device supported.
- @retval other The specific mode does not support user defined
- resolution or failed to set the current mode to the
- specific mode on graphics device.
-
-**/
-EFI_STATUS
-CheckModeSupported (
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- OUT UINT32 *CurrentModeNumber
- )
-{
- UINT32 ModeNumber;
- EFI_STATUS Status;
- UINTN SizeOfInfo;
- EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
- UINT32 MaxMode;
-
- Status = EFI_SUCCESS;
- MaxMode = GraphicsOutput->Mode->MaxMode;
-
- for (ModeNumber = 0; ModeNumber < MaxMode; ModeNumber++) {
- Status = GraphicsOutput->QueryMode (
- GraphicsOutput,
- ModeNumber,
- &SizeOfInfo,
- &Info
- );
- if (!EFI_ERROR (Status)) {
- if ((Info->HorizontalResolution == HorizontalResolution) &&
- (Info->VerticalResolution == VerticalResolution)) {
- if ((GraphicsOutput->Mode->Info->HorizontalResolution == HorizontalResolution) &&
- (GraphicsOutput->Mode->Info->VerticalResolution == VerticalResolution)) {
- //
- // If video device has been set to this mode, we do not need to SetMode again
- //
- break;
- } else {
- Status = GraphicsOutput->SetMode (GraphicsOutput, ModeNumber);
- if (!EFI_ERROR (Status)) {
- FreePool (Info);
- break;
- }
- }
- }
- FreePool (Info);
- }
- }
-
- if (ModeNumber == GraphicsOutput->Mode->MaxMode) {
- Status = EFI_UNSUPPORTED;
- }
-
- *CurrentModeNumber = ModeNumber;
- return Status;
-}
-
-
-/**
- Locate HII Database protocol and HII Font protocol.
-
- @retval EFI_SUCCESS HII Database protocol and HII Font protocol
- are located successfully.
- @return other Failed to locate HII Database protocol or
- HII Font protocol.
-
-**/
-EFI_STATUS
-EfiLocateHiiProtocol (
- VOID
- )
-{
- EFI_HANDLE Handle;
- UINTN Size;
- EFI_STATUS Status;
-
- //
- // There should only be one - so buffer size is this
- //
- Size = sizeof (EFI_HANDLE);
-
- Status = gBS->LocateHandle (
- ByProtocol,
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- &Size,
- (VOID **) &Handle
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiHiiDatabaseProtocolGuid,
- (VOID **) &mHiiDatabase
- );
-
- if (EFI_ERROR (Status)) {
- return Status;
- }
-
- Status = gBS->HandleProtocol (
- Handle,
- &gEfiHiiFontProtocolGuid,
- (VOID **) &mHiiFont
- );
- return Status;
-}
-
-//
-// Body of the STO functions
-//
-
-/**
- Reset the text output device hardware and optionally run diagnostics.
-
- Implements SIMPLE_TEXT_OUTPUT.Reset().
- If ExtendeVerification is TRUE, then perform dependent Graphics Console
- device reset, and set display mode to mode 0.
- If ExtendedVerification is FALSE, only set display mode to mode 0.
-
- @param This Protocol instance pointer.
- @param ExtendedVerification Indicates that the driver may perform a more
- exhaustive verification operation of the device
- during reset.
-
- @retval EFI_SUCCESS The text output device was reset.
- @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
- could not be reset.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutReset (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- This->SetAttribute (This, EFI_TEXT_ATTR (This->Mode->Attribute & 0x0F, EFI_BACKGROUND_BLACK));
- return This->SetMode (This, 0);
-}
-
-
-/**
- Write a Unicode string to the output device.
-
- Implements SIMPLE_TEXT_OUTPUT.OutputString().
- The Unicode string will be converted to Glyphs and will be
- sent to the Graphics Console.
-
- @param This Protocol instance pointer.
- @param WString The NULL-terminated Unicode string to be displayed
- on the output device(s). All output devices must
- also support the Unicode drawing defined in this file.
-
- @retval EFI_SUCCESS The string was output to the device.
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutOutputString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- GRAPHICS_CONSOLE_DEV *Private;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- INTN Mode;
- UINTN MaxColumn;
- UINTN MaxRow;
- UINTN Width;
- UINTN Height;
- UINTN Delta;
- EFI_STATUS Status;
- BOOLEAN Warning;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
- UINTN DeltaX;
- UINTN DeltaY;
- UINTN Count;
- UINTN Index;
- INT32 OriginAttribute;
- EFI_TPL OldTpl;
-
- Status = EFI_SUCCESS;
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
- //
- // Current mode
- //
- Mode = This->Mode->Mode;
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
-
- MaxColumn = Private->ModeData[Mode].Columns;
- MaxRow = Private->ModeData[Mode].Rows;
- DeltaX = (UINTN) Private->ModeData[Mode].DeltaX;
- DeltaY = (UINTN) Private->ModeData[Mode].DeltaY;
- Width = MaxColumn * EFI_GLYPH_WIDTH;
- Height = (MaxRow - 1) * EFI_GLYPH_HEIGHT;
- Delta = Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
-
- //
- // The Attributes won't change when during the time OutputString is called
- //
- GetTextColors (This, &Foreground, &Background);
-
- EraseCursor (This);
-
- Warning = FALSE;
-
- //
- // Backup attribute
- //
- OriginAttribute = This->Mode->Attribute;
-
- while (*WString != L'\0') {
-
- if (*WString == CHAR_BACKSPACE) {
- //
- // If the cursor is at the left edge of the display, then move the cursor
- // one row up.
- //
- if (This->Mode->CursorColumn == 0 && This->Mode->CursorRow > 0) {
- This->Mode->CursorRow--;
- This->Mode->CursorColumn = (INT32) (MaxColumn - 1);
- This->OutputString (This, SpaceStr);
- EraseCursor (This);
- This->Mode->CursorRow--;
- This->Mode->CursorColumn = (INT32) (MaxColumn - 1);
- } else if (This->Mode->CursorColumn > 0) {
- //
- // If the cursor is not at the left edge of the display, then move the cursor
- // left one column.
- //
- This->Mode->CursorColumn--;
- This->OutputString (This, SpaceStr);
- EraseCursor (This);
- This->Mode->CursorColumn--;
- }
-
- WString++;
-
- } else if (*WString == CHAR_LINEFEED) {
- //
- // If the cursor is at the bottom of the display, then scroll the display one
- // row, and do not update the cursor position. Otherwise, move the cursor
- // down one row.
- //
- if (This->Mode->CursorRow == (INT32) (MaxRow - 1)) {
- if (GraphicsOutput != NULL) {
- //
- // Scroll Screen Up One Row
- //
- GraphicsOutput->Blt (
- GraphicsOutput,
- NULL,
- EfiBltVideoToVideo,
- DeltaX,
- DeltaY + EFI_GLYPH_HEIGHT,
- DeltaX,
- DeltaY,
- Width,
- Height,
- Delta
- );
-
- //
- // Print Blank Line at last line
- //
- GraphicsOutput->Blt (
- GraphicsOutput,
- &Background,
- EfiBltVideoFill,
- 0,
- 0,
- DeltaX,
- DeltaY + Height,
- Width,
- EFI_GLYPH_HEIGHT,
- Delta
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Scroll Screen Up One Row
- //
- UgaDraw->Blt (
- UgaDraw,
- NULL,
- EfiUgaVideoToVideo,
- DeltaX,
- DeltaY + EFI_GLYPH_HEIGHT,
- DeltaX,
- DeltaY,
- Width,
- Height,
- Delta
- );
-
- //
- // Print Blank Line at last line
- //
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) (UINTN) &Background,
- EfiUgaVideoFill,
- 0,
- 0,
- DeltaX,
- DeltaY + Height,
- Width,
- EFI_GLYPH_HEIGHT,
- Delta
- );
- }
- } else {
- This->Mode->CursorRow++;
- }
-
- WString++;
-
- } else if (*WString == CHAR_CARRIAGE_RETURN) {
- //
- // Move the cursor to the beginning of the current row.
- //
- This->Mode->CursorColumn = 0;
- WString++;
-
- } else if (*WString == WIDE_CHAR) {
-
- This->Mode->Attribute |= EFI_WIDE_ATTRIBUTE;
- WString++;
-
- } else if (*WString == NARROW_CHAR) {
-
- This->Mode->Attribute &= (~ (UINT32) EFI_WIDE_ATTRIBUTE);
- WString++;
-
- } else {
- //
- // Print the character at the current cursor position and move the cursor
- // right one column. If this moves the cursor past the right edge of the
- // display, then the line should wrap to the beginning of the next line. This
- // is equivalent to inserting a CR and an LF. Note that if the cursor is at the
- // bottom of the display, and the line wraps, then the display will be scrolled
- // one line.
- // If wide char is going to be displayed, need to display one character at a time
- // Or, need to know the display length of a certain string.
- //
- // Index is used to determine how many character width units (wide = 2, narrow = 1)
- // Count is used to determine how many characters are used regardless of their attributes
- //
- for (Count = 0, Index = 0; (This->Mode->CursorColumn + Index) < MaxColumn; Count++, Index++) {
- if (WString[Count] == CHAR_NULL ||
- WString[Count] == CHAR_BACKSPACE ||
- WString[Count] == CHAR_LINEFEED ||
- WString[Count] == CHAR_CARRIAGE_RETURN ||
- WString[Count] == WIDE_CHAR ||
- WString[Count] == NARROW_CHAR) {
- break;
- }
- //
- // Is the wide attribute on?
- //
- if ((This->Mode->Attribute & EFI_WIDE_ATTRIBUTE) != 0) {
- //
- // If wide, add one more width unit than normal since we are going to increment at the end of the for loop
- //
- Index++;
- //
- // This is the end-case where if we are at column 79 and about to print a wide character
- // We should prevent this from happening because we will wrap inappropriately. We should
- // not print this character until the next line.
- //
- if ((This->Mode->CursorColumn + Index + 1) > MaxColumn) {
- Index++;
- break;
- }
- }
- }
-
- Status = DrawUnicodeWeightAtCursorN (This, WString, Count);
- if (EFI_ERROR (Status)) {
- Warning = TRUE;
- }
- //
- // At the end of line, output carriage return and line feed
- //
- WString += Count;
- This->Mode->CursorColumn += (INT32) Index;
- if (This->Mode->CursorColumn > (INT32) MaxColumn) {
- This->Mode->CursorColumn -= 2;
- This->OutputString (This, SpaceStr);
- }
-
- if (This->Mode->CursorColumn >= (INT32) MaxColumn) {
- EraseCursor (This);
- This->OutputString (This, mCrLfString);
- EraseCursor (This);
- }
- }
- }
-
- This->Mode->Attribute = OriginAttribute;
-
- EraseCursor (This);
-
- if (Warning) {
- Status = EFI_WARN_UNKNOWN_GLYPH;
- }
-
- gBS->RestoreTPL (OldTpl);
- return Status;
-
-}
-
-/**
- Verifies that all characters in a Unicode string can be output to the
- target device.
-
- Implements SIMPLE_TEXT_OUTPUT.TestString().
- If one of the characters in the *Wstring is neither valid valid Unicode
- drawing characters, not ASCII code, then this function will return
- EFI_UNSUPPORTED
-
- @param This Protocol instance pointer.
- @param WString The NULL-terminated Unicode string to be examined for the output
- device(s).
-
- @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
- @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be
- rendered by one or more of the output devices mapped
- by the EFI handle.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutTestString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- )
-{
- EFI_STATUS Status;
- UINT16 Count;
-
- EFI_IMAGE_OUTPUT *Blt;
-
- Blt = NULL;
- Count = 0;
-
- while (WString[Count] != 0) {
- Status = mHiiFont->GetGlyph (
- mHiiFont,
- WString[Count],
- NULL,
- &Blt,
- NULL
- );
- if (Blt != NULL) {
- FreePool (Blt);
- Blt = NULL;
- }
- Count++;
-
- if (EFI_ERROR (Status)) {
- return EFI_UNSUPPORTED;
- }
- }
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Returns information for an available text mode that the output device(s)
- supports
-
- Implements SIMPLE_TEXT_OUTPUT.QueryMode().
- It returnes information for an available text mode that the Graphics Console supports.
- In this driver,we only support text mode 80x25, which is defined as mode 0.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to return information on.
- @param Columns The returned columns of the requested mode.
- @param Rows The returned rows of the requested mode.
-
- @retval EFI_SUCCESS The requested mode information is returned.
- @retval EFI_UNSUPPORTED The mode number is not valid.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutQueryMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber,
- OUT UINTN *Columns,
- OUT UINTN *Rows
- )
-{
- GRAPHICS_CONSOLE_DEV *Private;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
-
- if (ModeNumber >= (UINTN) This->Mode->MaxMode) {
- return EFI_UNSUPPORTED;
- }
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
- Status = EFI_SUCCESS;
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
-
- *Columns = Private->ModeData[ModeNumber].Columns;
- *Rows = Private->ModeData[ModeNumber].Rows;
-
- if (*Columns <= 0 && *Rows <= 0) {
- Status = EFI_UNSUPPORTED;
- goto Done;
-
- }
-
-Done:
- gBS->RestoreTPL (OldTpl);
- return Status;
-}
-
-
-/**
- Sets the output device(s) to a specified mode.
-
- Implements SIMPLE_TEXT_OUTPUT.SetMode().
- Set the Graphics Console to a specified mode. In this driver, we only support mode 0.
-
- @param This Protocol instance pointer.
- @param ModeNumber The text mode to set.
-
- @retval EFI_SUCCESS The requested text mode is set.
- @retval EFI_DEVICE_ERROR The requested text mode cannot be set because of
- Graphics Console device error.
- @retval EFI_UNSUPPORTED The text mode number is not valid.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber
- )
-{
- EFI_STATUS Status;
- GRAPHICS_CONSOLE_DEV *Private;
- GRAPHICS_CONSOLE_MODE_DATA *ModeData;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *NewLineBuffer;
- UINT32 HorizontalResolution;
- UINT32 VerticalResolution;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- UINT32 ColorDepth;
- UINT32 RefreshRate;
- EFI_TPL OldTpl;
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
- ModeData = &(Private->ModeData[ModeNumber]);
-
- //
- // Make sure the requested mode number is supported
- //
- if (ModeNumber >= (UINTN) This->Mode->MaxMode) {
- Status = EFI_UNSUPPORTED;
- goto Done;
- }
-
- if (ModeData->Columns <= 0 && ModeData->Rows <= 0) {
- Status = EFI_UNSUPPORTED;
- goto Done;
- }
- //
- // Attempt to allocate a line buffer for the requested mode number
- //
- NewLineBuffer = AllocatePool (sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL) * ModeData->Columns * EFI_GLYPH_WIDTH * EFI_GLYPH_HEIGHT);
-
- if (NewLineBuffer == NULL) {
- //
- // The new line buffer could not be allocated, so return an error.
- // No changes to the state of the current console have been made, so the current console is still valid
- //
- Status = EFI_OUT_OF_RESOURCES;
- goto Done;
- }
- //
- // If the mode has been set at least one other time, then LineBuffer will not be NULL
- //
- if (Private->LineBuffer != NULL) {
- //
- // Clear the current text window on the current graphics console
- //
- This->ClearScreen (This);
-
- //
- // If the new mode is the same as the old mode, then just return EFI_SUCCESS
- //
- if ((INT32) ModeNumber == This->Mode->Mode) {
- FreePool (NewLineBuffer);
- Status = EFI_SUCCESS;
- goto Done;
- }
- //
- // Otherwise, the size of the text console and/or the GOP/UGA mode will be changed,
- // so erase the cursor, and free the LineBuffer for the current mode
- //
- EraseCursor (This);
-
- FreePool (Private->LineBuffer);
- }
- //
- // Assign the current line buffer to the newly allocated line buffer
- //
- Private->LineBuffer = NewLineBuffer;
-
- if (GraphicsOutput != NULL) {
- if (ModeData->GopModeNumber != GraphicsOutput->Mode->Mode) {
- //
- // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode
- //
- Status = GraphicsOutput->SetMode (GraphicsOutput, ModeData->GopModeNumber);
- if (EFI_ERROR (Status)) {
- //
- // The mode set operation failed
- //
- goto Done;
- }
- } else {
- //
- // The current graphics mode is correct, so simply clear the entire display
- //
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- &mGraphicsEfiColors[0],
- EfiBltVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
- }
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // Get the current UGA Draw mode information
- //
- Status = UgaDraw->GetMode (
- UgaDraw,
- &HorizontalResolution,
- &VerticalResolution,
- &ColorDepth,
- &RefreshRate
- );
- if (EFI_ERROR (Status) || HorizontalResolution != ModeData->GopWidth || VerticalResolution != ModeData->GopHeight) {
- //
- // Either no graphics mode is currently set, or it is set to the wrong resolution, so set the new graphics mode
- //
- Status = UgaDraw->SetMode (
- UgaDraw,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 32,
- 60
- );
- if (EFI_ERROR (Status)) {
- //
- // The mode set operation failed
- //
- goto Done;
- }
- } else {
- //
- // The current graphics mode is correct, so simply clear the entire display
- //
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) (UINTN) &mGraphicsEfiColors[0],
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
- }
- }
-
- //
- // The new mode is valid, so commit the mode change
- //
- This->Mode->Mode = (INT32) ModeNumber;
-
- //
- // Move the text cursor to the upper left hand corner of the display and enable it
- //
- This->SetCursorPosition (This, 0, 0);
-
- Status = EFI_SUCCESS;
-
-Done:
- gBS->RestoreTPL (OldTpl);
- return Status;
-}
-
-
-/**
- Sets the background and foreground colors for the OutputString () and
- ClearScreen () functions.
-
- Implements SIMPLE_TEXT_OUTPUT.SetAttribute().
-
- @param This Protocol instance pointer.
- @param Attribute The attribute to set. Bits 0..3 are the foreground
- color, and bits 4..6 are the background color.
- All other bits are undefined and must be zero.
-
- @retval EFI_SUCCESS The requested attribute is set.
- @retval EFI_DEVICE_ERROR The requested attribute cannot be set due to Graphics Console port error.
- @retval EFI_UNSUPPORTED The attribute requested is not defined.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetAttribute (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Attribute
- )
-{
- EFI_TPL OldTpl;
-
- if ((Attribute | 0xFF) != 0xFF) {
- return EFI_UNSUPPORTED;
- }
-
- if ((INT32) Attribute == This->Mode->Attribute) {
- return EFI_SUCCESS;
- }
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- EraseCursor (This);
-
- This->Mode->Attribute = (INT32) Attribute;
-
- EraseCursor (This);
-
- gBS->RestoreTPL (OldTpl);
-
- return EFI_SUCCESS;
-}
-
-
-/**
- Clears the output device(s) display to the currently selected background
- color.
-
- Implements SIMPLE_TEXT_OUTPUT.ClearScreen().
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutClearScreen (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- )
-{
- EFI_STATUS Status;
- GRAPHICS_CONSOLE_DEV *Private;
- GRAPHICS_CONSOLE_MODE_DATA *ModeData;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Foreground;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background;
- EFI_TPL OldTpl;
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
- ModeData = &(Private->ModeData[This->Mode->Mode]);
-
- GetTextColors (This, &Foreground, &Background);
- if (GraphicsOutput != NULL) {
- Status = GraphicsOutput->Blt (
- GraphicsOutput,
- &Background,
- EfiBltVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) (UINTN) &Background,
- EfiUgaVideoFill,
- 0,
- 0,
- 0,
- 0,
- ModeData->GopWidth,
- ModeData->GopHeight,
- 0
- );
- } else {
- Status = EFI_UNSUPPORTED;
- }
-
- This->Mode->CursorColumn = 0;
- This->Mode->CursorRow = 0;
-
- EraseCursor (This);
-
- gBS->RestoreTPL (OldTpl);
-
- return Status;
-}
-
-
-/**
- Sets the current coordinates of the cursor position.
-
- Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().
-
- @param This Protocol instance pointer.
- @param Column The position to set the cursor to. Must be greater than or
- equal to zero and less than the number of columns and rows
- by QueryMode ().
- @param Row The position to set the cursor to. Must be greater than or
- equal to zero and less than the number of columns and rows
- by QueryMode ().
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
- cursor position is invalid for the current mode.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetCursorPosition (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Column,
- IN UINTN Row
- )
-{
- GRAPHICS_CONSOLE_DEV *Private;
- GRAPHICS_CONSOLE_MODE_DATA *ModeData;
- EFI_STATUS Status;
- EFI_TPL OldTpl;
-
- Status = EFI_SUCCESS;
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- ModeData = &(Private->ModeData[This->Mode->Mode]);
-
- if ((Column >= ModeData->Columns) || (Row >= ModeData->Rows)) {
- Status = EFI_UNSUPPORTED;
- goto Done;
- }
-
- if ((This->Mode->CursorColumn == (INT32) Column) && (This->Mode->CursorRow == (INT32) Row)) {
- Status = EFI_SUCCESS;
- goto Done;
- }
-
- EraseCursor (This);
-
- This->Mode->CursorColumn = (INT32) Column;
- This->Mode->CursorRow = (INT32) Row;
-
- EraseCursor (This);
-
-Done:
- gBS->RestoreTPL (OldTpl);
-
- return Status;
-}
-
-
-/**
- Makes the cursor visible or invisible.
-
- Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
-
- @param This Protocol instance pointer.
- @param Visible If TRUE, the cursor is set to be visible, If FALSE,
- the cursor is set to be invisible.
-
- @retval EFI_SUCCESS The operation completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutEnableCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN Visible
- )
-{
- EFI_TPL OldTpl;
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- EraseCursor (This);
-
- This->Mode->CursorVisible = Visible;
-
- EraseCursor (This);
-
- gBS->RestoreTPL (OldTpl);
- return EFI_SUCCESS;
-}
-
-/**
- Gets Graphics Console devcie's foreground color and background color.
-
- @param This Protocol instance pointer.
- @param Foreground Returned text foreground color.
- @param Background Returned text background color.
-
- @retval EFI_SUCCESS It returned always.
-
-**/
-EFI_STATUS
-GetTextColors (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background
- )
-{
- INTN Attribute;
-
- Attribute = This->Mode->Attribute & 0x7F;
-
- *Foreground = mGraphicsEfiColors[Attribute & 0x0f];
- *Background = mGraphicsEfiColors[Attribute >> 4];
-
- return EFI_SUCCESS;
-}
-
-/**
- Draw Unicode string on the Graphics Console device's screen.
-
- @param This Protocol instance pointer.
- @param UnicodeWeight One Unicode string to be displayed.
- @param Count The count of Unicode string.
-
- @retval EFI_OUT_OF_RESOURCES If no memory resource to use.
- @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
- protocol exist.
- @retval EFI_SUCCESS Drawing Unicode string implemented successfully.
-
-**/
-EFI_STATUS
-DrawUnicodeWeightAtCursorN (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *UnicodeWeight,
- IN UINTN Count
- )
-{
- EFI_STATUS Status;
- GRAPHICS_CONSOLE_DEV *Private;
- EFI_IMAGE_OUTPUT *Blt;
- EFI_STRING String;
- EFI_FONT_DISPLAY_INFO *FontInfo;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_HII_ROW_INFO *RowInfoArray;
- UINTN RowInfoArraySize;
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- Blt = (EFI_IMAGE_OUTPUT *) AllocateZeroPool (sizeof (EFI_IMAGE_OUTPUT));
- if (Blt == NULL) {
- return EFI_OUT_OF_RESOURCES;
- }
-
- Blt->Width = (UINT16) (Private->ModeData[This->Mode->Mode].GopWidth);
- Blt->Height = (UINT16) (Private->ModeData[This->Mode->Mode].GopHeight);
-
- String = AllocateCopyPool ((Count + 1) * sizeof (CHAR16), UnicodeWeight);
- if (String == NULL) {
- FreePool (Blt);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Set the end character
- //
- *(String + Count) = L'\0';
-
- FontInfo = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (sizeof (EFI_FONT_DISPLAY_INFO));
- if (FontInfo == NULL) {
- FreePool (Blt);
- FreePool (String);
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // Get current foreground and background colors.
- //
- GetTextColors (This, &FontInfo->ForegroundColor, &FontInfo->BackgroundColor);
-
- if (Private->GraphicsOutput != NULL) {
- //
- // If Graphics Output protocol exists, using HII Font protocol to draw.
- //
- Blt->Image.Screen = Private->GraphicsOutput;
-
- Status = mHiiFont->StringToImage (
- mHiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_DIRECT_TO_SCREEN | EFI_HII_IGNORE_LINE_BREAK,
- String,
- FontInfo,
- &Blt,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- This->Mode->CursorRow * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- NULL,
- NULL,
- NULL
- );
-
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- //
- // If Graphics Output protocol cannot be found and PcdUgaConsumeSupport enabled,
- // using UGA Draw protocol to draw.
- //
- ASSERT (Private->UgaDraw!= NULL);
-
- UgaDraw = Private->UgaDraw;
-
- Blt->Image.Bitmap = AllocateZeroPool (Blt->Width * Blt->Height * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
- if (Blt->Image.Bitmap == NULL) {
- FreePool (Blt);
- FreePool (String);
- return EFI_OUT_OF_RESOURCES;
- }
-
- RowInfoArray = NULL;
- //
- // StringToImage only support blt'ing image to device using GOP protocol. If GOP is not supported in this platform,
- // we ask StringToImage to print the string to blt buffer, then blt to device using UgaDraw.
- //
- Status = mHiiFont->StringToImage (
- mHiiFont,
- EFI_HII_IGNORE_IF_NO_GLYPH | EFI_HII_IGNORE_LINE_BREAK,
- String,
- FontInfo,
- &Blt,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- This->Mode->CursorRow * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- &RowInfoArray,
- &RowInfoArraySize,
- NULL
- );
-
- if (!EFI_ERROR (Status)) {
- //
- // Line breaks are handled by caller of DrawUnicodeWeightAtCursorN, so the updated parameter RowInfoArraySize by StringToImage will
- // always be 1 or 0 (if there is no valid Unicode Char can be printed). ASSERT here to make sure.
- //
- ASSERT (RowInfoArraySize <= 1);
-
- Status = UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) Blt->Image.Bitmap,
- EfiUgaBltBufferToVideo,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- This->Mode->CursorColumn * EFI_GLYPH_WIDTH + Private->ModeData[This->Mode->Mode].DeltaX,
- (This->Mode->CursorRow) * EFI_GLYPH_HEIGHT + Private->ModeData[This->Mode->Mode].DeltaY,
- RowInfoArray[0].LineWidth,
- RowInfoArray[0].LineHeight,
- Blt->Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- }
-
- FreePool (RowInfoArray);
- FreePool (Blt->Image.Bitmap);
- } else {
- Status = EFI_UNSUPPORTED;
- }
-
- if (Blt != NULL) {
- FreePool (Blt);
- }
- if (String != NULL) {
- FreePool (String);
- }
- if (FontInfo != NULL) {
- FreePool (FontInfo);
- }
- return Status;
-}
-
-/**
- Erase the cursor on the screen.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS The cursor is erased successfully.
-
-**/
-EFI_STATUS
-EraseCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- )
-{
- GRAPHICS_CONSOLE_DEV *Private;
- EFI_SIMPLE_TEXT_OUTPUT_MODE *CurrentMode;
- INTN GlyphX;
- INTN GlyphY;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Foreground;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Background;
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION BltChar[EFI_GLYPH_HEIGHT][EFI_GLYPH_WIDTH];
- UINTN PosX;
- UINTN PosY;
-
- CurrentMode = This->Mode;
-
- if (!CurrentMode->CursorVisible) {
- return EFI_SUCCESS;
- }
-
- Private = GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS (This);
- GraphicsOutput = Private->GraphicsOutput;
- UgaDraw = Private->UgaDraw;
-
- //
- // In this driver, only narrow character was supported.
- //
- //
- // Blt a character to the screen
- //
- GlyphX = (CurrentMode->CursorColumn * EFI_GLYPH_WIDTH) + Private->ModeData[CurrentMode->Mode].DeltaX;
- GlyphY = (CurrentMode->CursorRow * EFI_GLYPH_HEIGHT) + Private->ModeData[CurrentMode->Mode].DeltaY;
- if (GraphicsOutput != NULL) {
- GraphicsOutput->Blt (
- GraphicsOutput,
- (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) BltChar,
- EfiBltVideoToBltBuffer,
- GlyphX,
- GlyphY,
- 0,
- 0,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) (UINTN) BltChar,
- EfiUgaVideoToBltBuffer,
- GlyphX,
- GlyphY,
- 0,
- 0,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
- );
- }
-
- GetTextColors (This, &Foreground.Pixel, &Background.Pixel);
-
- //
- // Convert Monochrome bitmap of the Glyph to BltBuffer structure
- //
- for (PosY = 0; PosY < EFI_GLYPH_HEIGHT; PosY++) {
- for (PosX = 0; PosX < EFI_GLYPH_WIDTH; PosX++) {
- if ((mCursorGlyph.GlyphCol1[PosY] & (BIT0 << PosX)) != 0) {
- BltChar[PosY][EFI_GLYPH_WIDTH - PosX - 1].Raw ^= Foreground.Raw;
- }
- }
- }
-
- if (GraphicsOutput != NULL) {
- GraphicsOutput->Blt (
- GraphicsOutput,
- (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) BltChar,
- EfiBltBufferToVideo,
- 0,
- 0,
- GlyphX,
- GlyphY,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)
- );
- } else if (FeaturePcdGet (PcdUgaConsumeSupport)) {
- UgaDraw->Blt (
- UgaDraw,
- (EFI_UGA_PIXEL *) (UINTN) BltChar,
- EfiUgaBltBufferToVideo,
- 0,
- 0,
- GlyphX,
- GlyphY,
- EFI_GLYPH_WIDTH,
- EFI_GLYPH_HEIGHT,
- EFI_GLYPH_WIDTH * sizeof (EFI_UGA_PIXEL)
- );
- }
-
- return EFI_SUCCESS;
-}
-
-/**
- HII Database Protocol notification event handler.
-
- Register font package when HII Database Protocol has been installed.
-
- @param[in] Event Event whose notification function is being invoked.
- @param[in] Context Pointer to the notification function's context.
-**/
-VOID
-EFIAPI
-RegisterFontPackage (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- EFI_STATUS Status;
- EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimplifiedFont;
- UINT32 PackageLength;
- UINT8 *Package;
- UINT8 *Location;
- EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
-
- //
- // Locate HII Database Protocol
- //
- Status = gBS->LocateProtocol (
- &gEfiHiiDatabaseProtocolGuid,
- NULL,
- (VOID **) &HiiDatabase
- );
- ASSERT_EFI_ERROR (Status);
-
- //
- // Add 4 bytes to the header for entire length for HiiAddPackages use only.
- //
- // +--------------------------------+ <-- Package
- // | |
- // | PackageLength(4 bytes) |
- // | |
- // |--------------------------------| <-- SimplifiedFont
- // | |
- // |EFI_HII_SIMPLE_FONT_PACKAGE_HDR |
- // | |
- // |--------------------------------| <-- Location
- // | |
- // | gUsStdNarrowGlyphData |
- // | |
- // +--------------------------------+
-
- PackageLength = sizeof (EFI_HII_SIMPLE_FONT_PACKAGE_HDR) + mNarrowFontSize + 4;
- Package = AllocateZeroPool (PackageLength);
- ASSERT (Package != NULL);
-
- WriteUnaligned32((UINT32 *) Package,PackageLength);
- SimplifiedFont = (EFI_HII_SIMPLE_FONT_PACKAGE_HDR *) (Package + 4);
- SimplifiedFont->Header.Length = (UINT32) (PackageLength - 4);
- SimplifiedFont->Header.Type = EFI_HII_PACKAGE_SIMPLE_FONTS;
- SimplifiedFont->NumberOfNarrowGlyphs = (UINT16) (mNarrowFontSize / sizeof (EFI_NARROW_GLYPH));
-
- Location = (UINT8 *) (&SimplifiedFont->NumberOfWideGlyphs + 1);
- CopyMem (Location, gUsStdNarrowGlyphData, mNarrowFontSize);
-
- //
- // Add this simplified font package to a package list then install it.
- //
- mHiiHandle = HiiAddPackages (
- &mFontPackageListGuid,
- NULL,
- Package,
- NULL
- );
- ASSERT (mHiiHandle != NULL);
- FreePool (Package);
-}
-
-
-/**
- The user Entry Point for module GraphicsConsole. The user code starts with this function.
-
- @param[in] ImageHandle The firmware allocated handle for the EFI image.
- @param[in] SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The entry point is executed successfully.
- @return other Some error occurs when executing this entry point.
-
-**/
-EFI_STATUS
-EFIAPI
-InitializeGraphicsConsole (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- Status = gBS->InstallMultipleProtocolInterfaces(
- &ImageHandle,
- &gEfiGraphicsOutputProtocolGuid,&gDisplay,
- NULL
- );
- ASSERT_EFI_ERROR(Status);
-
- //
- // Register notify function on HII Database Protocol to add font package.
- //
- EfiCreateProtocolNotifyEvent (
- &gEfiHiiDatabaseProtocolGuid,
- TPL_CALLBACK,
- RegisterFontPackage,
- NULL,
- &mHiiRegistration
- );
-
- //
- // Install driver model protocol(s).
- //
- Status = EfiLibInstallDriverBindingComponentName2 (
- ImageHandle,
- SystemTable,
- &gGraphicsConsoleDriverBinding,
- ImageHandle,
- &gGraphicsConsoleComponentName,
- &gGraphicsConsoleComponentName2
- );
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.h b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.h
deleted file mode 100755
index 6e2c7955d..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsole.h
+++ /dev/null
@@ -1,615 +0,0 @@
-/** @file
- Header file for GraphicsConsole driver.
-
-Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
-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 _GRAPHICS_CONSOLE_H_
-#define _GRAPHICS_CONSOLE_H_
-
-#include <Uefi.h>
-#include <Protocol/SimpleTextOut.h>
-#include <Protocol/GraphicsOutput.h>
-#include <Protocol/UgaDraw.h>
-#include <Protocol/DevicePath.h>
-#include <Library/DebugLib.h>
-#include <Library/UefiDriverEntryPoint.h>
-#include <Library/UefiLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/HiiLib.h>
-#include <Library/BaseLib.h>
-#include <Library/PcdLib.h>
-
-#include <Guid/MdeModuleHii.h>
-
-#include <Protocol/HiiFont.h>
-#include <Protocol/HiiDatabase.h>
-
-
-extern EFI_COMPONENT_NAME_PROTOCOL gGraphicsConsoleComponentName;
-extern EFI_COMPONENT_NAME2_PROTOCOL gGraphicsConsoleComponentName2;
-extern EFI_DRIVER_BINDING_PROTOCOL gGraphicsConsoleDriverBinding;
-extern EFI_NARROW_GLYPH gUsStdNarrowGlyphData[];
-extern EFI_GRAPHICS_OUTPUT_PROTOCOL gDisplay;
-extern UINT32 mNarrowFontSize;
-//
-// User can define valid graphic resolution here
-// e.g. 640x480, 800x600, 1024x768...
-//
-#define CURRENT_HORIZONTAL_RESOLUTION 1366
-#define CURRENT_VERTICAL_RESOLUTION 768
-
-typedef union {
- EFI_NARROW_GLYPH NarrowGlyph;
- EFI_WIDE_GLYPH WideGlyph;
-} GLYPH_UNION;
-
-//
-// Device Structure
-//
-#define GRAPHICS_CONSOLE_DEV_SIGNATURE SIGNATURE_32 ('g', 's', 't', 'o')
-
-
-typedef struct {
- UINTN Columns;
- UINTN Rows;
- INTN DeltaX;
- INTN DeltaY;
- UINT32 GopWidth;
- UINT32 GopHeight;
- UINT32 GopModeNumber;
-} GRAPHICS_CONSOLE_MODE_DATA;
-
-
-#define GRAPHICS_MAX_MODE 4
-
-typedef struct {
- UINTN Signature;
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput;
- EFI_UGA_DRAW_PROTOCOL *UgaDraw;
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SimpleTextOutput;
- EFI_SIMPLE_TEXT_OUTPUT_MODE SimpleTextOutputMode;
- GRAPHICS_CONSOLE_MODE_DATA ModeData[GRAPHICS_MAX_MODE];
- EFI_GRAPHICS_OUTPUT_BLT_PIXEL *LineBuffer;
-} GRAPHICS_CONSOLE_DEV;
-
-
-#define GRAPHICS_CONSOLE_CON_OUT_DEV_FROM_THIS(a) \
- CR (a, GRAPHICS_CONSOLE_DEV, SimpleTextOutput, GRAPHICS_CONSOLE_DEV_SIGNATURE)
-
-
-//
-// EFI Component Name Functions
-//
-/**
- Retrieves a Unicode string that is the user readable name of the driver.
-
- This function retrieves the user readable name of a driver in the form of a
- Unicode string. If the driver specified by This has a user readable name in
- the language specified by Language, then a pointer to the driver name is
- returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
- by This does not support the language specified by Language,
- then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified
- in RFC 4646 or ISO 639-2 language code format.
-
- @param DriverName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- driver specified by This in the language
- specified by Language.
-
- @retval EFI_SUCCESS The Unicode string for the Driver specified by
- This and the language specified by Language was
- returned in DriverName.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER DriverName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleComponentNameGetDriverName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN CHAR8 *Language,
- OUT CHAR16 **DriverName
- );
-
-
-/**
- Retrieves a Unicode string that is the user readable name of the controller
- that is being managed by a driver.
-
- This function retrieves the user readable name of the controller specified by
- ControllerHandle and ChildHandle in the form of a Unicode string. If the
- driver specified by This has a user readable name in the language specified by
- Language, then a pointer to the controller name is returned in ControllerName,
- and EFI_SUCCESS is returned. If the driver specified by This is not currently
- managing the controller specified by ControllerHandle and ChildHandle,
- then EFI_UNSUPPORTED is returned. If the driver specified by This does not
- support the language specified by Language, then EFI_UNSUPPORTED is returned.
-
- @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
- EFI_COMPONENT_NAME_PROTOCOL instance.
-
- @param ControllerHandle[in] The handle of a controller that the driver
- specified by This is managing. This handle
- specifies the controller whose name is to be
- returned.
-
- @param ChildHandle[in] The handle of the child controller to retrieve
- the name of. This is an optional parameter that
- may be NULL. It will be NULL for device
- drivers. It will also be NULL for a bus drivers
- that wish to retrieve the name of the bus
- controller. It will not be NULL for a bus
- driver that wishes to retrieve the name of a
- child controller.
-
- @param Language[in] A pointer to a Null-terminated ASCII string
- array indicating the language. This is the
- language of the driver name that the caller is
- requesting, and it must match one of the
- languages specified in SupportedLanguages. The
- number of languages supported by a driver is up
- to the driver writer. Language is specified in
- RFC 4646 or ISO 639-2 language code format.
-
- @param ControllerName[out] A pointer to the Unicode string to return.
- This Unicode string is the name of the
- controller specified by ControllerHandle and
- ChildHandle in the language specified by
- Language from the point of view of the driver
- specified by This.
-
- @retval EFI_SUCCESS The Unicode string for the user readable name in
- the language specified by Language for the
- driver specified by This was returned in
- DriverName.
-
- @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
- EFI_HANDLE.
-
- @retval EFI_INVALID_PARAMETER Language is NULL.
-
- @retval EFI_INVALID_PARAMETER ControllerName is NULL.
-
- @retval EFI_UNSUPPORTED The driver specified by This is not currently
- managing the controller specified by
- ControllerHandle and ChildHandle.
-
- @retval EFI_UNSUPPORTED The driver specified by This does not support
- the language specified by Language.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleComponentNameGetControllerName (
- IN EFI_COMPONENT_NAME_PROTOCOL *This,
- IN EFI_HANDLE ControllerHandle,
- IN EFI_HANDLE ChildHandle OPTIONAL,
- IN CHAR8 *Language,
- OUT CHAR16 **ControllerName
- );
-
-
-/**
- Reset the text output device hardware and optionally run diagnostics.
-
- Implements SIMPLE_TEXT_OUTPUT.Reset().
- If ExtendeVerification is TRUE, then perform dependent Graphics Console
- device reset, and set display mode to mode 0.
- If ExtendedVerification is FALSE, only set display mode to mode 0.
-
- @param This Protocol instance pointer.
- @param ExtendedVerification Indicates that the driver may perform a more
- exhaustive verification operation of the device
- during reset.
-
- @retval EFI_SUCCESS The text output device was reset.
- @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and
- could not be reset.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutReset (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- );
-
-/**
- Write a Unicode string to the output device.
-
- Implements SIMPLE_TEXT_OUTPUT.OutputString().
- The Unicode string will be converted to Glyphs and will be
- sent to the Graphics Console.
-
- @param This Protocol instance pointer.
- @param WString The NULL-terminated Unicode string to be displayed
- on the output device(s). All output devices must
- also support the Unicode drawing defined in this file.
-
- @retval EFI_SUCCESS The string was output to the device.
- @retval EFI_DEVICE_ERROR The device reported an error while attempting to output
- the text.
- @retval EFI_UNSUPPORTED The output device's mode is not currently in a
- defined text mode.
- @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the
- characters in the Unicode string could not be
- rendered and were skipped.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutOutputString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- );
-
-/**
- Verifies that all characters in a Unicode string can be output to the
- target device.
-
- Implements SIMPLE_TEXT_OUTPUT.TestString().
- If one of the characters in the *Wstring is neither valid valid Unicode
- drawing characters, not ASCII code, then this function will return
- EFI_UNSUPPORTED
-
- @param This Protocol instance pointer.
- @param WString The NULL-terminated Unicode string to be examined for the output
- device(s).
-
- @retval EFI_SUCCESS The device(s) are capable of rendering the output string.
- @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be
- rendered by one or more of the output devices mapped
- by the EFI handle.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutTestString (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *WString
- );
-
-/**
- Returns information for an available text mode that the output device(s)
- supports
-
- Implements SIMPLE_TEXT_OUTPUT.QueryMode().
- It returnes information for an available text mode that the Graphics Console supports.
- In this driver,we only support text mode 80x25, which is defined as mode 0.
-
- @param This Protocol instance pointer.
- @param ModeNumber The mode number to return information on.
- @param Columns The returned columns of the requested mode.
- @param Rows The returned rows of the requested mode.
-
- @retval EFI_SUCCESS The requested mode information is returned.
- @retval EFI_UNSUPPORTED The mode number is not valid.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutQueryMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber,
- OUT UINTN *Columns,
- OUT UINTN *Rows
- );
-
-
-/**
- Sets the output device(s) to a specified mode.
-
- Implements SIMPLE_TEXT_OUTPUT.SetMode().
- Set the Graphics Console to a specified mode. In this driver, we only support mode 0.
-
- @param This Protocol instance pointer.
- @param ModeNumber The text mode to set.
-
- @retval EFI_SUCCESS The requested text mode is set.
- @retval EFI_DEVICE_ERROR The requested text mode cannot be set because of
- Graphics Console device error.
- @retval EFI_UNSUPPORTED The text mode number is not valid.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetMode (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN ModeNumber
- );
-
-/**
- Sets the background and foreground colors for the OutputString () and
- ClearScreen () functions.
-
- Implements SIMPLE_TEXT_OUTPUT.SetAttribute().
-
- @param This Protocol instance pointer.
- @param Attribute The attribute to set. Bits 0..3 are the foreground
- color, and bits 4..6 are the background color.
- All other bits are undefined and must be zero.
-
- @retval EFI_SUCCESS The requested attribute is set.
- @retval EFI_DEVICE_ERROR The requested attribute cannot be set due to Graphics Console port error.
- @retval EFI_UNSUPPORTED The attribute requested is not defined.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetAttribute (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Attribute
- );
-
-/**
- Clears the output device(s) display to the currently selected background
- color.
-
- Implements SIMPLE_TEXT_OUTPUT.ClearScreen().
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutClearScreen (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- );
-
-/**
- Sets the current coordinates of the cursor position.
-
- Implements SIMPLE_TEXT_OUTPUT.SetCursorPosition().
-
- @param This Protocol instance pointer.
- @param Column The position to set the cursor to. Must be greater than or
- equal to zero and less than the number of columns and rows
- by QueryMode ().
- @param Row The position to set the cursor to. Must be greater than or
- equal to zero and less than the number of columns and rows
- by QueryMode ().
-
- @retval EFI_SUCCESS The operation completed successfully.
- @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
- @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the
- cursor position is invalid for the current mode.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutSetCursorPosition (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN UINTN Column,
- IN UINTN Row
- );
-
-
-/**
- Makes the cursor visible or invisible.
-
- Implements SIMPLE_TEXT_OUTPUT.EnableCursor().
-
- @param This Protocol instance pointer.
- @param Visible If TRUE, the cursor is set to be visible, If FALSE,
- the cursor is set to be invisible.
-
- @retval EFI_SUCCESS The operation completed successfully.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleConOutEnableCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN BOOLEAN Visible
- );
-
-/**
- Test to see if Graphics Console could be supported on the Controller.
-
- Graphics Console could be supported if Graphics Output Protocol or UGA Draw
- Protocol exists on the Controller. (UGA Draw Protocol could be skipped
- if PcdUgaConsumeSupport is set to FALSE.)
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to test.
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver supports this device.
- @retval other This driver does not support this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-
-/**
- Start this driver on Controller by opening Graphics Output protocol or
- UGA Draw protocol, and installing Simple Text Out protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to bind driver to
- @param RemainingDevicePath Optional parameter use to pick a specific child
- device to start.
-
- @retval EFI_SUCCESS This driver is added to Controller.
- @retval other This driver does not support this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
- );
-
-/**
- Stop this driver on Controller by removing Simple Text Out protocol
- and closing the Graphics Output Protocol or UGA Draw protocol on Controller.
- (UGA Draw protocol could be skipped if PcdUgaConsumeSupport is set to FALSE.)
-
-
- @param This Protocol instance pointer.
- @param Controller Handle of device to stop driver on
- @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
- children is zero stop the entire bus driver.
- @param ChildHandleBuffer List of Child Handles to Stop.
-
- @retval EFI_SUCCESS This driver is removed Controller.
- @retval EFI_NOT_STARTED Simple Text Out protocol could not be found the
- Controller.
- @retval other This driver was not removed from this device.
-
-**/
-EFI_STATUS
-EFIAPI
-GraphicsConsoleControllerDriverStop (
- IN EFI_DRIVER_BINDING_PROTOCOL *This,
- IN EFI_HANDLE Controller,
- IN UINTN NumberOfChildren,
- IN EFI_HANDLE *ChildHandleBuffer
- );
-
-
-/**
- Locate HII Database protocol and HII Font protocol.
-
- @retval EFI_SUCCESS HII Database protocol and HII Font protocol
- are located successfully.
- @return other Failed to locate HII Database protocol or
- HII Font protocol.
-
-**/
-EFI_STATUS
-EfiLocateHiiProtocol (
- VOID
- );
-
-
-/**
- Gets Graphics Console devcie's foreground color and background color.
-
- @param This Protocol instance pointer.
- @param Foreground Returned text foreground color.
- @param Background Returned text background color.
-
- @retval EFI_SUCCESS It returned always.
-
-**/
-EFI_STATUS
-GetTextColors (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Foreground,
- OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Background
- );
-
-/**
- Draw Unicode string on the Graphics Console device's screen.
-
- @param This Protocol instance pointer.
- @param UnicodeWeight One Unicode string to be displayed.
- @param Count The count of Unicode string.
-
- @retval EFI_OUT_OF_RESOURCES If no memory resource to use.
- @retval EFI_UNSUPPORTED If no Graphics Output protocol and UGA Draw
- protocol exist.
- @retval EFI_SUCCESS Drawing Unicode string implemented successfully.
-
-**/
-EFI_STATUS
-DrawUnicodeWeightAtCursorN (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
- IN CHAR16 *UnicodeWeight,
- IN UINTN Count
- );
-
-/**
- Erase the cursor on the screen.
-
- @param This Protocol instance pointer.
-
- @retval EFI_SUCCESS The cursor is erased successfully.
-
-**/
-EFI_STATUS
-EraseCursor (
- IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
- );
-
-/**
- Check if the current specific mode supported the user defined resolution
- for the Graphics Console device based on Graphics Output Protocol.
-
- If yes, set the graphic device's current mode to this specific mode.
-
- @param GraphicsOutput Graphics Output Protocol instance pointer.
- @param HorizontalResolution User defined horizontal resolution
- @param VerticalResolution User defined vertical resolution.
- @param CurrentModeNumber Current specific mode to be check.
-
- @retval EFI_SUCCESS The mode is supported.
- @retval EFI_UNSUPPORTED The specific mode is out of range of graphics
- device supported.
- @retval other The specific mode does not support user defined
- resolution or failed to set the current mode to the
- specific mode on graphics device.
-
-**/
-EFI_STATUS
-CheckModeSupported (
- EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput,
- IN UINT32 HorizontalResolution,
- IN UINT32 VerticalResolution,
- OUT UINT32 *CurrentModeNumber
- );
-
-EFI_STATUS
-ExynosGopConstructor (
- IN GRAPHICS_CONSOLE_DEV *Private
- );
-
-EFI_STATUS
-ExynosGopDestructor (
- GRAPHICS_CONSOLE_DEV *Private
- );
-#endif
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsoleDxe.inf b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
deleted file mode 100755
index 25f12dd4a..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
+++ /dev/null
@@ -1,73 +0,0 @@
-## @file
-#
-# Component description file for GraphicsConsole module
-#
-# This is the main routine for initializing the Graphics Console support routines.
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = GraphicsConsoleDxe
- FILE_GUID = c5deae31-fad2-4030-841b-cfc9644d2c5b
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- ENTRY_POINT = InitializeGraphicsConsole
-
-#
-# The following information is for reference only and not required by the build tools.
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-# DRIVER_BINDING = gGraphicsConsoleDriverBinding
-# COMPONENT_NAME = gGraphicsConsoleComponentName
-# COMPONENT_NAME2 = gGraphicsConsoleComponentName2
-#
-
-[Sources]
- ComponentName.c
- LaffStd.c
- GraphicsConsole.c
- GraphicsConsole.h
- ExynosGop.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
- SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec
-
-[LibraryClasses]
- BaseLib
- UefiLib
- MemoryAllocationLib
- UefiDriverEntryPoint
- HiiLib
- IoLib
-
-[Protocols]
- gEfiSimpleTextOutProtocolGuid ## BY_START
- gEfiGraphicsOutputProtocolGuid ## TO_START
- gEfiUgaDrawProtocolGuid ## TO_START
- gEfiHiiFontProtocolGuid ## TO_START
- gEfiHiiDatabaseProtocolGuid ## TO_START
- gSamsungPlatformGpioProtocolGuid ## GPIO Protocol
-
-[Guids]
-
-[FeaturePcd]
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport
-[FixedPcd]
- gExynosPkgTokenSpaceGuid.PcdCmuBase
- gExynosPkgTokenSpaceGuid.PcdPmuBase
- gExynosPkgTokenSpaceGuid.PcdSysBase
- gExynosPkgTokenSpaceGuid.PcdFIMD0Base
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/LaffStd.c b/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/LaffStd.c
deleted file mode 100755
index d5bf3ec71..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/GraphicsConsoleDxe/LaffStd.c
+++ /dev/null
@@ -1,276 +0,0 @@
-/** @file
- Narrow font Data definition for GraphicsConsole driver.
-
-Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
-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 "GraphicsConsole.h"
-
-
-
-EFI_NARROW_GLYPH gUsStdNarrowGlyphData[] = {
- //
- // Unicode glyphs from 0x20 to 0x7e are the same as ASCII characters 0x20 to 0x7e
- //
- { 0x0020, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x0021, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x3C,0x3C,0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x0022, 0x00, {0x00,0x00,0x00,0x6C,0x6C,0x6C,0x28,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x0023, 0x00, {0x00,0x00,0x00,0x00,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0xFE,0x6C,0x6C,0x6C,0x00,0x00,0x00,0x00}},
- { 0x0024, 0x00, {0x00,0x00,0x18,0x18,0x7C,0xC6,0xC6,0x60,0x38,0x0C,0x06,0xC6,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00}},
- { 0x0025, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x0026, 0x00, {0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0x78,0x76,0xDC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x0027, 0x00, {0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x0028, 0x00, {0x00,0x00,0x00,0x06,0x0C,0x0C,0x18,0x18,0x18,0x18,0x18,0x18,0x0C,0x0C,0x06,0x00,0x00,0x00,0x00}},
- { 0x0029, 0x00, {0x00,0x00,0x00,0xC0,0x60,0x60,0x30,0x30,0x30,0x30,0x30,0x30,0x60,0x60,0xC0,0x00,0x00,0x00,0x00}},
- { 0x002a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6C,0x38,0xFE,0x38,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x002b, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x002c, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00,0x00}},
- { 0x002d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x002e, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
- { 0x002f, 0x00, {0x00,0x00,0x00,0x06,0x06,0x0C,0x0C,0x18,0x18,0x30,0x30,0x60,0x60,0xC0,0xC0,0x00,0x00,0x00,0x00}},
- { 0x0030, 0x00, {0x00,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xD6,0xD6,0xC6,0xC6,0xC6,0x6C,0x38,0x00,0x00,0x00,0x00}},
- { 0x0031, 0x00, {0x00,0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x00,0x00,0x00,0x00}},
- { 0x0032, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x06,0x0C,0x18,0x30,0x60,0xC0,0xC2,0xFE,0x00,0x00,0x00,0x00}},
- { 0x0033, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0x06,0x06,0x06,0x3C,0x06,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0034, 0x00, {0x00,0x00,0x00,0x1C,0x1C,0x3C,0x3C,0x6C,0x6C,0xCC,0xFE,0x0C,0x0C,0x0C,0x1E,0x00,0x00,0x00,0x00}},
- { 0x0035, 0x00, {0x00,0x00,0x00,0xFE,0xC0,0xC0,0xC0,0xC0,0xFC,0x06,0x06,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0036, 0x00, {0x00,0x00,0x00,0x3C,0x60,0xC0,0xC0,0xC0,0xFC,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0037, 0x00, {0x00,0x00,0x00,0xFE,0xC6,0x06,0x06,0x06,0x0C,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x0038, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0039, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x06,0x06,0x06,0x0C,0x78,0x00,0x00,0x00,0x00}},
- { 0x003a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
- { 0x003b, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00}},
- { 0x003c, 0x00, {0x00,0x00,0x00,0x00,0x06,0x0C,0x18,0x30,0x60,0xC0,0x60,0x30,0x18,0x0C,0x06,0x00,0x00,0x00,0x00}},
- { 0x003d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x003e, 0x00, {0x00,0x00,0x00,0x00,0xC0,0x60,0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x60,0xC0,0x00,0x00,0x00,0x00}},
- { 0x003f, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0x0C,0x0C,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x0040, 0x00, {0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xDE,0xDE,0xDE,0xDC,0xC0,0xC0,0x7E,0x00,0x00,0x00,0x00}},
-
- { 0x0041, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
-
- { 0x0042, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x66,0x66,0x66,0x66,0x66,0xFC,0x00,0x00,0x00,0x00}},
- { 0x0043, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x00,0x00,0x00,0x00}},
- { 0x0044, 0x00, {0x00,0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00}},
- { 0x0045, 0x00, {0x00,0x00,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x0046, 0x00, {0x00,0x00,0x00,0xFE,0x66,0x62,0x60,0x64,0x7C,0x64,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
- { 0x0047, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xDE,0xC6,0xC6,0xC6,0x66,0x3C,0x00,0x00,0x00,0x00}},
- { 0x0048, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x0049, 0x00, {0x00,0x00,0x00,0xFC,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xFC,0x00,0x00,0x00,0x00}},
- { 0x004a, 0x00, {0x00,0x00,0x00,0x1E,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0xCC,0xCC,0x78,0x00,0x00,0x00,0x00}},
- { 0x004b, 0x00, {0x00,0x00,0x00,0xE6,0x66,0x6C,0x6C,0x78,0x70,0x78,0x6C,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
- { 0x004c, 0x00, {0x00,0x00,0x00,0xF0,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x004d, 0x00, {0x00,0x00,0x00,0xC6,0xEE,0xEE,0xFE,0xFE,0xD6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x004e, 0x00, {0x00,0x00,0x00,0xC6,0xE6,0xF6,0xF6,0xF6,0xDE,0xCE,0xCE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x004f, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0050, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
- { 0x0051, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0x7C,0x1C,0x0E,0x00,0x00}},
- { 0x0052, 0x00, {0x00,0x00,0x00,0xFC,0x66,0x66,0x66,0x66,0x7C,0x78,0x6C,0x6C,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
- { 0x0053, 0x00, {0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0x60,0x38,0x0C,0x06,0x06,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0054, 0x00, {0x00,0x00,0x00,0xFC,0xFC,0xB4,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
- { 0x0055, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0056, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x6C,0x38,0x10,0x00,0x00,0x00,0x00}},
- { 0x0057, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xD6,0xD6,0xD6,0xFE,0x6C,0x6C,0x00,0x00,0x00,0x00}},
- { 0x0058, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0xC6,0x6C,0x6C,0x38,0x6C,0x6C,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x0059, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
- { 0x005a, 0x00, {0x00,0x00,0x00,0xFE,0xC6,0x86,0x0C,0x0C,0x18,0x30,0x60,0xC0,0xC2,0xC6,0xFE,0x00,0x00,0x00,0x00}},
- { 0x005b, 0x00, {0x00,0x00,0x00,0x1E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1E,0x00,0x00,0x00,0x00}},
- { 0x005c, 0x00, {0x00,0x00,0x00,0xC0,0xC0,0x60,0x60,0x30,0x30,0x18,0x18,0x0C,0x0C,0x06,0x06,0x00,0x00,0x00,0x00}},
- { 0x005d, 0x00, {0x00,0x00,0x00,0xF0,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0xF0,0x00,0x00,0x00,0x00}},
- { 0x005e, 0x00, {0x00,0x00,0x10,0x38,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x005f, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00}},
- { 0x0060, 0x00, {0x00,0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x0061, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x0062, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0063, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0064, 0x00, {0x00,0x00,0x00,0x1C,0x0C,0x0C,0x0C,0x3C,0x6C,0xCC,0xCC,0xCC,0xCC,0xCC,0x7E,0x00,0x00,0x00,0x00}},
- { 0x0065, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0066, 0x00, {0x00,0x00,0x00,0x1E,0x33,0x30,0x30,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x78,0x00,0x00,0x00,0x00}},
- { 0x0067, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0xCC,0x78,0x00}},
- { 0x0068, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x76,0x66,0x66,0x66,0x66,0x66,0xE6,0x00,0x00,0x00,0x00}},
- { 0x0069, 0x00, {0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x006a, 0x00, {0x00,0x00,0x00,0x0C,0x0C,0x0C,0x00,0x1C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x0C,0x6C,0x38,0x00}},
- { 0x006b, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x66,0x6C,0x78,0x70,0x78,0x6C,0x6C,0x66,0xE6,0x00,0x00,0x00,0x00}},
- { 0x006c, 0x00, {0x00,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x006d, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0xEE,0xFE,0xD6,0xD6,0xD6,0xD6,0xD6,0x00,0x00,0x00,0x00}},
- { 0x006e, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}},
- { 0x006f, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0070, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00}},
- { 0x0071, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x76,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x7C,0x0C,0x0C,0x1E,0x00}},
- { 0x0072, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xDC,0x66,0x60,0x60,0x60,0x60,0x60,0xF0,0x00,0x00,0x00,0x00}},
- { 0x0073, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0x7C,0x06,0x06,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x0074, 0x00, {0x00,0x00,0x00,0x10,0x30,0x30,0x30,0xFC,0x30,0x30,0x30,0x30,0x30,0x36,0x1C,0x00,0x00,0x00,0x00}},
- { 0x0075, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x0076, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x78,0x30,0x00,0x00,0x00,0x00}},
- { 0x0077, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xD6,0xD6,0xFE,0xEE,0x6C,0x00,0x00,0x00,0x00}},
- { 0x0078, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x0079, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00}},
- { 0x007a, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x86,0x0C,0x18,0x30,0x60,0xC0,0xFE,0x00,0x00,0x00,0x00}},
- { 0x007b, 0x00, {0x00,0x00,0x00,0x0E,0x18,0x18,0x18,0x18,0x30,0x18,0x18,0x18,0x18,0x18,0x0E,0x00,0x00,0x00,0x00}},
- { 0x007c, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x007d, 0x00, {0x00,0x00,0x00,0xE0,0x30,0x30,0x30,0x30,0x18,0x30,0x30,0x30,0x30,0x30,0xE0,0x00,0x00,0x00,0x00}},
- { 0x007e, 0x00, {0x00,0x00,0x00,0x76,0xDC,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
-
- { 0x00a0, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00a1, 0x00, {0x00,0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x3C,0x3C,0x3C,0x18,0x00,0x00,0x00,0x00}},
- { 0x00a2, 0x00, {0x00,0x00,0x00,0x00,0x18,0x18,0x7C,0xC6,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x00a3, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x64,0x60,0x60,0xF0,0x60,0x60,0x60,0x60,0xE6,0xFC,0x00,0x00,0x00,0x00}},
- { 0x00a4, 0x00, {0x00,0x00,0x18,0x00,0x00,0x00,0xC6,0x7C,0xC6,0xC6,0xC6,0xC6,0x7C,0xC6,0x00,0x00,0x00,0x00,0x00}},
- { 0x00a5, 0x00, {0x00,0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x7E,0x18,0x7E,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x00a6, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00}},
- { 0x00a7, 0x00, {0x00,0x00,0x18,0x7C,0xC6,0x60,0x38,0x6C,0xC6,0xC6,0x6C,0x38,0x0C,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00a8, 0x00, {0x00,0x00,0x00,0xC6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00a9, 0x00, {0x00,0x00,0x00,0x00,0x7C,0x82,0x9A,0xA2,0xA2,0xA2,0x9A,0x82,0x7C,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00aa, 0x00, {0x00,0x00,0x00,0x00,0x3C,0x6C,0x6C,0x6C,0x3E,0x00,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00ab, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x36,0x6C,0xD8,0x6C,0x36,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00ac, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00ad, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00ae, 0x00, {0x00,0x00,0x00,0x00,0x7C,0x82,0xB2,0xAA,0xAA,0xB2,0xAA,0xAA,0x82,0x7C,0x00,0x00,0x00,0x00,0x00}},
- { 0x00af, 0x00, {0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b0, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x6C,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b1, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00,0x7E,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b2, 0x00, {0x00,0x00,0x00,0x3C,0x66,0x0C,0x18,0x32,0x7E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b3, 0x00, {0x00,0x00,0x00,0x7C,0x06,0x3C,0x06,0x06,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b4, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b5, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xC0,0x00}},
- { 0x00b6, 0x00, {0x00,0x00,0x00,0x7F,0xDB,0xDB,0xDB,0xDB,0x7B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x00,0x00,0x00,0x00}},
- { 0x00b7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00b8, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x0C,0x78,0x00,0x00,0x00}},
- { 0x00b9, 0x00, {0x00,0x00,0x00,0x18,0x38,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00ba, 0x00, {0x00,0x00,0x00,0x00,0x38,0x6C,0x6C,0x6C,0x38,0x00,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00bb, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xD8,0x6C,0x36,0x6C,0xD8,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00bc, 0x00, {0x00,0x00,0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00,0x00}},
- { 0x00bd, 0x00, {0x00,0x00,0x00,0x60,0xE0,0x62,0x66,0x6C,0x18,0x30,0x60,0xDC,0x86,0x0C,0x18,0x3E,0x00,0x00,0x00}},
- { 0x00be, 0x00, {0x00,0x00,0x00,0xE0,0x30,0x62,0x36,0xEC,0x18,0x30,0x66,0xCE,0x9A,0x3F,0x06,0x06,0x00,0x00,0x00}},
- { 0x00bf, 0x00, {0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0x60,0xC0,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00c0, 0x00, {0x60,0x30,0x18,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c1, 0x00, {0x18,0x30,0x60,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c2, 0x00, {0x10,0x38,0x6C,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c3, 0x00, {0x76,0xDC,0x00,0x00,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c4, 0x00, {0xCC,0xCC,0x00,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c5, 0x00, {0x38,0x6C,0x38,0x00,0x10,0x38,0x6C,0xC6,0xC6,0xC6,0xFE,0xC6,0xC6,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00c6, 0x00, {0x00,0x00,0x00,0x00,0x3E,0x6C,0xCC,0xCC,0xCC,0xFE,0xCC,0xCC,0xCC,0xCC,0xCE,0x00,0x00,0x00,0x00}},
- { 0x00c7, 0x00, {0x00,0x00,0x00,0x3C,0x66,0xC2,0xC0,0xC0,0xC0,0xC0,0xC0,0xC0,0xC2,0x66,0x3C,0x18,0x70,0x00,0x00}},
- { 0x00c8, 0x00, {0x60,0x30,0x18,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x00c9, 0x00, {0x18,0x30,0x60,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x00ca, 0x00, {0x10,0x38,0x6C,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x00cb, 0x00, {0xCC,0xCC,0x00,0x00,0xFE,0x66,0x62,0x60,0x68,0x78,0x68,0x60,0x62,0x66,0xFE,0x00,0x00,0x00,0x00}},
- { 0x00cc, 0x00, {0x60,0x30,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00cd, 0x00, {0x18,0x30,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00ce, 0x00, {0x10,0x38,0x6C,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00cf, 0x00, {0xCC,0xCC,0x00,0x00,0x3C,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00d0, 0x00, {0x00,0x00,0x00,0xF8,0x6C,0x66,0x66,0x66,0xF6,0x66,0x66,0x66,0x66,0x6C,0xF8,0x00,0x00,0x00,0x00}},
- { 0x00d1, 0x00, {0x76,0xDC,0x00,0x00,0xC6,0xE6,0xE6,0xF6,0xF6,0xDE,0xDE,0xCE,0xCE,0xC6,0xC6,0x00,0x00,0x00,0x00}},
- { 0x00d2, 0x00, {0x60,0x30,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00d3, 0x00, {0x18,0x30,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00d4, 0x00, {0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00d5, 0x00, {0x76,0xDC,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00d6, 0x00, {0xCC,0xCC,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00d7, 0x00, {0x10,0x28,0x00,0x00,0x00,0x00,0x00,0xC6,0x6C,0x38,0x38,0x6C,0x6C,0xC6,0x00,0x00,0x00,0x00,0x00}},
- { 0x00d8, 0x00, {0x00,0x00,0x00,0x7C,0xCE,0xCE,0xDE,0xD6,0xD6,0xD6,0xD6,0xF6,0xE6,0xE6,0x7C,0x40,0x00,0x00,0x00}},
- { 0x00d9, 0x00, {0x60,0x30,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00da, 0x00, {0x18,0x30,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00db, 0x00, {0x10,0x38,0x6C,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00dc, 0x00, {0xCC,0xCC,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00dd, 0x00, {0x18,0x30,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00de, 0x00, {0x00,0x00,0x10,0x00,0xF0,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x7C,0x60,0xF0,0x00,0x00,0x00,0x00}},
- { 0x00df, 0x00, {0x00,0x00,0x00,0x78,0xCC,0xCC,0xCC,0xCC,0xD8,0xCC,0xC6,0xC6,0xC6,0xC6,0xCC,0x00,0x00,0x00,0x00}},
- { 0x00e0, 0x00, {0x00,0x30,0x30,0x60,0x30,0x18,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e1, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e2, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e3, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e4, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0x00,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e5, 0x00, {0x00,0x00,0x00,0x38,0x6C,0x38,0x00,0x78,0x0C,0x0C,0x7C,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00e6, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEC,0x36,0x36,0x7E,0xD8,0xD8,0xD8,0x6E,0x00,0x00,0x00,0x00}},
- { 0x00e7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xC6,0xC0,0xC0,0xC0,0xC0,0xC6,0x7C,0x18,0x70,0x00,0x00}},
- { 0x00e8, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00e9, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00ea, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00eb, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xFE,0xC0,0xC0,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00ec, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00ed, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00ee, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00ef, 0x00, {0x00,0x00,0x00,0x66,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00f0, 0x00, {0x00,0x00,0x00,0x34,0x18,0x2C,0x0C,0x06,0x3E,0x66,0x66,0x66,0x66,0x66,0x3C,0x00,0x00,0x00,0x00}},
- { 0x00f1, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0xDC,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00}},
- { 0x00f2, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f3, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f4, 0x00, {0x00,0x00,0x00,0x10,0x38,0x6C,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f5, 0x00, {0x00,0x00,0x00,0x00,0x76,0xDC,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f6, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0x7C,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f7, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x7E,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { 0x00f8, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7C,0xCE,0xDE,0xD6,0xF6,0xE6,0xC6,0x7C,0x00,0x00,0x00,0x00}},
- { 0x00f9, 0x00, {0x00,0x00,0x00,0x60,0x30,0x18,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00fa, 0x00, {0x00,0x00,0x00,0x18,0x30,0x60,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00fb, 0x00, {0x00,0x00,0x00,0x30,0x78,0xCC,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00fc, 0x00, {0x00,0x00,0x00,0xCC,0xCC,0x00,0x00,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0xCC,0x76,0x00,0x00,0x00,0x00}},
- { 0x00fd, 0x00, {0x00,0x00,0x00,0x0C,0x18,0x30,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0xF8,0x00}},
- { 0x00fe, 0x00, {0x00,0x00,0x00,0xE0,0x60,0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x66,0x66,0x7C,0x60,0x60,0xF0,0x00}},
- { 0x00ff, 0x00, {0x00,0x00,0x00,0xC6,0xC6,0x00,0x00,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0xC6,0x7E,0x06,0x0C,0x78,0x00}},
-
- { (CHAR16)BOXDRAW_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_VERTICAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_UP_RIGHT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_UP_LEFT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_VERTICAL_RIGHT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_VERTICAL_LEFT, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_UP_HORIZONTAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_VERTICAL_HORIZONTAL, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOUBLE_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_DOUBLE_VERTICAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOWN_RIGHT_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_DOUBLE_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_DOWN_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3F,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOWN_LEFT_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_DOUBLE_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_DOWN_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_UP_RIGHT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_UP_DOUBLE_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_DOUBLE_UP_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_UP_LEFT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_UP_DOUBLE_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_DOUBLE_UP_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1F,0x18,0x1F,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_VERTICAL_LEFT_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xF8,0x18,0xF8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_VERTICAL_DOUBLE_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_VERTICAL_LEFT, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF6,0x06,0xF6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_UP_HORIZONTAL_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_UP_DOUBLE_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_DOUBLE_UP_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0x00, {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xFF,0x18,0xFF,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18}},
- { (CHAR16)BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xFF,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
- { (CHAR16)BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0x00, {0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xF7,0x00,0xF7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36}},
-
- { (CHAR16)BLOCKELEMENT_FULL_BLOCK, 0x00, {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}},
- { (CHAR16)BLOCKELEMENT_LIGHT_SHADE, 0x00, {0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22,0x88,0x22}},
-
- { (CHAR16)GEOMETRICSHAPE_RIGHT_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0xC0,0xE0,0xF0,0xF8,0xFE,0xF8,0xF0,0xE0,0xC0,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)GEOMETRICSHAPE_LEFT_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x06,0x0E,0x1E,0x3E,0xFE,0x3E,0x1E,0x0E,0x06,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)GEOMETRICSHAPE_UP_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7C,0x7C,0xFE,0xFE,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)GEOMETRICSHAPE_DOWN_TRIANGLE, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x7C,0x7C,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00}},
-
- { (CHAR16)ARROW_UP, 0x00, {0x00,0x00,0x00,0x18,0x3C,0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)ARROW_DOWN, 0x00, {0x00,0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7E,0x3C,0x18,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)ARROW_LEFT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x20,0x60,0x60,0xFE,0xFE,0x60,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00}},
- { (CHAR16)ARROW_RIGHT, 0x00, {0x00,0x00,0x00,0x00,0x00,0x08,0x0C,0x0C,0xFE,0xFE,0x0C,0x0C,0x08,0x00,0x00,0x00,0x00,0x00,0x00}},
-
- { 0x0000, 0x00, {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}} //EOL
-};
-
-// Get available Unicode glyphs narrow fonts(8*19 pixels) size.
-UINT32 mNarrowFontSize = sizeof (gUsStdNarrowGlyphData);
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosLib.h b/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosLib.h
deleted file mode 100644
index e8ec8597d..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosLib.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 __EXYNOSLIB_H__
-#define __EXYNOSLIB_H__
-
-UINT32
-EFIAPI
-GpioBase (
- IN UINTN Port
- );
-
-#endif // __EXYNOSLIB_H__
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosTimerLib.h b/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosTimerLib.h
deleted file mode 100644
index c723ac128..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Library/ExynosTimerLib.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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.
-*
-**/
-
-
-#ifndef _EXYNOSTIMERLIB_H__
-#define _EXYNOSTIMERLIB_H__
-
-typedef enum{
- TIMER_0,
- TIMER_1,
- TIMER_2,
- TIMER_3,
- TIMER_4,
-}PWM_TIMERS;
-
-#define NUM_OF_TIMERS (0x05)
-#define PWM_TCFG0_OFFSET (0x0000)
-#define PWM_TCFG1_OFFSET (0x0004)
-#define PWM_TCON_OFFSET (0x0008)
-#define PWM_TCNTB0_OFFSET (0x000C)
-#define PWM_TCMPB0_OFFSET (0x0010)
-#define PWM_TCNTO0_OFFSET (0x0014)
-#define PWM_TCNTB1_OFFSET (0x0018)
-#define PWM_TCMPB1_OFFSET (0x001C)
-#define PWM_TCNTO1_OFFSET (0x0020)
-#define PWM_TCNTB2_OFFSET (0x0024)
-#define PWM_TCMPB2_OFFSET (0x0028)
-#define PWM_TCNTO2_OFFSET (0x002C)
-#define PWM_TCNTB3_OFFSET (0x0030)
-#define PWM_TCMPB3_OFFSET (0x0034)
-#define PWM_TCNTO3_OFFSET (0x0038)
-#define PWM_TCNTB4_OFFSET (0x003C)
-#define PWM_TCNTO4_OFFSET (0x0040)
-#define PWM_TINT_CSTAT_OFFSET (0x0044)
-
-#define TIMER_STATUS_MASK(timer_no) (1 << (NUM_OF_TIMERS + timer_no))
-#define TIMER_INTR_MASK(timer_no) (1 << (timer_no))
-#define STOP_TIMER_VAL(timer_no) ~(0x0f << (((timer_no + 1)*(!!timer_no)) << 2))
-#define UPDATE_COUNT_BUF_MASK(timer_no) (2 << (((timer_no + 1)*(!!timer_no)) << 2))
-#define RELOAD_AND_START(timer_no) ((AUTO_RELOAD | START_TIMERPOS) << (((timer_no + 1)*(!!timer_no)) << 2))
-#define START_TIMER(timer_no) (START_TIMERPOS << (((timer_no + 1)*(!!timer_no)) << 2))
-
-
-#define PRESCALE_GRP0_START_POS (0x00)
-#define PRESCALE_TIMER_GRP0 (0x63)
-#define PRESCALE_GRP1_START_POS (0x08)
-#define PRESCALE_TIMER_GRP1 (0x63)
-#define MAX_COUNT_VAL (0xFFFFFFFF)
-#define AUTO_RELOAD (0x8)
-#define START_TIMERPOS (0x1)
-
-
-
-#endif
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform/ArmPlatform.h b/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform/ArmPlatform.h
deleted file mode 100644
index edb814268..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform/ArmPlatform.h
+++ /dev/null
@@ -1,693 +0,0 @@
-/** @file
-* Header defining RealView EB constants (Base addresses, sizes, flags)
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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.
-*
-**/
-
-#ifndef __ARMPLATFORM_H__
-#define __ARMPLATFORM_H__
-
-/*******************************************
-// Platform Memory Map
-*******************************************/
-
-/*******************************************
-// Motherboard peripherals
-*******************************************/
-//PMU DOMAIN offsets
-#define SWRESET_OFFSET (0x400)
-#define PMU_LCD0_CONF_OFFSET (0x3C80)
-#define PMU_LCD0_STAT_OFFSET (0x3C84)
-#define ARM_EB_BOARD_PERIPH_BASE 0x10000000
-
-
-#define LCD0_PWR_NRML_MODE (0x07)
-
-// SYSTRCL Register
-#define ARM_EB_SYSCTRL 0x10001000
-#define ARM_EB_SYS_FLAGS_REG 0x10020814
-#define ARM_EB_SYS_FLAGS_SET_REG 0x10020814
-#define ARM_EB_SYS_FLAGS_CLR_REG 0x10020814
-
-#define PL011_CONSOLE_UART_SPEED 115200
-
-
-// Exynos4210 DMC Base Address
-#define Exynos4210_DMC_DELAY 0x3000
-#define Exynos4210_DMC_0_BASE 0x10400000
-#define Exynos4210_DMC_1_BASE 0x10410000
-
-#define DMC_CONCONTROL 0x00
-#define DMC_MEMCONTROL 0x04
-#define DMC_MEMCONFIG0 0x08
-#define DMC_MEMCONFIG1 0x0C
-#define DMC_DIRECTCMD 0x10
-#define DMC_PRECHCONFIG 0x14
-#define DMC_PHYCONTROL0 0x18
-#define DMC_PHYCONTROL1 0x1C
-#define DMC_PHYCONTROL2 0x20
-#define DMC_PWRDNCONFIG 0x28
-#define DMC_TIMINGAREF 0x30
-#define DMC_TIMINGROW 0x34
-#define DMC_TIMINGDATA 0x38
-#define DMC_TIMINGPOWER 0x3C
-#define DMC_PHYSTATUS 0x40
-#define DMC_PHYZQCONTROL 0x44
-#define DMC_CHIP0STATUS 0x48
-#define DMC_CHIP1STATUS 0x4C
-#define DMC_AREFSTATUS 0x50
-#define DMC_MRSTATUS 0x54
-#define DMC_PHYTEST0 0x58
-#define DMC_PHYTEST1 0x5C
-#define DMC_QOSCONTROL0 0x60
-#define DMC_QOSCONFIG0 0x64
-#define DMC_QOSCONTROL1 0x68
-#define DMC_QOSCONFIG1 0x6C
-#define DMC_QOSCONTROL2 0x70
-#define DMC_QOSCONFIG2 0x74
-#define DMC_QOSCONTROL3 0x78
-#define DMC_QOSCONFIG3 0x7C
-#define DMC_QOSCONTROL4 0x80
-#define DMC_QOSCONFIG4 0x84
-#define DMC_QOSCONTROL5 0x88
-#define DMC_QOSCONFIG5 0x8C
-#define DMC_QOSCONTROL6 0x90
-#define DMC_QOSCONFIG6 0x94
-#define DMC_QOSCONTROL7 0x98
-#define DMC_QOSCONFIG7 0x9C
-#define DMC_QOSCONTROL8 0xA0
-#define DMC_QOSCONFIG8 0xA4
-#define DMC_QOSCONTROL9 0xA8
-#define DMC_QOSCONFIG9 0xAC
-#define DMC_QOSCONTROL10 0xB0
-#define DMC_QOSCONFIG10 0xB4
-#define DMC_QOSCONTROL11 0xB8
-#define DMC_QOSCONFIG11 0xBC
-#define DMC_QOSCONTROL12 0xC0
-#define DMC_QOSCONFIG12 0xC4
-#define DMC_QOSCONTROL13 0xC8
-#define DMC_QOSCONFIG13 0xCC
-#define DMC_QOSCONTROL14 0xD0
-#define DMC_QOSCONFIG14 0xD4
-#define DMC_QOSCONTROL15 0xD8
-#define DMC_QOSCONFIG15 0xDC
-
-// Exynos4210 UART Register
-#define Exynos4210_UART_BASE 0x13810000
-
-#define ULCON_OFFSET 0x00
-#define UCON_OFFSET 0x04
-#define UFCON_OFFSET 0x08
-#define UMCON_OFFSET 0x0C
-#define UTRSTAT_OFFSET 0x10
-#define UERSTAT_OFFSET 0x14
-#define UFSTAT_OFFSET 0x18
-#define UMSTAT_OFFSET 0x1C
-#define UTXH_OFFSET 0x20
-#define URXH_OFFSET 0x24
-#define UBRDIV_OFFSET 0x28
-#define UDIVSLOT_OFFSET 0x2C
-#define UINTP_OFFSET 0x30
-#define UINTSP_OFFSET 0x34
-#define UINTM_OFFSET 0x38
-
-
-#define UARTLCR_H ULCON_OFFSET
-#define UARTECR UFCON_OFFSET
-#define UARTCR UCON_OFFSET
-#define UARTIBRD UBRDIV_OFFSET
-#define UARTFBRD UDIVSLOT_OFFSET
-
-#define UART_TX_EMPTY_FLAG_MASK (0x02)
-#define UART_RX_EMPTY_FLAG_MASK (0x01)
-// Exynos4210 TZPC Register
-#define Exynos4210_TZPC0_BASE 0x10110000
-#define Exynos4210_TZPC1_BASE 0x10120000
-#define Exynos4210_TZPC2_BASE 0x10130000
-#define Exynos4210_TZPC3_BASE 0x10140000
-#define Exynos4210_TZPC4_BASE 0x10150000
-#define Exynos4210_TZPC5_BASE 0x10160000
-
-
-#define TZPC0_OFFSET 0x10000
-#define TZPC1_OFFSET 0x20000
-#define TZPC2_OFFSET 0x30000
-#define TZPC3_OFFSET 0x40000
-#define TZPC4_OFFSET 0x50000
-#define TZPC5_OFFSET 0x60000
-
-#define TZPC_DECPROT0SET_OFFSET 0x804
-#define TZPC_DECPROT1SET_OFFSET 0x810
-#define TZPC_DECPROT2SET_OFFSET 0x81C
-#define TZPC_DECPROT3SET_OFFSET 0x828
-
-
-// Exynos4210 CMU Base Address
-#define Exynos4210_CMU_DELAY 0x2000
-#define Exynos4210_CMU_BASE 0x10030000
-#define Exynos4210_CMU_DIV_DMC0 0x10500
-
-#define CONFIG_CLK_1000_400_200
-
-#if defined(CONFIG_CLK_800_330_165)
-#define APLL_MDIV 0xC8
-#define APLL_PDIV 0x6
-#define APLL_SDIV 0x1
-
-#define MPLL_MDIV 0x6E
-#define MPLL_PDIV 0x4
-#define MPLL_SDIV 0x1
-#elif defined(CONFIG_CLK_800_400_200)
-#define APLL_MDIV 0xC8
-#define APLL_PDIV 0x6
-#define APLL_SDIV 0x1
-
-#define MPLL_MDIV 0xC8
-#define MPLL_PDIV 0x6
-#define MPLL_SDIV 0x1
-#elif defined(CONFIG_CLK_1000_330_165)
-#define APLL_MDIV 0xFA
-#define APLL_PDIV 0x6
-#define APLL_SDIV 0x1
-
-#define MPLL_MDIV 0x6E
-#define MPLL_PDIV 0x4
-#define MPLL_SDIV 0x1
-#elif defined(CONFIG_CLK_1000_400_200) || defined(CONFIG_CLK_1000_200_200)
-#define APLL_MDIV 0xFA
-#define APLL_PDIV 0x6
-#define APLL_SDIV 0x1
-
-#define MPLL_MDIV 0xC8
-#define MPLL_PDIV 0x6
-#define MPLL_SDIV 0x1
-#endif
-
-#define APLL_AFC_ENB 0x1
-#define APLL_AFC 0xC
-#define APLL_CON1_VAL ((APLL_AFC_ENB << 31) | (APLL_AFC))
-
-/* MPLL_CON1 */
-#define MPLL_AFC_ENB 0x0
-#if defined(CONFIG_CLK_800_330_165) || defined(CONFIG_CLK_1000_330_165)
-#define MPLL_AFC 0xD
-#elif defined(CONFIG_CLK_1000_400_200) || defined(CONFIG_CLK_1000_200_200) || defined(CONFIG_CLK_800_400_200)
-#define MPLL_AFC 0x1C
-#endif
-#define MPLL_CON1_VAL ((MPLL_AFC_ENB << 31) | (MPLL_AFC))
-
-#define EPLL_MDIV 0x30
-#define EPLL_PDIV 0x3
-#define EPLL_SDIV 0x2
-#define EPLL_K 0x0
-#define EPLL_CON1_VAL (EPLL_K)
-
-#define VPLL_MDIV 0x35
-#define VPLL_PDIV 0x3
-#define VPLL_SDIV 0x2
-
-#define VPLL_SSCG_EN 0x0
-#define VPLL_SEL_PF 0x0
-#define VPLL_MRR 0x11
-#define VPLL_MFR 0x0
-#define VPLL_K 0x400
-#define VPLL_CON1_VAL ((VPLL_SSCG_EN <<31) \
- | (VPLL_SEL_PF <<29) \
- | (VPLL_MRR <<24) \
- | (VPLL_MFR << 16) \
- | (VPLL_K))
-/********************************************************/
-
-/* Set PLL */
-#define set_pll(mdiv, pdiv, sdiv) (1<<31 | mdiv<<16 | pdiv<<8 | sdiv)
-
-#define APLL_CON0_VAL set_pll(APLL_MDIV,APLL_PDIV,APLL_SDIV)
-#define MPLL_CON0_VAL set_pll(MPLL_MDIV,MPLL_PDIV,MPLL_SDIV)
-#define EPLL_CON0_VAL set_pll(EPLL_MDIV,EPLL_PDIV,EPLL_SDIV)
-#define VPLL_CON0_VAL set_pll(VPLL_MDIV,VPLL_PDIV,VPLL_SDIV)
-
-/* CLK_SRC_CPU */
-/* 0 = MOUTAPLL, 1 = SCLKMPLL */
-#define MUX_HPM_SEL_MOUTAPLL 0
-#define MUX_HPM_SEL_SCLKMPLL 1
-#define MUX_CORE_SEL_MOUTAPLL 0
-#define MUX_CORE_SEL_SCLKMPLL 1
-
-/* 0 = FILPLL, 1 = MOUT */
-#define MUX_MPLL_SEL_FILPLL 0
-#define MUX_MPLL_SEL_MOUTMPLLFOUT 1
-
-#define MUX_APLL_SEL_FILPLL 0
-#define MUX_APLL_SEL_MOUTMPLLFOUT 1
-
-#define CLK_SRC_CPU_VAL_FINPLL ((MUX_HPM_SEL_MOUTAPLL << 20) \
- | (MUX_CORE_SEL_MOUTAPLL <<16) \
- | (MUX_MPLL_SEL_FILPLL << 8) \
- | (MUX_APLL_SEL_FILPLL <<0))
-
-#define CLK_SRC_CPU_VAL_MOUTMPLLFOUT ((MUX_HPM_SEL_MOUTAPLL << 20) \
- | (MUX_CORE_SEL_MOUTAPLL <<16) \
- | (MUX_MPLL_SEL_MOUTMPLLFOUT << 8) \
- | (MUX_APLL_SEL_MOUTMPLLFOUT <<0))
-
-/* CLK_DIV_CPU0 */
-#define APLL_RATIO 0x1
-#define PCLK_DBG_RATIO 0x1
-#define ATB_RATIO 0x3
-#define PERIPH_RATIO 0x3
-#define COREM1_RATIO 0x7
-#define COREM0_RATIO 0x3
-#define CORE_RATIO 0x0
-#define CLK_DIV_CPU0_VAL ((APLL_RATIO << 24) \
- | (PCLK_DBG_RATIO << 20)\
- | (ATB_RATIO << 16) \
- | (PERIPH_RATIO <<12) \
- | (COREM1_RATIO << 8) \
- | (COREM0_RATIO << 4) \
- | (CORE_RATIO))
-
-/* CLK_DIV_CPU1 */
-#define HPM_RATIO 0x0
-#define COPY_RATIO 0x3
-#define CLK_DIV_CPU1_VAL ((HPM_RATIO << 4) | (COPY_RATIO))
-
-/* CLK_SRC_DMC */
-#define MUX_PWI_SEL 0x0
-#define MUX_CORE_TIMERS_SEL 0x0
-#define MUX_DPHY_SEL 0x0
-#define MUX_DMC_BUS_SEL 0x0
-#define CLK_SRC_DMC_VAL ((MUX_PWI_SEL << 16) \
- | (MUX_CORE_TIMERS_SEL << 12) \
- | (MUX_DPHY_SEL << 8) \
- | (MUX_DMC_BUS_SEL << 4))
-
-/* CLK_DIV_DMC0 */
-#if defined(CONFIG_CLK_1000_200_200)
-#define CORE_TIMERS_RATIO 0x1
-#define COPY2_RATIO 0x3
-#define DMCP_RATIO 0x1
-#define DMCD_RATIO 0x0
-#define DMC_RATIO 0x3
-#define DPHY_RATIO 0x1
-#define ACP_PCLK_RATIO 0x1
-#define ACP_RATIO 0x3
-#else
-#define CORE_TIMERS_RATIO 0x1
-#define COPY2_RATIO 0x3
-#define DMCP_RATIO 0x1
-#define DMCD_RATIO 0x1
-#define DMC_RATIO 0x1
-#define DPHY_RATIO 0x1
-#define ACP_PCLK_RATIO 0x1
-#define ACP_RATIO 0x3
-#endif
-#define CLK_DIV_DMC0_VAL ((CORE_TIMERS_RATIO << 28) \
- | (COPY2_RATIO << 24) \
- | (DMCP_RATIO << 20) \
- | (DMCD_RATIO << 16) \
- | (DMC_RATIO << 12) \
- | (DPHY_RATIO << 8) \
- | (ACP_PCLK_RATIO << 4) \
- | (ACP_RATIO))
-
-/* CLK_DIV_DMC1 */
-#define DPM_RATIO 0x1
-#define DVSEM_RATIO 0x1
-#define PWI_RATIO 0x1
-#define CLK_DIV_DMC1_VAL ((DPM_RATIO << 24) \
- | (DVSEM_RATIO << 16) \
- | (PWI_RATIO << 8))
-
-/* CLK_SRC_TOP0 */
-#define MUX_ONENAND_SEL 0x0 /* 0 = DOUT133, 1 = DOUT166 */
-#define MUX_ACLK_133_SEL 0x0 /* 0 = SCLKMPLL, 1 = SCLKAPLL */
-#define MUX_ACLK_160_SEL 0x0
-#define MUX_ACLK_100_SEL 0x0
-#define MUX_ACLK_200_SEL 0x0
-#define MUX_VPLL_SEL 0x0
-#define MUX_EPLL_SEL 0x0
-#define CLK_SRC_TOP0_VAL ((MUX_ONENAND_SEL << 28) \
- | (MUX_ACLK_133_SEL << 24) \
- | (MUX_ACLK_160_SEL << 20) \
- | (MUX_ACLK_100_SEL << 16) \
- | (MUX_ACLK_200_SEL << 12) \
- | (MUX_VPLL_SEL << 8) \
- | (MUX_EPLL_SEL << 4))
-
-/* CLK_SRC_TOP1 */
-#define VPLLSRC_SEL 0x0 /* 0 = FINPLL, 1 = SCLKHDMI27M */
-#define CLK_SRC_TOP1_VAL (VPLLSRC_SEL)
-
-/* CLK_DIV_TOP */
-#define ONENAND_RATIO 0x0
-#define ACLK_133_RATIO 0x5
-#define ACLK_160_RATIO 0x4
-#define ACLK_100_RATIO 0x7
-#define ACLK_200_RATIO 0x3
-#define CLK_DIV_TOP_VAL ((ONENAND_RATIO << 16) \
- | (ACLK_133_RATIO << 12) \
- | (ACLK_160_RATIO << 8) \
- | (ACLK_100_RATIO << 4) \
- | (ACLK_200_RATIO))
-
-/* CLK_SRC_LEFTBUS */
-#define MUX_GDL_SEL 0x0
-#define CLK_SRC_LEFTBUS_VAL (MUX_GDL_SEL)
-
-/* CLK_DIV_LEFRBUS */
-#define GPL_RATIO 0x1
-#define GDL_RATIO 0x3
-#define CLK_DIV_LEFRBUS_VAL ((GPL_RATIO << 4) \
- | (GDL_RATIO))
-
-/* CLK_SRC_RIGHTBUS */
-#define MUX_GDR_SEL 0x0
-#define CLK_SRC_RIGHTBUS_VAL (MUX_GDR_SEL)
-
-/* CLK_DIV_RIGHTBUS */
-#define GPR_RATIO 0x1
-#define GDR_RATIO 0x3
-#define CLK_DIV_RIGHTBUS_VAL ((GPR_RATIO << 4) \
- | (GDR_RATIO))
-
-#define PLL_LOCKTIME 0x1C20
-/* APLL_LOCK */
-#define APLL_LOCK_VAL (PLL_LOCKTIME)
-/* MPLL_LOCK */
-#define MPLL_LOCK_VAL (PLL_LOCKTIME)
-/* EPLL_LOCK */
-#define EPLL_LOCK_VAL (PLL_LOCKTIME)
-/* VPLL_LOCK */
-#define VPLL_LOCK_VAL (PLL_LOCKTIME)
-
-/* CLK_SRC_PERIL0 */
-#define PWM_SEL 0
-#define UART5_SEL 6
-#define UART4_SEL 6
-#define UART3_SEL 6
-#define UART2_SEL 6
-#define UART1_SEL 6
-#define UART0_SEL 6
-#define CLK_SRC_PERIL0_VAL ((PWM_SEL << 24)\
- | (UART5_SEL << 20) \
- | (UART4_SEL << 16) \
- | (UART3_SEL << 12) \
- | (UART2_SEL<< 8) \
- | (UART1_SEL << 4) \
- | (UART0_SEL))
-
-/* CLK_DIV_PERIL0 */
-#if defined(CONFIG_CLK_800_330_165) || defined(CONFIG_CLK_1000_330_165)
-#define UART5_RATIO 7
-#define UART4_RATIO 7
-#define UART3_RATIO 7
-#define UART2_RATIO 7
-#define UART1_RATIO 7
-#define UART0_RATIO 7
-#elif defined(CONFIG_CLK_1000_400_200) || defined(CONFIG_CLK_1000_200_200) || defined(CONFIG_CLK_800_400_200)
-#define UART5_RATIO 8
-#define UART4_RATIO 8
-#define UART3_RATIO 8
-#define UART2_RATIO 8
-#define UART1_RATIO 8
-#define UART0_RATIO 8
-#endif
-#define CLK_DIV_PERIL0_VAL ((UART5_RATIO << 20) \
- | (UART4_RATIO << 16) \
- | (UART3_RATIO << 12) \
- | (UART2_RATIO << 8) \
- | (UART1_RATIO << 4) \
- | (UART0_RATIO))
-
-#define MPLL_DEC (MPLL_MDIV * MPLL_MDIV / (MPLL_PDIV * 2^(MPLL_SDIV-1)))
-
-#define SCLK_UART MPLL_DEC/ (UART1_RATIO+1)
-#if defined(CONFIG_CLK_800_330_165) || defined(CONFIG_CLK_1000_330_165)
-#define UART_UBRDIV_VAL 0x2B/* (SCLK_UART/(115200*16) -1) */
-#define UART_UDIVSLOT_VAL 0xC /*((((SCLK_UART*10/(115200*16) -10))%10)*16/10)*/
-#elif defined(CONFIG_CLK_1000_400_200) || defined(CONFIG_CLK_1000_200_200) || defined(CONFIG_CLK_800_400_200)
-#define UART_UBRDIV_VAL 0x2F /* (SCLK_UART/(115200*16) -1) */
-#define UART_UDIVSLOT_VAL 0x3 /*((((SCLK_UART*10/(115200*16) -10))%10)*16/10)*/
-#endif
-
-#define UART_115200_IDIV UART_UBRDIV_VAL
-#define UART_115200_FDIV UART_UDIVSLOT_VAL
-
-#define UART_38400_IDIV UART_UBRDIV_VAL
-#define UART_38400_FDIV UART_UDIVSLOT_VAL
-
-#define UART_19200_IDIV UART_UBRDIV_VAL
-#define UART_19200_FDIV UART_UDIVSLOT_VAL
-
-#define UART_LCON_VAL 0x03
-#define UART_ECR_VAL 0x111
-#define UART_CR_VAL 0x3C5
-
-// Exynos4210 CMU Register definition
-#define CLK_SRC_LEFTBUS_OFFSET 0x04200
-#define CLK_DIV_LEFTBUS_OFFSET 0x04500
-
-#define CLK_SRC_RIGHTBUS_OFFSET 0x08200
-#define CLK_DIV_RIGHTBUS_OFFSET 0x08500
-
-#define EPLL_LOCK_OFFSET 0x0C010
-#define VPLL_LOCK_OFFSET 0x0C020
-#define EPLL_CON0_OFFSET 0x0C110
-#define EPLL_CON1_OFFSET 0x0C114
-#define VPLL_CON0_OFFSET 0x0C120
-#define VPLL_CON1_OFFSET 0x0C124
-
-#define CLK_SRC_TOP0_OFFSET 0x0C210
-#define CLK_SRC_TOP1_OFFSET 0x0C214
-#define CLK_SRC_PERIL0_OFFSET 0x0C250
-
-#define CLK_SRC_FSYS_OFFSET (0x0C240)
-#define CLK_DIV_FSYS1_OFFSET (0x0C544)
-#define CLK_DIV_FSYS2_OFFSET (0x0C548)
-#define CLK_DIV_FSYS3_OFFSET (0x0C54C)
-
-#define CLK_DIV_PERIL0_OFFSET 0x0C550
-#define CLK_DIV_TOP_OFFSET 0x0C510
-
-#define CLK_SRC_DMC_OFFSET 0x10200
-#define CLK_DIV_DMC0_OFFSET 0x10500
-#define CLK_DIV_DMC1_OFFSET 0x10504
-
-#define APLL_LOCK_OFFSET 0x14000
-#define MPLL_LOCK_OFFSET 0x14008
-#define APLL_CON0_OFFSET 0x14100
-#define APLL_CON1_OFFSET 0x14104
-#define MPLL_CON0_OFFSET 0x14108
-#define MPLL_CON1_OFFSET 0x1410C
-
-#define CLK_SRC_CPU_OFFSET 0x14200
-#define CLK_DIV_CPU0_OFFSET 0x14500
-#define CLK_DIV_CPU1_OFFSET 0x14504
-
-#define CLKGATE_IP_LCD0_OFFSET (0xC934)
-#define CLKSRC_LCD0_OFFSET (0xC234)
-#define CLKDIV_LCD0_OFFSET (0xC534)
-#define CLKSRC_MASK_LCD0_OFFSET (0xC334)
-
-#define FIMD0_SCLKMPLL (0x06)
-#define FIMD0_CLK_DIV (0x05)
-
-#define CLK_PPMULCD0_MASK (0x01 << 0x05)
-#define CLKGATE_FIMD0_MASK (0x01 << 0x00)
-#define CLKSRC_FIMD0_MASK (0x0F << 0x00)
-#define CLKDIV_FIMD0_MASK (0x0F << 0x00)
-
-#define CLKSRC_FIMD0_SEL(x) ((x) << 0x00)
-#define CLKDIV_FIMD0_SEL(x) ((x) << 0x00)
-#define FIMD0_UNMASK (0x01 << 0x00)
-
-#define CLK_DIV_FSYS2 (CLK_BASE + 0xC548)
-#define CLK_DIV_FSYS3 (CLK_BASE + 0xC54C)
-
-// Exynos4210 MIU Base Address
-#define Exynos4210_MIU_BASE 0x10600000
-
-#define MIU_INTLV_CONFIG 0x400
-#define MIU_INTLV_START_ADDR 0x808
-#define MIU_MAPPING_UPDATE 0x800
-#define MIU_INTLV_END_ADDR 0x810
-
-#define MIU_SINGLE_MAPPING0_START_ADDR 0x818
-#define MIU_SINGLE_MAPPING0_END_ADDR 0x820
-#define MIU_SINGLE_MAPPING1_START_ADDR 0x828
-#define MIU_SINGLE_MAPPING1_END_ADDR 0x830
-
-// Dynamic Memory C#define PWM_TIMER_Tontroller Base
-#define ARM_EB_DMC_BASE 0x10018000
-
-// Static Memory Controller Base
-#define ARM_EB_SMC_CTRL_BASE 0x10080000
-
-// System Configuration Controller register Base addresses
-#define SYS_DISPLAY_CONTROL_OFFSET (0x0210)
-#define FIMDBYPASS_LBLK0 (0x01 << 0x01)
-
-//FIMD register offsets
-#define VIDCON0_OFFSET (0x00)
-#define VIDCON1_OFFSET (0x0004) /* Video control 1 */
-#define VIDCON2_OFFSET (0x0008) /* Video control 2 */
-#define VIDTCON0_OFFSET (0x0010) /* Video time control 0 */
-#define VIDTCON1_OFFSET (0x0014) /* Video time control 1 */
-#define VIDTCON2_OFFSET (0x0018) /* Video time control 2 */
-#define WINSHMAP_OFFSET (0x0034) /* Window Shadow control */
-#define WINCON_OFFSET(x) (0x0020 + (x * 0x04))
-#define VIDOSD_A_OFFSET(x) (0x0040 + (x * 0x10))
-#define VIDOSD_B_OFFSET(x) (0x0044 + (x * 0x10))
-#define VIDOSD_C_OFFSET(x) (0x0048 + (x * 0x10))
-#define VIDADDR_START0_OFFSET(x)(0x00A0 + (x * 0x08))
-#define VIDADDR_END0_OFFSET(x) (0x00D0 + (x * 0x08))
-#define VIDADDR_SIZE_OFFSET(x) (0x0100 + (x * 0x04))
-/*******************************************
-// Interrupt Map
-*******************************************/
-
-// Timer Interrupts
-#define TIMER01_INTERRUPT_NUM 34
-#define TIMER23_INTERRUPT_NUM 35
-
-#define Exynos4210_INT_NUM(x) ((x) + 32)
-
-#define PWM_TIMER0_INTERRUPT_NUM Exynos4210_INT_NUM(37)
-#define PWM_TIMER1_INTERRUPT_NUM Exynos4210_INT_NUM(38)
-#define PWM_TIMER2_INTERRUPT_NUM Exynos4210_INT_NUM(39)
-#define PWM_TIMER3_INTERRUPT_NUM Exynos4210_INT_NUM(40)
-#define PWM_TIMER4_INTERRUPT_NUM Exynos4210_INT_NUM(41)
-
-/*******************************************
-// EFI Memory Map in Permanent Memory (DRAM)
-*******************************************/
-
-// This region is allocated at the bottom of the DRAM. It will be used
-// for fixed address allocations such as Vector Table
-#define ARM_EB_EFI_FIX_ADDRESS_REGION_SZ SIZE_8MB
-
-// This region is the memory declared to PEI as permanent memory for PEI
-// and DXE. EFI stacks and heaps will be declared in this region.
-#define ARM_EB_EFI_MEMORY_REGION_SZ 0x1000000
-
-//gpio definitions as required by the Embedded gpio module
-#define DISTANCE_BTWN_PORTS (0x20)
-
-#define GPIO_CON (0x00)
-#define GPIO_DATAIN (0x04)
-#define GPIO_PUD (0x08)
-#define GPIO_DRV (0x0C)
-
-#define GPIO_DATAIN_MASK(x) (1UL << (x))
-#define GPIO_PUD_MASK(x) (3UL << (x*2))
-#define GPIO_DRV_MASK(x) (3UL << (x*2))
-#define GPIO_SFN_MASK(x) (15UL <<(x*4))
-
-#define GPIO_SFN_EN(x) (2UL << (x*4))
-#define GPIO_OP_EN(x) (1UL << (x*4))
-
-#define GPIO_PUD_DIS(x) (0UL << (x*2))
-#define GPIO_PDN_EN(x) (1UL << (x*2))
-#define GPIO_PUP_EN(x) (3UL << (x*2))
-#define GPIO_DATA_HIGH(x) (1UL << (x))
-#define GPIO_DATA_LOW(x) (0UL << (x))
-
-#define GPIO_DRV_SET(strength,pin) (strength << (pin*2))
-
-#define PIN0 (0x00)
-#define PIN1 (0x01)
-#define PIN2 (0x02)
-#define PIN3 (0x03)
-#define PIN4 (0x04)
-#define PIN5 (0x05)
-#define PIN6 (0x06)
-#define PIN7 (0x07)
-
-#define GPA0 (0x00)
-#define GPA1 (0x01)
-#define GPB (0x02)
-#define GPC0 (0x03)
-#define GPC1 (0x04)
-#define GPD0 (0x05)
-#define GPD1 (0x06)
-#define GPE0 (0x07)
-#define GPE1 (0x08)
-#define GPE2 (0x09)
-#define GPE3 (0x0A)
-#define GPE4 (0x0B)
-#define GPF0 (0x0C)
-#define GPF1 (0x0D)
-#define GPF2 (0x0E)
-#define GPF3 (0x0F)
-#define GPJ0 (0x10)
-#define GPJ1 (0x11)
-#define GPK0 (0x12)
-#define GPK1 (0x13)
-#define GPK2 (0x14)
-#define GPK3 (0x15)
-#define GPL0 (0x16)
-#define GPL1 (0x17)
-#define GPL2 (0x18)
-#define GPX0 (0x19)
-#define GPX1 (0x1A)
-#define GPX2 (0x1B)
-#define GPX3 (0x1C)
-#define GPY (0x1D)
-#define GPZ (0x1E)
-
-/* LCD GPIO Pin Configurations*/
-#define LCD_HSYNC GPIO(GPF0,PIN0)
-#define LCD_VSYNC GPIO(GPF0,PIN1)
-#define LCD_VDEN GPIO(GPF0,PIN2)
-#define LCD_VCLK GPIO(GPF0,PIN3)
-#define LCD_VD_0 GPIO(GPF0,PIN4)
-#define LCD_VD_1 GPIO(GPF0,PIN5)
-#define LCD_VD_2 GPIO(GPF0,PIN6)
-#define LCD_VD_3 GPIO(GPF0,PIN7)
-
-#define LCD_VD_4 GPIO(GPF1,PIN0)
-#define LCD_VD_5 GPIO(GPF1,PIN1)
-#define LCD_VD_6 GPIO(GPF1,PIN2)
-#define LCD_VD_7 GPIO(GPF1,PIN3)
-#define LCD_VD_8 GPIO(GPF1,PIN4)
-#define LCD_VD_9 GPIO(GPF1,PIN5)
-#define LCD_VD_10 GPIO(GPF1,PIN6)
-#define LCD_VD_11 GPIO(GPF1,PIN7)
-
-#define LCD_VD_12 GPIO(GPF2,PIN0)
-#define LCD_VD_13 GPIO(GPF2,PIN1)
-#define LCD_VD_14 GPIO(GPF2,PIN2)
-#define LCD_VD_15 GPIO(GPF2,PIN3)
-#define LCD_VD_16 GPIO(GPF2,PIN4)
-#define LCD_VD_17 GPIO(GPF2,PIN5)
-#define LCD_VD_18 GPIO(GPF2,PIN6)
-#define LCD_VD_19 GPIO(GPF2,PIN7)
-
-#define LCD_VD_20 GPIO(GPF3,PIN0)
-#define LCD_VD_21 GPIO(GPF3,PIN1)
-#define LCD_VD_22 GPIO(GPF3,PIN2)
-#define LCD_VD_23 GPIO(GPF3,PIN3)
-#define VSYNC_LDI GPIO(GPF3,PIN4)
-#define SYS_OE GPIO(GPF3,PIN5)
-
-#define LCD_BACKLIGHT GPIO(GPD0,PIN1)
-
-/* SDHC GPIO Pin Configuration*/
-#define SD_2_CLK GPIO(GPK2,PIN0)
-#define SD_2_CMD GPIO(GPK2,PIN1)
-#define SD_2_CDn GPIO(GPK2,PIN2)
-#define SD_2_DATA0 GPIO(GPK2,PIN3)
-#define SD_2_DATA1 GPIO(GPK2,PIN4)
-#define SD_2_DATA2 GPIO(GPK2,PIN5)
-#define SD_2_DATA3 GPIO(GPK2,PIN6)
-
-#endif
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Protocol/ExynosGpio.h b/SamsungPlatformPkgOrigen/ExynosPkg/Include/Protocol/ExynosGpio.h
deleted file mode 100644
index 35fe93bf6..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Include/Protocol/ExynosGpio.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/** @file
-
- Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-
- 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 __EXYNOS_GPIO_H__
-#define __EXYNOS_GPIO_H__
-
-//
-// Protocol interface structure
-//
-typedef struct _EXYNOS_GPIO EXYNOS_GPIO;
-
-//
-// Data Types
-//
-typedef UINTN EXYNOS_GPIO_PIN;
-
-#define GPIO(Port, Pin) ((EXYNOS_GPIO_PIN)(((Port) << (16)) | (Pin)))
-#define GPIO_PIN(x) ((EXYNOS_GPIO_PIN)(x) & (0xFFFF))
-#define GPIO_PORT(x) ((EXYNOS_GPIO_PIN)(x) >> (16))
-
-typedef enum {
- GPIO_MODE_INPUT = 0x00,
- GPIO_MODE_OUTPUT_0 = 0x0E,
- GPIO_MODE_OUTPUT_1 = 0x0F,
- GPIO_MODE_SPECIAL_FUNCTION_2 = 0x02,
- GPIO_MODE_SPECIAL_FUNCTION_3 = 0x03,
- GPIO_MODE_SPECIAL_FUNCTION_4 = 0x04,
- GPIO_MODE_SPECIAL_FUNCTION_5 = 0x05,
- GPIO_MODE_SPECIAL_FUNCTION_6 = 0x06,
- GPIO_MODE_SPECIAL_FUNCTION_7 = 0x07
-} EXYNOS_GPIO_MODE;
-
-typedef enum {
- GPIO_PULL_NONE,
- GPIO_PULL_UP,
- GPIO_PULL_DOWN
-} EXYNOS_GPIO_PULL;
-
-typedef enum {
- GPIO_DRV_1X,
- GPIO_DRV_2X,
- GPIO_DRV_3X,
- GPIO_DRV_4X
-} EXYNOS_GPIO_STRN;
-
-//
-// Function Prototypes
-//
-typedef
-EFI_STATUS
-(EFIAPI *EXYNOS_GPIO_GET) (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- OUT UINTN *Value
- );
-/*++
-
-Routine Description:
-
- Gets the state of a GPIO pin
-
-Arguments:
-
- This - pointer to protocol
- Gpio - which pin to read
- Value - state of the pin
-
-Returns:
-
- EFI_SUCCESS - GPIO state returned in Value
-
---*/
-
-
-typedef
-EFI_STATUS
-(EFIAPI *EXYNOS_GPIO_SET) (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_MODE Mode
- );
-/*++
-
-Routine Description:
-
- Sets the state of a GPIO pin
-
-Arguments:
-
- This - pointer to protocol
- Gpio - which pin to modify
- Mode - mode to set
-
-Returns:
-
- EFI_SUCCESS - GPIO set as requested
-
---*/
-
-
-typedef
-EFI_STATUS
-(EFIAPI *EXYNOS_GPIO_GET_MODE) (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- OUT EXYNOS_GPIO_MODE *Mode
- );
-/*++
-
-Routine Description:
-
- Gets the mode (function) of a GPIO pin
-
-Arguments:
-
- This - pointer to protocol
- Gpio - which pin
- Mode - pointer to output mode value
-
-Returns:
-
- EFI_SUCCESS - mode value retrieved
-
---*/
-
-
-typedef
-EFI_STATUS
-(EFIAPI *EXYNOS_GPIO_SET_PULL) (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_PULL Direction
- );
-/*++
-
-Routine Description:
-
- Sets the pull-up / pull-down resistor of a GPIO pin
-
-Arguments:
-
- This - pointer to protocol
- Gpio - which pin
- Direction - pull-up, pull-down, or none
-
-Returns:
-
- EFI_SUCCESS - pin was set
-
---*/
-
-typedef EFI_STATUS
-(EFIAPI *EXYNOS_GPIO_DRV) (
- IN EXYNOS_GPIO *This,
- IN EXYNOS_GPIO_PIN Gpio,
- IN EXYNOS_GPIO_STRN Strength
- );
-/*++
-
-Routine Description:
-
- Sets the Driving strength resistor of a GPIO pin
-
-Arguments:
-
- This - pointer to protocol
- Gpio - which pin
- Strength - 0=1x,1=2x,2=3x,3=4x
-
-Returns:
-
- EFI_SUCCESS - pin was set
-
---*/
-
-
-
-struct _EXYNOS_GPIO {
- EXYNOS_GPIO_GET Get;
- EXYNOS_GPIO_SET Set;
- EXYNOS_GPIO_GET_MODE GetMode;
- EXYNOS_GPIO_SET_PULL SetPull;
- EXYNOS_GPIO_DRV SetStrength;
-};
-
-extern EFI_GUID gSamsungPlatformGpioProtocolGuid;
-
-#endif
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.c b/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.c
deleted file mode 100644
index a1e1799f0..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <Base.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Platform/ArmPlatform.h>
-
-UINT32
-GpioBase (
- IN UINTN Port
- )
-{
-
- ASSERT( (Port >= GPA0) && (Port <= GPZ));
-
- /*decide which part of gpio is being requested. give the corresponding base address*/
- if(Port & 0x10) {
- return (PcdGet32(PcdGpioPart2Base) + (Port*DISTANCE_BTWN_PORTS));
- }else {
- return (PcdGet32(PcdGpioPart1Base) + (Port*DISTANCE_BTWN_PORTS));
- }
-
- ASSERT(FALSE); return 0;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
deleted file mode 100644
index be92d99ce..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
+++ /dev/null
@@ -1,40 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = ExynosLib
- FILE_GUID = d035f5c2-1b92-4746-9f6c-5ff6202970df
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ExynosLib
-
-[Sources.common]
- ExynosLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-
-[LibraryClasses]
- DebugLib
- IoLib
-
-[Protocols]
-
-[Guids]
-
-[Pcd]
- gExynosPkgTokenSpaceGuid.PcdGpioPart1Base
- gExynosPkgTokenSpaceGuid.PcdGpioPart2Base
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.c b/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.c
deleted file mode 100644
index 353cad11e..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
- Basic serial IO abstaction for GDB
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <Uefi.h>
-#include <Library/GdbSerialLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Platform/ArmPlatform.h>
-
-RETURN_STATUS
-EFIAPI
-GdbSerialLibConstructor (
- VOID
- )
-{
- return GdbSerialInit (115200, 0, 8, 1);
-}
-
-RETURN_STATUS
-EFIAPI
-GdbSerialInit (
- IN UINT64 BaudRate,
- IN UINT8 Parity,
- IN UINT8 DataBits,
- IN UINT8 StopBits
- )
-{
- if ((Parity != 0) || (DataBits != 8) || (StopBits != 1)) {
- return RETURN_UNSUPPORTED;
- }
-
- if (BaudRate != 115200) {
- // Could add support for different Baud rates....
- return RETURN_UNSUPPORTED;
- }
-
- UINT32 Base = PcdGet32 (PcdGdbUartBase);
-
- // initialize baud rate generator to 115200 based on EB clock REFCLK24MHZ
- MmioWrite32 (Base + UARTIBRD, UART_115200_IDIV);
- MmioWrite32 (Base + UARTFBRD, UART_115200_FDIV);
-
- // no parity, 1 stop, no fifo, 8 data bits
- MmioWrite32 (Base + UARTLCR_H, 0x60);
-
- // clear any pending errors
- MmioWrite32 (Base + UARTECR, 0);
-
- // enable tx, rx, and uart overall
- MmioWrite32 (Base + UARTCR, 0x301);
-
- return RETURN_SUCCESS;
-}
-
-BOOLEAN
-EFIAPI
-GdbIsCharAvailable (
- VOID
- )
-{
- UINT32 FR = PcdGet32 (PcdGdbUartBase) + UTRSTAT_OFFSET;
-
- if ((MmioRead32 (FR) & UART_RX_EMPTY_FLAG_MASK) == 0) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-CHAR8
-EFIAPI
-GdbGetChar (
- VOID
- )
-{
- UINT32 FR = PcdGet32 (PcdGdbUartBase) + UTRSTAT_OFFSET;
- UINT32 DR = PcdGet32 (PcdGdbUartBase) + URXH_OFFSET;
-
- while ((MmioRead32 (FR) & UART_RX_EMPTY_FLAG_MASK) == 0);
- return MmioRead8 (DR);
-}
-
-VOID
-EFIAPI
-GdbPutChar (
- IN CHAR8 Char
- )
-{
- UINT32 FR = PcdGet32 (PcdGdbUartBase) + UTRSTAT_OFFSET;
- UINT32 DR = PcdGet32 (PcdGdbUartBase) + UTXH_OFFSET;
-
- while ((MmioRead32 (FR) & UART_TX_EMPTY_FLAG_MASK) != 0);
- MmioWrite8 (DR, Char);
- return;
-}
-
-VOID
-GdbPutString (
- IN CHAR8 *String
- )
-{
- while (*String != '\0') {
- GdbPutChar (*String);
- String++;
- }
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf
deleted file mode 100644
index 2e41b7049..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf
+++ /dev/null
@@ -1,40 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = GdbSerialLib
- FILE_GUID = E8EA1309-2F14-428f-ABE3-7016CE4B4305
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = GdbSerialLib
-
- CONSTRUCTOR = GdbSerialLibConstructor
-
-
-[Sources.common]
- GdbSerialLib.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
-
-
-[LibraryClasses]
- DebugLib
- IoLib
-
-[FixedPcd]
- gExynosPkgTokenSpaceGuid.PcdGdbUartBase
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.c b/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.c
deleted file mode 100644
index daaa1299c..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/** @file
- Template library implementation to support ResetSystem Runtime call.
-
- Fill in the templates with what ever makes you system reset.
-
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <PiDxe.h>
-
-#include <Library/ArmLib.h>
-#include <Library/BaseLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Library/DebugLib.h>
-#include <Library/EfiResetSystemLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/CacheMaintenanceLib.h>
-#include <Platform/ArmPlatform.h>
-
-VOID DestroyExynosMemMap(VOID);
-typedef VOID (EFIAPI *CALL_STUB)(VOID);
-
-VOID
-DestroyExynosMemMap (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN MemoryMapSize;
- EFI_MEMORY_DESCRIPTOR *MemoryMap;
- UINTN MapKey;
- UINTN DescriptorSize;
- UINTN DescriptorVersion;
- UINTN Pages;
-
- MemoryMap = NULL;
- MemoryMapSize = 0;
- do {
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- if (Status == EFI_BUFFER_TOO_SMALL) {
-
- Pages = EFI_SIZE_TO_PAGES (MemoryMapSize) + 1;
- MemoryMap = AllocatePages (Pages);
-
- //
- // Get System MemoryMap
- //
- Status = gBS->GetMemoryMap (
- &MemoryMapSize,
- MemoryMap,
- &MapKey,
- &DescriptorSize,
- &DescriptorVersion
- );
- // Don't do anything between the GetMemoryMap() and ExitBootServices()
- if (!EFI_ERROR (Status)) {
- Status = gBS->ExitBootServices (gImageHandle, MapKey);
- if (EFI_ERROR (Status)) {
- FreePages (MemoryMap, Pages);
- MemoryMap = NULL;
- MemoryMapSize = 0;
- }
- }
- }
- } while (EFI_ERROR (Status));
-
- //Clean and invalidate caches.
- WriteBackInvalidateDataCache();
- InvalidateInstructionCache();
-
- //Turning off Caches and MMU
- ArmDisableDataCache ();
- ArmDisableInstructionCache ();
- ArmDisableMmu ();
-}
-
-
-
-/**
- Resets the entire platform.
-
- @param ResetType The type of reset to perform.
- @param ResetStatus The status code for the reset.
- @param DataSize The size, in bytes, of WatchdogData.
- @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
- EfiResetShutdown the data buffer starts with a Null-terminated
- Unicode string, optionally followed by additional binary data.
-
-**/
-EFI_STATUS
-EFIAPI
-LibResetSystem (
- IN EFI_RESET_TYPE ResetType,
- IN EFI_STATUS ResetStatus,
- IN UINTN DataSize,
- IN CHAR16 *ResetData OPTIONAL
- )
-{
- CALL_STUB StartOfFv;
- UINTN PmuBase;
- if (ResetData != NULL) {
- DEBUG ((EFI_D_ERROR, "%s", ResetData));
- }
-
- DestroyExynosMemMap();
-
- switch (ResetType) {
- case EfiResetWarm:
- //Perform warm reset of the system by jumping to the begining of the FV
-// ((ptrImageStart)PcdGet32(PcdFvBaseAddress))();
- StartOfFv = (CALL_STUB)(UINTN)PcdGet32(PcdFvBaseAddress);
- StartOfFv ();
- break;
- case EfiResetCold:
- case EfiResetShutdown:
- default:
- //Perform cold reset of the system.
- PmuBase = (UINTN)PcdGet32(PcdPmuBase);
- MmioWrite32 ((PmuBase + SWRESET_OFFSET), 0x01);
- while ((MmioRead32(PmuBase + SWRESET_OFFSET)) != 0x1);
- break;
- }
-
- // If the reset didn't work, return an error.
- ASSERT (FALSE);
- return EFI_DEVICE_ERROR;
-}
-
-
-
-/**
- Initialize any infrastructure required for LibResetSystem () to function.
-
- @param ImageHandle The firmware allocated handle for the EFI image.
- @param SystemTable A pointer to the EFI System Table.
-
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
-
-**/
-EFI_STATUS
-EFIAPI
-LibInitializeResetSystem (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- return EFI_SUCCESS;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf
deleted file mode 100644
index 7b363d027..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf
+++ /dev/null
@@ -1,44 +0,0 @@
-#/** @file
-# Reset System lib to make it easy to port new platforms
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-#
-# 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 = ArmEbResetSystemLib
- FILE_GUID = CEFFA65C-B568-453e-9E11-B81AE683D035
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = EfiResetSystemLib
-
-
-[Sources.common]
- ResetSystemLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-[LibraryClasses]
- ArmLib
- IoLib
- BaseLib
- DebugLib
- MemoryAllocationLib
- CacheMaintenanceLib
-[FixedPcd]
- gArmTokenSpaceGuid.PcdFvBaseAddress
-[Pcd]
- gExynosPkgTokenSpaceGuid.PcdPmuBase
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.c b/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.c
deleted file mode 100644
index 548330e61..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.c
+++ /dev/null
@@ -1,150 +0,0 @@
-/** @file
- Serial I/O Port library functions with no library constructor/destructor
-
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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/Uefi.h>
-#include <Library/SerialPortLib.h>
-#include <Library/SerialPortExtLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Platform/ArmPlatform.h>
-
-/*
-
- Programmed hardware of Serial port.
- Irrespective of the previous settings Initialize it to current requirement
-**/
-RETURN_STATUS
-EFIAPI
-SerialPortInitialize (
- VOID
- )
-{
-#if 0
- UINT32 UARTConsoleBase;
- UINT32 SmdkCmuBase;
-
- UARTConsoleBase=PcdGet32(PcdConsoleUartBase);
- SmdkCmuBase=PcdGet32(PcdCmuBase);
-
- MmioWrite32 (SmdkCmuBase + CLK_SRC_PERIL0_OFFSET, CLK_SRC_PERIL0_VAL);
- MmioWrite32 (SmdkCmuBase + CLK_DIV_PERIL0_OFFSET, CLK_DIV_PERIL0_VAL);
-
- if (PL011_CONSOLE_UART_SPEED == 115200) {
- // Initialize baud rate generator
- MmioWrite32 (UARTConsoleBase + UARTIBRD, UART_115200_IDIV);
- MmioWrite32 (UARTConsoleBase + UARTFBRD, UART_115200_FDIV);
- } else if (PL011_CONSOLE_UART_SPEED == 38400) {
- // Initialize baud rate generator
- MmioWrite32 (UARTConsoleBase + UARTIBRD, UART_38400_IDIV);
- MmioWrite32 (UARTConsoleBase + UARTFBRD, UART_38400_FDIV);
- } else if (PL011_CONSOLE_UART_SPEED == 19200) {
- // Initialize baud rate generator
- MmioWrite32 (UARTConsoleBase + UARTIBRD, UART_19200_IDIV);
- MmioWrite32 (UARTConsoleBase + UARTFBRD, UART_19200_FDIV);
- } else {
- return EFI_INVALID_PARAMETER;
- }
-
- // No parity, 1 stop, no fifo, 8 data bits
- MmioWrite32 (UARTConsoleBase + UARTLCR_H, UART_LCON_VAL);
-
- // configure FIFO contrl regs
- MmioWrite32 (UARTConsoleBase + UARTECR, UART_ECR_VAL);
-
- // enable tx, rx, and uart overall
- MmioWrite32 (UARTConsoleBase + UARTCR, UART_CR_VAL);
-#endif
- return EFI_SUCCESS;
-}
-
-/**
- Write data to serial device.
-
- @param Buffer Point of data buffer which need to be writed.
- @param NumberOfBytes Number of output bytes which are cached in Buffer.
-
- @retval 0 Write data failed.
- @retval !0 Actual number of bytes writed to serial device.
-
-**/
-UINTN
-EFIAPI
-SerialPortWrite (
- IN UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
-{
- UINTN Count;
- UINT32 UARTConsoleBase;
-
- UARTConsoleBase=PcdGet32(PcdConsoleUartBase);
- for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
- while ((MmioRead32 (UARTConsoleBase + UTRSTAT_OFFSET) & UART_TX_EMPTY_FLAG_MASK) == 0);
- MmioWrite8 (UARTConsoleBase + UTXH_OFFSET, *Buffer);
- }
-
- return NumberOfBytes;
-}
-
-/**
- Read data from serial device and save the datas in buffer.
-
- @param Buffer Point of data buffer which need to be writed.
- @param NumberOfBytes Number of output bytes which are cached in Buffer.
-
- @retval 0 Read data failed.
- @retval !0 Aactual number of bytes read from serial device.
-
-**/
-UINTN
-EFIAPI
-SerialPortRead (
- OUT UINT8 *Buffer,
- IN UINTN NumberOfBytes
-)
-{
- UINTN Count;
- UINT32 UARTConsoleBase;
-
- UARTConsoleBase=PcdGet32(PcdConsoleUartBase);
- for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
- while ((MmioRead32 (UARTConsoleBase + UTRSTAT_OFFSET) & UART_RX_EMPTY_FLAG_MASK) == 0);
- *Buffer = MmioRead8 (UARTConsoleBase + URXH_OFFSET);
- }
-
- return NumberOfBytes;
-}
-
-/**
- Check to see if any data is avaiable to be read from the debug device.
-
- @retval EFI_SUCCESS At least one byte of data is avaiable to be read
- @retval EFI_NOT_READY No data is avaiable to be read
- @retval EFI_DEVICE_ERROR The serial device is not functioning properly
-
-**/
-BOOLEAN
-EFIAPI
-SerialPortPoll (
- VOID
- )
-{
- UINT32 UARTConsoleBase;
- UARTConsoleBase=PcdGet32(PcdConsoleUartBase);
-
- return ((MmioRead32 (UARTConsoleBase + UTRSTAT_OFFSET) & UART_RX_EMPTY_FLAG_MASK) != 0);
-}
-
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf
deleted file mode 100644
index 73349aa70..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf
+++ /dev/null
@@ -1,38 +0,0 @@
-#/** @file
-#
-# Component discription file for NorFlashDxe module
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = SerialPortLib
- FILE_GUID = 8ecefc8f-a2c4-4091-b80f-20f7aeb0567f
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = SerialPortLib
-
-[Sources.common]
- SerialPortLib.c
-
-[LibraryClasses]
- IoLib
-
-[Packages]
- EmbeddedPkg/EmbeddedPkg.dec
- MdePkg/MdePkg.dec
- # ArmPlatformPkg/ArmPlatformPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-
-[FixedPcd]
- gExynosPkgTokenSpaceGuid.PcdConsoleUartBase
- gExynosPkgTokenSpaceGuid.PcdCmuBase
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.c b/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.c
deleted file mode 100755
index 6baf2cec6..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/** @file
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <Base.h>
-
-#include <Library/BaseLib.h>
-#include <Library/TimerLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-#include <Platform/ArmPlatform.h>
-#include <Library/ExynosTimerLib.h>
-
-
-// Setup SP810's Timer2 for managing delay functions. And Timer3 for Performance counter
-// Note: ArmVE's Timer0 and Timer1 are used by TimerDxe.
-RETURN_STATUS
-EFIAPI
-TimerConstructor (
- VOID
- )
-{
- UINT32 PWMTimerBase;
- UINT32 rwVal;
-
- PWMTimerBase = PcdGet32(PcdPWMTimerBase);
-
-/**
- This function is for initializing for PWM Timer
- Timer 2 = > Delay Counter
- Timer 3 = > Performance Counter
-**/
-// PWM Input Clock(ACLK_100) is 100 Mhz so We need to prescale about 1Mhz to make udelay function
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCFG0_OFFSET);
- rwVal &= ~(0xFF << PRESCALE_GRP1_START_POS);
- rwVal |= (PRESCALE_TIMER_GRP1 << PRESCALE_GRP1_START_POS);
- MmioWrite32 ((PWMTimerBase + PWM_TCFG0_OFFSET), rwVal);
- MmioWrite32 ((PWMTimerBase + PWM_TCFG1_OFFSET), 0x0);
-
-// PWM Timer INT disable
- rwVal = MmioRead32 (PWMTimerBase + PWM_TINT_CSTAT_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET), rwVal & ~(TIMER_INTR_MASK(TIMER_2) | TIMER_INTR_MASK(TIMER_3)));
-
-// PWM Timer 2,3 make to stop
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & (STOP_TIMER_VAL(TIMER_2) | STOP_TIMER_VAL(TIMER_3)));
-
-// PWM Timer 3 used by Free running counter with Auto re-load mode
- MmioWrite32 ((PWMTimerBase + PWM_TCNTB3_OFFSET), MAX_COUNT_VAL);
-// Set and Clear PWM Manually update for Timer 3
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | UPDATE_COUNT_BUF_MASK(TIMER_3));
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & ~UPDATE_COUNT_BUF_MASK(TIMER_3));
-// Set Auto re-load and start Timer
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | RELOAD_AND_START(TIMER_3));
-
- DEBUG ((EFI_D_ERROR, "Timer 2,3 Enabled\n"));
-
- return RETURN_SUCCESS;
-}
-
-/**
- Stalls the CPU for at least the given number of microseconds.
-
- Stalls the CPU for the number of microseconds specified by MicroSeconds.
-
- @param MicroSeconds The minimum number of microseconds to delay.
-
- @return The value of MicroSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-MicroSecondDelay (
- IN UINTN MicroSeconds
- )
-{
- UINT32 rwVal;
- UINT32 PWMTimerBase;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- // load the timer count register
- MmioWrite32 ((PWMTimerBase + PWM_TCNTB2_OFFSET), MicroSeconds);
-
-
-// PWM Timer 2 stop
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & STOP_TIMER_VAL(TIMER_2));
-
-// Set and Clear PWM Manually update for Timer 2
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | UPDATE_COUNT_BUF_MASK(TIMER_2));
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & ~UPDATE_COUNT_BUF_MASK(TIMER_2));
- //Start Timer 2
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | START_TIMER(TIMER_2));
- //Wait for requested delay time
- while (MmioRead32 (PWMTimerBase + PWM_TCNTO2_OFFSET) > 0) {
- ;
- }
-
- return MicroSeconds;
-}
-
-/**
- Stalls the CPU for at least the given number of nanoseconds.
-
- Stalls the CPU for the number of nanoseconds specified by NanoSeconds.
-
- @param NanoSeconds The minimum number of nanoseconds to delay.
-
- @return The value of NanoSeconds inputted.
-
-**/
-UINTN
-EFIAPI
-NanoSecondDelay (
- IN UINTN NanoSeconds
- )
-{
- UINT32 MicroSeconds;
- UINT32 rwVal;
- UINT32 PWMTimerBase;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
-
- // Round up to 1us Tick Number
- MicroSeconds = (UINT32)NanoSeconds / 1000;
- MicroSeconds += ((UINT32)NanoSeconds % 1000) == 0 ? 0 : 1;
- // load the timer count register
- MmioWrite32 ((PWMTimerBase + PWM_TCNTB2_OFFSET), MicroSeconds);
-
-// PWM Timer 2 stop
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & STOP_TIMER_VAL(TIMER_2));
-// Set and Clear PWM Manually update for Timer 2
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | UPDATE_COUNT_BUF_MASK(TIMER_2));
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & ~UPDATE_COUNT_BUF_MASK(TIMER_2));
- //Start Timer 2
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | START_TIMER(TIMER_2));
-
- //Wait for requested delay time
- while (MmioRead32 (PWMTimerBase + PWM_TCNTO0_OFFSET) > 0) {
- ;
- }
-
- return NanoSeconds;
-}
-
-/**
- Retrieves the current value of a 64-bit free running performance counter.
-
- The counter can either count up by 1 or count down by 1. If the physical
- performance counter counts by a larger increment, then the counter values
- must be translated. The properties of the counter can be retrieved from
- GetPerformanceCounterProperties().
-
- @return The current value of the free running performance counter.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounter (
- VOID
- )
-{
- UINT32 PWMTimerBase;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- // Free running 64-bit/32-bit counter is needed here.
- // Don't think we need this to boot, just to do performance profile
- // ASSERT (FALSE);
- UINT32 val = MmioRead32 (PWMTimerBase + PWM_TCNTO3_OFFSET);
-
- ASSERT(val > 0);
-
- return (UINT64)val;
-}
-
-
-/**
- Retrieves the 64-bit frequency in Hz and the range of performance counter
- values.
-
- If StartValue is not NULL, then the value that the performance counter starts
- with immediately after is it rolls over is returned in StartValue. If
- EndValue is not NULL, then the value that the performance counter end with
- immediately before it rolls over is returned in EndValue. The 64-bit
- frequency of the performance counter in Hz is always returned. If StartValue
- is less than EndValue, then the performance counter counts up. If StartValue
- is greater than EndValue, then the performance counter counts down. For
- example, a 64-bit free running counter that counts up would have a StartValue
- of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter
- that counts down would have a StartValue of 0xFFFFFF and an EndValue of 0.
-
- @param StartValue The value the performance counter starts with when it
- rolls over.
- @param EndValue The value that the performance counter ends with before
- it rolls over.
-
- @return The frequency in Hz.
-
-**/
-UINT64
-EFIAPI
-GetPerformanceCounterProperties (
- OUT UINT64 *StartValue, OPTIONAL
- OUT UINT64 *EndValue OPTIONAL
- )
-{
- if (StartValue != NULL) {
- // Timer starts with the reload value
- *StartValue = (UINT64)0ULL;
- }
-
- if (EndValue != NULL) {
- // Timer counts up to 0xFFFFFFFF
- *EndValue = 0xFFFFFFFF;
- }
-
- return 1000000;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf b/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf
deleted file mode 100755
index b62a797e1..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf
+++ /dev/null
@@ -1,41 +0,0 @@
-#/** @file
-# Timer library implementation
-#
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = Exynos4210TimerLib
- FILE_GUID = 34cfa85e-a798-4e46-8d38-1843d7a0caea
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = TimerLib
-
- CONSTRUCTOR = TimerConstructor
-
-[Sources.common]
- TimerLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-
-[LibraryClasses]
- DebugLib
- IoLib
- BaseLib
-
-[Pcd.common]
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.c b/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.c
deleted file mode 100755
index 064a1d158..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.c
+++ /dev/null
@@ -1,1327 +0,0 @@
-/** @file
- MMC/SD Card driver for Secure Digital Host Controller
-
- This driver always produces a BlockIo protocol but it starts off with no Media
- present. A TimerCallBack detects when media is inserted or removed and after
- a media change event a call to BlockIo ReadBlocks/WriteBlocks will cause the
- media to be detected (or removed) and the BlockIo Media structure will get
- updated. No MMC/SD Card harward registers are updated until the first BlockIo
- ReadBlocks/WriteBlocks after media has been insterted (booting with a card
- plugged in counts as an insertion event).
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <Library/TimerLib.h>
-#include <Library/PcdLib.h>
-#include <Protocol/ExynosGpio.h>
-#include <Platform/ArmPlatform.h>
-
-#include "SDHCDxe.h"
-
-
-EFI_BLOCK_IO_MEDIA gSDHCMedia = {
- SIGNATURE_32('s','d','h','c'), // MediaId
- TRUE, // RemovableMedia
- FALSE, // MediaPresent
- FALSE, // LogicalPartition
- FALSE, // ReadOnly
- FALSE, // WriteCaching
- 512, // BlockSize
- 4, // IoAlign
- 0, // Pad
- 0 // LastBlock
-};
-
-typedef struct {
- VENDOR_DEVICE_PATH Mmc;
- EFI_DEVICE_PATH End;
-} SDHC_DEVICE_PATH;
-
-SDHC_DEVICE_PATH gSDHCDevicePath = {
- {
- HARDWARE_DEVICE_PATH,
- HW_VENDOR_DP,
- (UINT8)(sizeof(VENDOR_DEVICE_PATH)),
- (UINT8)((sizeof(VENDOR_DEVICE_PATH)) >> 8),
- 0xb615f1f5, 0x5088, 0x43cd, 0x80, 0x9c, 0xa1, 0x6e, 0x52, 0x48, 0x7d, 0x00
- },
- {
- END_DEVICE_PATH_TYPE,
- END_ENTIRE_DEVICE_PATH_SUBTYPE,
- sizeof (EFI_DEVICE_PATH_PROTOCOL),
- 0
- }
-};
-
-CARD_INFO gCardInfo;
-EFI_EVENT gTimerEvent;
-BOOLEAN gMediaChange = FALSE;
-
-//
-// Internal Functions
-//
-
-
-VOID
-ParseCardCIDData (
- UINT32 Response0,
- UINT32 Response1,
- UINT32 Response2,
- UINT32 Response3
- )
-{
- gCardInfo.CIDData.MDT = ((Response0 >> 8) & 0xFFF);
- gCardInfo.CIDData.PSN = (((Response0 >> 24) & 0xFF) | ((Response1 & 0xFFFFFF) << 8));
- gCardInfo.CIDData.PRV = ((Response1 >> 24) & 0xFF);
- gCardInfo.CIDData.PNM[4] = ((Response2) & 0xFF);
- gCardInfo.CIDData.PNM[3] = ((Response2 >> 8) & 0xFF);
- gCardInfo.CIDData.PNM[2] = ((Response2 >> 16) & 0xFF);
- gCardInfo.CIDData.PNM[1] = ((Response2 >> 24) & 0xFF);
- gCardInfo.CIDData.PNM[0] = ((Response3) & 0xFF);
- gCardInfo.CIDData.OID = ((Response3 >> 8) & 0xFFFF);
- gCardInfo.CIDData.MID = ((Response3 >> 24) & 0xFF);
-}
-
-
-VOID
-UpdateSDHCClkFrequency (
- UINTN NewCLK
- )
-{
- UINT32 CumBaseAddr;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- // Disable all clocks to not provide the clock to the card
- MmioAnd32 ((SdMmcBaseAddr + CLKCON_OFFSET), ~(0xF));
-
- CumBaseAddr = PcdGet32(PcdCmuBase);
- //Set new clock frequency.
- if (NewCLK == 400)
- MmioAndThenOr32 ((CumBaseAddr + CLK_DIV_FSYS2_OFFSET), ~(0xFFFF), 0xE008);
- else if (NewCLK == 25000)
- MmioAndThenOr32 ((CumBaseAddr + CLK_DIV_FSYS2_OFFSET), ~(0xFFFF), 0x0307);
-
- MmioOr32 ((SdMmcBaseAddr + CLKCON_OFFSET), ICE);
-
- //Poll till Internal Clock Stable
- while ((MmioRead32 ((SdMmcBaseAddr + CLKCON_OFFSET)) & ICS) != ICS);
-
- //Set Clock enable to 0x1 to provide the clock to the card
- MmioOr32 ((SdMmcBaseAddr + CLKCON_OFFSET), CCE);
-}
-
-VOID
-PrepareTransfer (
- UINTN Direction, UINTN BlockCount
- )
-{
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- //Set Block Size and Block count.
- MmioWrite32 ((SdMmcBaseAddr + BLKSIZE_OFFSET), BLEN_512BYTES | (BlockCount << 16));
-
- //Setting Data timeout counter value to max value.
- MmioAndThenOr32 ((SdMmcBaseAddr + TIMEOUTCON_OFFSET), ~(0xFF << 16), 0xE << 16);
-}
-
-EFI_STATUS
-SendCmd (
- UINTN Cmd,
- UINTN CmdInterruptEnableVal,
- UINTN CmdArgument
- )
-{
- UINTN MmcStatus;
- UINTN RetryCount = 0;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- //Check if command line is in use or not. Poll till command line is available.
- while (MmioRead32 ((SdMmcBaseAddr + PRNSTS_OFFSET)) & (CMDINHCMD | CMDINHDAT));
- //Clear Status register.
- MmioWrite32 ((SdMmcBaseAddr + INTSTS_OFFSET), 0xFFFFFFFF);
-
- //Set command argument register
- MmioWrite32 ((SdMmcBaseAddr + ARGUMENT_OFFSET), CmdArgument);
-
- //Enable interrupt enable events to occur
- MmioWrite32 ((SdMmcBaseAddr + INTEN_OFFSET), CmdInterruptEnableVal);
-
- DEBUG ((EFI_D_INFO, "SDHC::SendCmd : CMD = %d\n", (Cmd >> 24) & 0x3F));
-
- MmioAndThenOr32 ((SdMmcBaseAddr + TIMEOUTCON_OFFSET), ~(0xFF << 16), 0xE << 16);
- MicroSecondDelay(1);
- //Send a command
- MmioWrite32 ((SdMmcBaseAddr + CMDREG_OFFSET), Cmd);
- MicroSecondDelay(1);
-
- //Check for the command status.
- while (RetryCount < MAX_RETRY_COUNT) {
- do {
- MmcStatus = MmioRead32 ((SdMmcBaseAddr + INTSTS_OFFSET));
- } while (MmcStatus == 0);
-
- //Read status of command response
- if ((MmcStatus & ERRINT) != 0) {
-
- //Perform soft-reset for cmd line.
- MmioOr32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET), SRC);
- while ((MmioRead32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET)) & SRC));
-
- DEBUG ((EFI_D_INFO, "MmcStatus: %x\n", MmcStatus));
- return EFI_DEVICE_ERROR;
- }
-
- //Check if command is completed.
- if ((MmcStatus & CMDCOMP) == CMDCOMP) {
- MmioWrite32 ((SdMmcBaseAddr + INTSTS_OFFSET), CMDCOMP);
- break;
- }
-
- RetryCount++;
- }
-
- if (RetryCount == MAX_RETRY_COUNT) {
- return EFI_TIMEOUT;
- }
-
- return EFI_SUCCESS;
-}
-
-
-VOID
-GetBlockInformation (
- UINTN *BlockSize,
- UINTN *NumBlocks
- )
-{
- CSD_SDV2 *CsdSDV2Data;
- UINTN CardSize;
-
- if (gCardInfo.CardType == SD_CARD_2_HIGH) {
- CsdSDV2Data = (CSD_SDV2 *)&gCardInfo.CSDData;
-
- //Populate BlockSize.
- *BlockSize = (0x1UL << CsdSDV2Data->READ_BL_LEN);
-
- //Calculate Total number of blocks.
- CardSize = CsdSDV2Data->C_SIZELow16 | (CsdSDV2Data->C_SIZEHigh6 << 2);
- *NumBlocks = ((CardSize + 1) * 1024);
- } else {
- //Populate BlockSize.
- *BlockSize = (0x1UL << gCardInfo.CSDData.READ_BL_LEN);
-
- //Calculate Total number of blocks.
- CardSize = gCardInfo.CSDData.C_SIZELow2 | (gCardInfo.CSDData.C_SIZEHigh10 << 2);
- *NumBlocks = (CardSize + 1) * (1 << (gCardInfo.CSDData.C_SIZE_MULT + 2));
- }
-
- //For >=2G card, BlockSize may be 1K, but the transfer size is 512 bytes.
- if (*BlockSize > 512) {
- *NumBlocks = MultU64x32(*NumBlocks, *BlockSize/2);
- *BlockSize = 512;
- }
-
- DEBUG ((EFI_D_ERROR, "Card type: 0x%x, BlockSize: 0x%x, NumBlocks: 0x%x\n", gCardInfo.CardType, *BlockSize, *NumBlocks));
-}
-
-
-VOID
-CalculateCardCLKD (
- UINTN *ClockFrequencySelect
- )
-{
- UINT8 MaxDataTransferRate;
- UINTN TransferRateValue = 0;
- UINTN TimeValue = 0 ;
- UINTN Frequency = 0;
-
- MaxDataTransferRate = gCardInfo.CSDData.TRAN_SPEED;
-
- DEBUG((EFI_D_INFO, "SDHC::CalculateCardCLKD : 0x%x.\n", MaxDataTransferRate));
-
- // For SD Cards we would need to send CMD6 to set
- // speeds abouve 25MHz. High Speed mode 50 MHz and up
-
- //Calculate Transfer rate unit (Bits 2:0 of TRAN_SPEED)
- switch (MaxDataTransferRate & 0x7) {
- case 0:
- TransferRateValue = 100 * 1000;
- break;
-
- case 1:
- TransferRateValue = 1 * 1000 * 1000;
- break;
-
- case 2:
- TransferRateValue = 10 * 1000 * 1000;
- break;
-
- case 3:
- TransferRateValue = 100 * 1000 * 1000;
- break;
-
- default:
- DEBUG((EFI_D_ERROR, "Invalid parameter.\n"));
- ASSERT(FALSE);
- }
-
- //Calculate Time value (Bits 6:3 of TRAN_SPEED)
- switch ((MaxDataTransferRate >> 3) & 0xF) {
- case 1:
- TimeValue = 10;
- break;
-
- case 2:
- TimeValue = 12;
- break;
-
- case 3:
- TimeValue = 13;
- break;
-
- case 4:
- TimeValue = 15;
- break;
-
- case 5:
- TimeValue = 20;
- break;
-
- case 6:
- TimeValue = 25;
- break;
-
- case 7:
- TimeValue = 30;
- break;
-
- case 8:
- TimeValue = 35;
- break;
-
- case 9:
- TimeValue = 40;
- break;
-
- case 10:
- TimeValue = 45;
- break;
-
- case 11:
- TimeValue = 50;
- break;
-
- case 12:
- TimeValue = 55;
- break;
-
- case 13:
- TimeValue = 60;
- break;
-
- case 14:
- TimeValue = 70;
- break;
-
- case 15:
- TimeValue = 80;
- break;
-
- default:
- DEBUG((EFI_D_ERROR, "Invalid parameter.\n"));
- ASSERT(FALSE);
- }
-
- Frequency = TransferRateValue * TimeValue/10;
-
- //Calculate Clock divider value to program in SDHC_SYSCTL[CLKD] field.
- *ClockFrequencySelect = ((MMC_REFERENCE_CLK/Frequency) + 1);
-
- DEBUG ((EFI_D_INFO, "MaxDataTransferRate: 0x%x, Frequency: %d KHz, ClockFrequencySelect: %x\n", MaxDataTransferRate, Frequency/1000, *ClockFrequencySelect));
-}
-
-
-VOID
-GetCardConfigurationData (
- VOID
- )
-{
- UINTN BlockSize;
- UINTN NumBlocks;
- // UINTN ClockFrequencySelect;
-
- //Calculate BlockSize and Total number of blocks in the detected card.
- GetBlockInformation(&BlockSize, &NumBlocks);
- gCardInfo.BlockSize = BlockSize;
- gCardInfo.NumBlocks = NumBlocks;
-
- //Calculate Card clock divider value.
- // CalculateCardCLKD(&ClockFrequencySelect);
-// gCardInfo.ClockFrequencySelect = ClockFrequencySelect;
- gCardInfo.ClockFrequencySelect = 25000000;
-}
-
-
-EFI_STATUS
-InitializeSDHC (
- VOID
- )
-{
-
- EFI_STATUS Status;
- EXYNOS_GPIO *Gpio;
- UINT32 CumBaseAddr;
- UINT32 SdMmcBaseAddr;
-
- Status = gBS->LocateProtocol(&gSamsungPlatformGpioProtocolGuid, NULL, (VOID **)&Gpio);
- ASSERT_EFI_ERROR(Status);
-
- CumBaseAddr = PcdGet32(PcdCmuBase);
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- // Reset Host Controller
- MmioWrite32((SdMmcBaseAddr + SDHC_SWRST_OFFSET), SRA);
- while ((MmioRead32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET)) & SRA) != 0x0);
-
- // Set Clock Source for using MPLL
- MmioAndThenOr32 ((CumBaseAddr + CLK_SRC_FSYS_OFFSET), ~(0xF << 8), (0x6 << 8));
-
- // Set GPIO for using SDMMC2
- Gpio->Set(Gpio,SD_2_CLK,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_CMD,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_CDn,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_DATA0,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_DATA1,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_DATA2,GPIO_MODE_SPECIAL_FUNCTION_2);
- Gpio->Set(Gpio,SD_2_DATA3,GPIO_MODE_SPECIAL_FUNCTION_2);
-
- Gpio->SetPull(Gpio,SD_2_CLK,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,SD_2_CMD,GPIO_PULL_NONE);
- Gpio->SetPull(Gpio,SD_2_CDn,GPIO_PULL_UP);
- Gpio->SetPull(Gpio,SD_2_DATA0,GPIO_PULL_UP);
- Gpio->SetPull(Gpio,SD_2_DATA1,GPIO_PULL_UP);
- Gpio->SetPull(Gpio,SD_2_DATA2,GPIO_PULL_UP);
- Gpio->SetPull(Gpio,SD_2_DATA3,GPIO_PULL_UP);
-
-
- Gpio->SetStrength(Gpio,SD_2_CLK,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_CMD,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_CDn,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_DATA0,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_DATA1,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_DATA2,GPIO_DRV_4X);
- Gpio->SetStrength(Gpio,SD_2_DATA3,GPIO_DRV_4X);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-PerformCardIdenfication (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN CmdArgument = 0;
- UINTN Response = 0;
- UINTN RetryCount = 0;
- UINTN TempRes0,TempRes1,TempRes2,TempRes3;
- BOOLEAN SDCmd8Supported = FALSE;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- //Enable interrupts.
- MmioWrite32 ((SdMmcBaseAddr + INTEN_OFFSET), (CMDCOMP | TRNSCOMP | RDYFORRD | RDYFORWT | CARDINSERT | CARDREMOVE));
-
- //Change clock frequency to 400KHz to fit protocol
- UpdateSDHCClkFrequency(400);
-
- //Send CMD0 command.
- Status = SendCmd (CMD0, CMD0_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "Cmd0 fails.\n"));
- return Status;
- }
-
- DEBUG ((EFI_D_INFO, "CMD0 response: %x\n", MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET))));
-
- //Send CMD8 command. (New v2.00 command for Voltage check)
- //Only 2.7V - 3.6V is supported for SD2.0, only SD 2.0 card can pass.
- //MMC & SD1.1 card will fail this command.
- CmdArgument = CMD8_ARG;
- Status = SendCmd (CMD8, CMD8_INT_EN, CmdArgument);
- if (Status == EFI_SUCCESS) {
- Response = MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET));
- DEBUG ((EFI_D_INFO, "CMD8 success. CMD8 response: %x\n", Response));
- if (Response != CmdArgument) {
- return EFI_DEVICE_ERROR;
- }
- DEBUG ((EFI_D_INFO, "Card is SD2.0\n"));
- SDCmd8Supported = TRUE; //Supports high capacity.
- } else {
- DEBUG ((EFI_D_INFO, "CMD8 fails. Not an SD2.0 card.\n"));
- }
-
- MmioOr32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET), SRC);
- while ((MmioRead32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET)) & SRC));
-
- //Poll till card is busy
- while (RetryCount < MAX_RETRY_COUNT) {
- //Send CMD55 command.
- CmdArgument = 0;
- Status = SendCmd (CMD55, CMD55_INT_EN, CmdArgument);
- if (Status == EFI_SUCCESS) {
- DEBUG ((EFI_D_INFO, "CMD55 success. CMD55 response: %x\n", MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET))));
- gCardInfo.CardType = SD_CARD;
- } else {
- DEBUG ((EFI_D_ERROR, "CMD55 fails.\n"));
- gCardInfo.CardType = MMC_CARD;
- }
-
- //Send appropriate command for the card type which got detected.
- if (gCardInfo.CardType == SD_CARD) {
- CmdArgument = ((UINTN *) &(gCardInfo.OCRData))[0];
-
- //Set HCS bit.
- if (SDCmd8Supported) {
- CmdArgument |= HCS;
- }
-
- Status = SendCmd (ACMD41, ACMD41_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "ACMD41 fails.\n"));
- return Status;
- }
- ((UINT32 *) &(gCardInfo.OCRData))[0] = MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET));
- DEBUG ((EFI_D_INFO, "SD card detected. ACMD41 OCR: %x\n", ((UINT32 *) &(gCardInfo.OCRData))[0]));
- } else if (gCardInfo.CardType == MMC_CARD) {
- CmdArgument = 0;
- Status = SendCmd (CMD1, CMD1_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD1 fails.\n"));
- return Status;
- }
- Response = MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET));
- DEBUG ((EFI_D_INFO, "MMC card detected. CMD1 response: %x\n", Response));
-
- //NOTE: For now, I am skipping this since I only have an SD card.
- //Compare card OCR and host OCR (Section 22.6.1.3.2.4)
- return EFI_UNSUPPORTED; //For now, MMC is not supported.
- }
-
- //Poll the card until it is out of its power-up sequence.
- if (gCardInfo.OCRData.Busy == 1) {
-
- if (SDCmd8Supported) {
- gCardInfo.CardType = SD_CARD_2;
- }
-
- //Card is ready. Check CCS (Card capacity status) bit (bit#30).
- //SD 2.0 standard card will response with CCS 0, SD high capacity card will respond with CCS 1.
- if (gCardInfo.OCRData.AccessMode & BIT1) {
- gCardInfo.CardType = SD_CARD_2_HIGH;
- DEBUG ((EFI_D_INFO, "High capacity card.\n"));
- } else {
- DEBUG ((EFI_D_INFO, "Standard capacity card.\n"));
- }
-
- break;
- }
-
- RetryCount++;
- }
-
- if (RetryCount == MAX_RETRY_COUNT) {
- DEBUG ((EFI_D_ERROR, "Timeout error. RetryCount: %d\n", RetryCount));
- return EFI_TIMEOUT;
- }
-
- //Read CID data.
- CmdArgument = 0;
- Status = SendCmd (CMD2, CMD2_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD2 fails. Status: %x\n", Status));
- return Status;
- }
-
- DEBUG ((EFI_D_INFO, "CMD2 response: %x %x %x %x\n", MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET)), \
- MmioRead32 ((SdMmcBaseAddr + RSPREG1_OFFSET)), \
- MmioRead32 ((SdMmcBaseAddr + RSPREG2_OFFSET)), \
- MmioRead32 ((SdMmcBaseAddr + RSPREG3_OFFSET))));
-
- TempRes0 = MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET));
- TempRes1 = MmioRead32 ((SdMmcBaseAddr + RSPREG1_OFFSET));
- TempRes2 = MmioRead32 ((SdMmcBaseAddr + RSPREG2_OFFSET));
- TempRes3 = MmioRead32 ((SdMmcBaseAddr + RSPREG3_OFFSET));
-
- //Parse CID register data.
- ParseCardCIDData(TempRes0 << 8, (TempRes1 << 8) | (TempRes0 >> 24),
- (TempRes2 << 8) | (TempRes1 >> 24), (TempRes3 << 8) | (TempRes2 >> 24));
-
- //Read RCA
- CmdArgument = 0;
- Status = SendCmd (CMD3, CMD3_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD3 fails. Status: %x\n", Status));
- return Status;
- }
-
- //Set RCA for the detected card. RCA is CMD3 response.
- gCardInfo.RCA = (MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET)) >> 16);
- DEBUG ((EFI_D_ERROR, "CMD3 response: RCA %x\n", gCardInfo.RCA));
-
- //MMC Bus setting change after card identification.
-// MmioAndThenOr32 (SDHC_PWRCON, ~(0x7<<9), SDBV30); //check if our controller voltage is 3.0v or 3.3v //wprkfgur
- UpdateSDHCClkFrequency(400); //Set the clock frequency to 400KHz.
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-GetCardSpecificData (
- VOID
- )
-{
- EFI_STATUS Status;
- UINTN CmdArgument;
- UINTN TempRes[4],i;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- //Send CMD9 to retrieve CSD.
- CmdArgument = gCardInfo.RCA << 16;
- Status = SendCmd (CMD9, CMD9_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD9 fails. Status: %x\n", Status));
- return Status;
- }
-
- TempRes[0] = MmioRead32 ((SdMmcBaseAddr + RSPREG0_OFFSET));
- TempRes[1] = MmioRead32 ((SdMmcBaseAddr + RSPREG1_OFFSET));
- TempRes[2] = MmioRead32 ((SdMmcBaseAddr + RSPREG2_OFFSET));
- TempRes[3] = MmioRead32 ((SdMmcBaseAddr + RSPREG3_OFFSET));
-
- //Populate 128-bit CSD register data.
- for (i = 0 ; i < 4; i++) {
- ((UINT32 *)&(gCardInfo.CSDData))[i] = TempRes[i] << 8;
- if (i != 0)
- ((UINT32 *)&(gCardInfo.CSDData))[i] |= ((TempRes[i-1] >> 24) & 0xFF);
- }
-
- DEBUG ((EFI_D_INFO, "CMD9 response: %x %x %x %x\n", ((UINT32 *)&(gCardInfo.CSDData))[0], ((UINT32 *)&(gCardInfo.CSDData))[1], ((UINT32 *)&(gCardInfo.CSDData))[2], ((UINT32 *)&(gCardInfo.CSDData))[3]));
-
- //Calculate total number of blocks and max. data transfer rate supported by the detected card.
- GetCardConfigurationData();
-
- return Status;
-}
-
-
-EFI_STATUS
-PerformCardConfiguration (
- VOID
- )
-{
- UINTN CmdArgument = 0;
- EFI_STATUS Status;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- //Send CMD7
- CmdArgument = gCardInfo.RCA << 16;
- Status = SendCmd (CMD7, CMD7_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD7 fails. Status: %x\n", Status));
- return Status;
- }
-
- if ((gCardInfo.CardType != UNKNOWN_CARD) && (gCardInfo.CardType != MMC_CARD)) {
- // We could read SCR register, but SD Card Phys spec stats any SD Card shall
- // set SCR.SD_BUS_WIDTHS to support 4-bit mode, so why bother?
-
- // Send ACMD6 (application specific commands must be prefixed with CMD55)
- Status = SendCmd (CMD55, CMD55_INT_EN, CmdArgument);
- if (!EFI_ERROR (Status)) {
- // set device into 4-bit data bus mode
- Status = SendCmd (ACMD6, ACMD6_INT_EN, 0x2);
- if (!EFI_ERROR (Status)) {
- // Set host controler into 4-bit mode
- MmioOr32 ((SdMmcBaseAddr + HOSTCTL_OFFSET), WIDE4);
- DEBUG ((EFI_D_INFO, "SD Memory Card set to 4-bit mode\n"));
- }
- }
- }
-
- //Send CMD16 to set the block length
- CmdArgument = gCardInfo.BlockSize;
- Status = SendCmd (CMD16, CMD16_INT_EN, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD16 fails. Status: %x\n", Status));
- return Status;
- }
-
- //Change SDHC clock frequency to what detected card can support.
- UpdateSDHCClkFrequency(250000); //Fix the clock value temporary
- //UpdateSDHCClkFrequency(gCardInfo.ClockFrequencySelect);
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-ReadBlockData (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- OUT VOID *Buffer
- )
-{
- UINTN MmcStatus;
- UINTN *DataBuffer = Buffer;
- UINTN DataSize = This->Media->BlockSize/4;
- UINTN Count;
- UINTN RetryCount = 0;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- //Check controller status to make sure there is no error.
- while (RetryCount < MAX_RETRY_COUNT) {
- do {
- //Read Status.
- MmcStatus = MmioRead32 ((SdMmcBaseAddr + INTSTS_OFFSET));
- } while(MmcStatus == 0);
-
- //Check if Buffer read ready (RDYFORRD) bit is set?
- if (MmcStatus & RDYFORRD) {
-
- //Clear RDYFORRD bit
- MmioOr32 ((SdMmcBaseAddr + INTSTS_OFFSET), RDYFORRD);
-
- //Read block worth of data.
- for (Count = 0; Count < DataSize; Count++) {
- *DataBuffer++ = MmioRead32 ((SdMmcBaseAddr + BDATA_OFFSET));
- }
- break;
- }
- RetryCount++;
- }
-
- if (RetryCount == MAX_RETRY_COUNT) {
- return EFI_TIMEOUT;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-WriteBlockData (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- OUT VOID *Buffer
- )
-{
- UINTN MmcStatus;
- UINTN *DataBuffer = Buffer;
- UINTN DataSize = This->Media->BlockSize/4;
- UINTN Count;
- UINTN RetryCount = 0;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- //Check controller status to make sure there is no error.
- while (RetryCount < MAX_RETRY_COUNT) {
- do {
- //Read Status.
- MmcStatus = MmioRead32 ((SdMmcBaseAddr + INTSTS_OFFSET));
- } while(MmcStatus == 0);
-
- //Check if Buffer write ready (RDYFORWT) bit is set?
- if (MmcStatus & RDYFORWT) {
-
- //Clear RDYFORWT bit
- MmioOr32 ((SdMmcBaseAddr + INTSTS_OFFSET), RDYFORWT);
-
- //Write block worth of data.
- for (Count = 0; Count < DataSize; Count++) {
- MmioWrite32 ((SdMmcBaseAddr + BDATA_OFFSET), *DataBuffer++);
- }
-
- break;
- }
- RetryCount++;
- }
-
- if (RetryCount == MAX_RETRY_COUNT) {
- return EFI_TIMEOUT;
- }
-
- return EFI_SUCCESS;
-}
-
-
-EFI_STATUS
-TransferBlock (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- IN UINTN Lba,
- IN OUT VOID *Buffer,
- IN OPERATION_TYPE OperationType
- )
-{
- EFI_STATUS Status;
- UINTN MmcStatus;
- UINTN RetryCount = 0;
- UINTN Cmd = 0;
- UINTN CmdInterruptEnable = 0;
- UINTN CmdArgument = 0;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- DEBUG ((EFI_D_INFO, "SDHC::TransferBlock : Lba = %d, Buffer = 0x%x, Type = %d\n", Lba, Buffer, OperationType));
- //Populate the command information based on the operation type.
- if (OperationType == READ) {
- Cmd = CMD17; //Single block read
- CmdInterruptEnable = CMD17_INT_EN;
- PrepareTransfer(CardtoHost, 1);
- } else if (OperationType == WRITE) {
- Cmd = CMD24; //Single block write
- CmdInterruptEnable = CMD24_INT_EN;
- PrepareTransfer(HosttoCard, 1);
- }
-
- //Set command argument based on the card access mode (Byte mode or Block mode)
- if (gCardInfo.OCRData.AccessMode & BIT1) {
- CmdArgument = Lba;
- } else {
- CmdArgument = Lba * This->Media->BlockSize;
- }
-
- //Send Command.
- Status = SendCmd (Cmd, CmdInterruptEnable, CmdArgument);
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "CMD fails. Status: %x\n", Status));
- return Status;
- }
-
- //Read or Write data.
- if (OperationType == READ) {
- Status = ReadBlockData (This, Buffer);
- if (EFI_ERROR(Status)) {
- DEBUG((EFI_D_ERROR, "ReadBlockData fails.\n"));
- return Status;
- }
- } else if (OperationType == WRITE) {
- Status = WriteBlockData (This, Buffer);
- if (EFI_ERROR(Status)) {
- DEBUG((EFI_D_ERROR, "WriteBlockData fails.\n"));
- return Status;
- }
- }
-
- //Check for the Transfer completion.
- while (RetryCount < MAX_RETRY_COUNT) {
- //Read Status
- do {
- MmcStatus = MmioRead32 ((SdMmcBaseAddr + INTSTS_OFFSET));
- } while (MmcStatus == 0);
-
- //Check if Transfer complete (TRNSCOMP) bit is set?
- if (MmcStatus & TRNSCOMP) {
- break;
- } else {
- DEBUG ((EFI_D_INFO, "MmcStatus for TRNSCOMP: %x\n", MmcStatus));
- //Check if DATAEBITERR, DATACRCERR or DATATOUTERR interrupt occured.
- if ((MmcStatus & DATAEBITERR) | (MmcStatus & DATACRCERR) | (MmcStatus & DATATOUTERR)) {
- //There was an error during the data transfer.
-
- //Set SRD bit to 1 and wait until it return to 0x0.
- MmioOr32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET), SRD);
- while((MmioRead32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET)) & SRD) != 0x0);
-
- return EFI_DEVICE_ERROR;
- }
- }
- RetryCount++;
- }
-
- if (RetryCount == MAX_RETRY_COUNT) {
- DEBUG ((EFI_D_ERROR, "TransferBlockData timed out.\n"));
- return EFI_TIMEOUT;
- }
-
- return EFI_SUCCESS;
-}
-
-BOOLEAN
-CardPresent (
- VOID
- )
-{
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
- if (MmioRead32((SdMmcBaseAddr + PRNSTS_OFFSET)) & INSCARD)
- return TRUE;
- else
- return FALSE;
-}
-
-EFI_STATUS
-DetectCard (
- VOID
- )
-{
- EFI_STATUS Status;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- if (!CardPresent ()) {
- return EFI_NO_MEDIA;
- }
-
- //Initialize MMC host controller clocks.
- Status = InitializeSDHC ();
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "Initialize MMC host controller fails. Status: %x\n", Status));
- return Status;
- }
-
- //Soft reset for all.
- MmioWrite32((SdMmcBaseAddr + SDHC_SWRST_OFFSET), SRA);
- while ((MmioRead32 ((SdMmcBaseAddr + SDHC_SWRST_OFFSET)) & SRA) != 0x0);
-
- //Set the clock frequency to 400KHz.
- UpdateSDHCClkFrequency (400);
-
- //Card idenfication
- Status = PerformCardIdenfication ();
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "No MMC/SD card detected.\n"));
- return Status;
- }
-
- //Get CSD (Card specific data) for the detected card.
- Status = GetCardSpecificData();
- if (EFI_ERROR(Status)) {
- return Status;
- }
-
- //Configure the card in data transfer mode.
- Status = PerformCardConfiguration();
- if (EFI_ERROR(Status)) {
- return Status;
- }
-
- //Patch the Media structure.
- gSDHCMedia.LastBlock = (gCardInfo.NumBlocks - 1);
- gSDHCMedia.BlockSize = gCardInfo.BlockSize;
- gSDHCMedia.ReadOnly = 0;
- gSDHCMedia.MediaPresent = TRUE;
- gSDHCMedia.MediaId++;
-
- DEBUG ((EFI_D_INFO, "SD Card Media Change on Handle 0x%08x\n", gImageHandle));
-
- return Status;
-}
-
-#define MAX_SDHC_TRANSFER_SIZE 0x4000
-
-EFI_STATUS
-SdReadWrite (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- IN UINTN Lba,
- OUT VOID *Buffer,
- IN UINTN BufferSize,
- IN OPERATION_TYPE OperationType
- )
-{
- EFI_STATUS Status = EFI_SUCCESS;
- UINTN RetryCount = 0;
- UINTN BlockCount;
- UINTN BytesToBeTranferedThisPass = 0;
- UINTN BytesRemainingToBeTransfered;
- EFI_TPL OldTpl;
- BOOLEAN Update;
- UINT32 SdMmcBaseAddr;
-
- SdMmcBaseAddr = PcdGet32(PcdSdMmcBase);
-
- Update = FALSE;
-
- DEBUG ((EFI_D_INFO, "SDHC::SDHCInitialize is called \n"));
- if (gMediaChange) {
- Update = TRUE;
- Status = DetectCard();
- if (EFI_ERROR (Status)) {
- DEBUG ((EFI_D_ERROR, "SDHC::SDHCInitialize:Card Detect Fail\n"));
- gSDHCMedia.MediaPresent = FALSE;
- gSDHCMedia.LastBlock = 0;
- gSDHCMedia.BlockSize = 512; // Should be zero but there is a bug in DiskIo
- gSDHCMedia.ReadOnly = FALSE;
- }
- gMediaChange = FALSE;
- } else if (!gSDHCMedia.MediaPresent) {
- Status = EFI_NO_MEDIA;
- goto Done;
- }
-
- if (Update) {
- DEBUG ((EFI_D_INFO, "SD Card ReinstallProtocolInterface ()\n"));
- gBS->ReinstallProtocolInterface (
-
- gImageHandle,
-
- &gEfiBlockIoProtocolGuid,
-
- &gBlockIo,
-
- &gBlockIo
-
- );
- }
-DEBUG ((EFI_D_INFO, "SDHC::SDHCInitialize:CardInfo : LastBlock = %ld, BlockSize = %d\n", gSDHCMedia.LastBlock, gSDHCMedia.BlockSize));
-
-
- if (Buffer == NULL) {
- Status = EFI_INVALID_PARAMETER;
- goto Done;
- }
-
- if (Lba > This->Media->LastBlock) {
- Status = EFI_INVALID_PARAMETER;
- goto Done;
- }
-
- if ((BufferSize % This->Media->BlockSize) != 0) {
- Status = EFI_BAD_BUFFER_SIZE;
- goto Done;
- }
-
- //Check if the data lines are not in use.
- while ((RetryCount++ < MAX_RETRY_COUNT) && (MmioRead32 ((SdMmcBaseAddr + PRNSTS_OFFSET)) & CMDINHDAT));
- if (RetryCount == MAX_RETRY_COUNT) {
- Status = EFI_TIMEOUT;
- goto Done;
- }
-
- OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
-
- BytesRemainingToBeTransfered = BufferSize;
- while (BytesRemainingToBeTransfered > 0) {
- // Turn OFF DMA path until it is debugged
- // BytesToBeTranferedThisPass = (BytesToBeTranferedThisPass >= MAX_SDHC_TRANSFER_SIZE) ? MAX_SDHC_TRANSFER_SIZE : BytesRemainingToBeTransfered;
- BytesToBeTranferedThisPass = This->Media->BlockSize;
-
- BlockCount = BytesToBeTranferedThisPass/This->Media->BlockSize;
-
- if (BlockCount > 1) {
-// Status = DmaBlocks (This, Lba, Buffer, BlockCount, OperationType);
- } else {
- //Transfer a block worth of data.
- Status = TransferBlock (This, Lba, Buffer, OperationType);
-
- }
-
- if (EFI_ERROR(Status)) {
- DEBUG ((EFI_D_ERROR, "TransferBlockData fails. %x\n", Status));
- goto DoneRestoreTPL;
- }
-
- BytesRemainingToBeTransfered -= BytesToBeTranferedThisPass;
- Lba += BlockCount;
- Buffer = (UINT8 *)Buffer + This->Media->BlockSize;
- }
-
-DoneRestoreTPL:
-
- gBS->RestoreTPL (OldTpl);
-
-Done:
-
- return Status;
-
-}
-
-
-/**
-
- Reset the Block Device.
-
-
-
- @param This Indicates a pointer to the calling context.
-
- @param ExtendedVerification Driver may perform diagnostics on reset.
-
-
-
- @retval EFI_SUCCESS The device was reset.
-
- @retval EFI_DEVICE_ERROR The device is not functioning properly and could
-
- not be reset.
-
-
-
-**/
-EFI_STATUS
-EFIAPI
-SDHCReset (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- IN BOOLEAN ExtendedVerification
- )
-{
- DEBUG ((EFI_D_INFO, " SDHC::SDHCReset is called\n"));
- return EFI_SUCCESS;
-}
-
-
-/**
-
- Read BufferSize bytes from Lba into Buffer.
-
-
-
- @param This Indicates a pointer to the calling context.
-
- @param MediaId Id of the media, changes every time the media is replaced.
-
- @param Lba The starting Logical Block Address to read from
-
- @param BufferSize Size of Buffer, must be a multiple of device block size.
-
- @param Buffer A pointer to the destination buffer for the data. The caller is
-
- responsible for either having implicit or explicit ownership of the buffer.
-
-
-
- @retval EFI_SUCCESS The data was read correctly from the device.
-
- @retval EFI_DEVICE_ERROR The device reported an error while performing the read.
-
- @retval EFI_NO_MEDIA There is no media in the device.
-
- @retval EFI_MEDIA_CHANGED The MediaId does not matched the current device.
-
- @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
-
- @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
-
- or the buffer is not on proper alignment.
-
-EFI_STATUS
-
-**/
-EFI_STATUS
-EFIAPI
-SDHCReadBlocks (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- IN UINT32 MediaId,
- IN EFI_LBA Lba,
- IN UINTN BufferSize,
- OUT VOID *Buffer
- )
-{
- EFI_STATUS Status;
-
- DEBUG ((EFI_D_INFO, "SDHC::SDHCWriteBlocks : MediaId = %d, Lba = %d, BufferSize = %d, Buffer = 0x%x\n",
- MediaId, (UINTN)Lba, BufferSize, Buffer));
- //Perform Read operation.
- Status = SdReadWrite (This, (UINTN)Lba, Buffer, BufferSize, READ);
-
- return Status;
-
-}
-
-
-/**
-
- Write BufferSize bytes from Lba into Buffer.
-
-
-
- @param This Indicates a pointer to the calling context.
-
- @param MediaId The media ID that the write request is for.
-
- @param Lba The starting logical block address to be written. The caller is
-
- responsible for writing to only legitimate locations.
-
- @param BufferSize Size of Buffer, must be a multiple of device block size.
-
- @param Buffer A pointer to the source buffer for the data.
-
-
-
- @retval EFI_SUCCESS The data was written correctly to the device.
-
- @retval EFI_WRITE_PROTECTED The device can not be written to.
-
- @retval EFI_DEVICE_ERROR The device reported an error while performing the write.
-
- @retval EFI_NO_MEDIA There is no media in the device.
-
- @retval EFI_MEDIA_CHNAGED The MediaId does not matched the current device.
-
- @retval EFI_BAD_BUFFER_SIZE The Buffer was not a multiple of the block size of the device.
-
- @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
-
- or the buffer is not on proper alignment.
-
-
-
-**/
-EFI_STATUS
-EFIAPI
-SDHCWriteBlocks (
- IN EFI_BLOCK_IO_PROTOCOL *This,
- IN UINT32 MediaId,
- IN EFI_LBA Lba,
- IN UINTN BufferSize,
- IN VOID *Buffer
- )
-{
- EFI_STATUS Status;
-
- DEBUG ((EFI_D_INFO, "SDHC::SDHCWriteBlocks : MediaId = %d, Lba = %d, BufferSize = %d, Buffer = 0x%x\n",
- MediaId, (UINTN)Lba, BufferSize, Buffer));
- //Perform write operation.
- Status = SdReadWrite (This, (UINTN)Lba, Buffer, BufferSize, WRITE);
-
-
- return Status;
-
-}
-
-
-/**
-
- Flush the Block Device.
-
-
-
- @param This Indicates a pointer to the calling context.
-
-
-
- @retval EFI_SUCCESS All outstanding data was written to the device
-
- @retval EFI_DEVICE_ERROR The device reported an error while writting back the data
-
- @retval EFI_NO_MEDIA There is no media in the device.
-
-
-
-**/
-EFI_STATUS
-EFIAPI
-SDHCFlushBlocks (
- IN EFI_BLOCK_IO_PROTOCOL *This
- )
-{
- DEBUG ((EFI_D_INFO, "SDHC::SDHCFlushBlocks is called\n"));
- return EFI_SUCCESS;
-}
-
-
-EFI_BLOCK_IO_PROTOCOL gBlockIo = {
- EFI_BLOCK_IO_INTERFACE_REVISION, // Revision
- &gSDHCMedia, // *Media
- SDHCReset, // Reset
- SDHCReadBlocks, // ReadBlocks
- SDHCWriteBlocks, // WriteBlocks
- SDHCFlushBlocks // FlushBlocks
-};
-
-
-/**
-
- Timer callback to convert card present hardware into a boolean that indicates
-
- a media change event has happened. If you just check the GPIO you could see
-
- card 1 and then check again after card 1 was removed and card 2 was inserted
-
- and you would still see media present. Thus you need the timer tick to catch
-
- the toggle event.
-
-
-
- @param Event Event whose notification function is being invoked.
-
- @param Context The pointer to the notification function's context,
-
- which is implementation-dependent. Not used.
-
-
-
-**/
-VOID
-EFIAPI
-TimerCallback (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- BOOLEAN Present;
-
- DEBUG ((EFI_D_INFO, "SDHC::TimerCallBack is called\n"));
- Present = CardPresent ();
- if (gSDHCMedia.MediaPresent) {
- if (!Present && !gMediaChange) {
- gMediaChange = TRUE;
- }
- } else {
- if (Present && !gMediaChange) {
- gMediaChange = TRUE;
- }
- }
-}
-
-
-EFI_STATUS
-EFIAPI
-SDHCInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- ZeroMem (&gCardInfo, sizeof (CARD_INFO));
-
- Status = gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK, TimerCallback, NULL, &gTimerEvent);
- ASSERT_EFI_ERROR (Status);
-
- Status = gBS->SetTimer (gTimerEvent, TimerPeriodic, 1000000);
- ASSERT_EFI_ERROR (Status);
-
- //Publish BlockIO.
- Status = gBS->InstallMultipleProtocolInterfaces (
- &ImageHandle,
- &gEfiBlockIoProtocolGuid, &gBlockIo,
- &gEfiDevicePathProtocolGuid, &gSDHCDevicePath,
- NULL
- );
- return Status;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.h b/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.h
deleted file mode 100755
index 849a0e0cc..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.h
+++ /dev/null
@@ -1,293 +0,0 @@
-/** @file
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 _SDHCDXE_H_
-#define _SDHCDXE_H_
-
-#include <Uefi.h>
-
-#include <Library/BaseLib.h>
-#include <Library/MemoryAllocationLib.h>
-#include <Library/DebugLib.h>
-#include <Library/IoLib.h>
-#include <Library/PcdLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Protocol/BlockIo.h>
-#include <Protocol/DevicePath.h>
-
-
-/* SDHC Register MAP */
-#define BLKSIZE_OFFSET (0x04)
-#define BLKCNT_OFFSET (0x04) //only use [16:31]
-#define BLEN_512BYTES (0x200UL << 0)
-
-#define ARGUMENT_OFFSET (0x08)
-#define TRNMOD_OFFSET (0x0C)
-#define CMDREG_OFFSET (0x0C) //only use [16:31]
-#define ENDMA BIT0
-#define ENBLKCNT BIT1
-#define RD1WT0 BIT4
-#define MUL1SIN0 BIT5
-#define RSPTYP136 (0x1 << 16)
-#define RSPTYP48 (0x2 << 16)
-#define RSPTYP48B (0x3 << 16)
-#define ENCMDCRC BIT19
-#define ENCMDIDX BIT20
-#define DATAPRNT BIT21
-#define INDX(CMD_INDX) ((CMD_INDX & 0x3F) << 24)
-
-#define RSPREG0_OFFSET (0x10)
-#define RSPREG1_OFFSET (0x14)
-#define RSPREG2_OFFSET (0x18)
-#define RSPREG3_OFFSET (0x1C)
-#define BDATA_OFFSET (0x20)
-#define PRNSTS_OFFSET (0x24)
-#define CMDINHCMD BIT0
-#define CMDINHDAT BIT1
-#define INSCARD BIT16
-
-#define HOSTCTL_OFFSET (0x28)
-#define PWRCON_OFFSET (0x28) //only use [8:15]
-#define WIDE4 BIT1
-#define SDBP BIT8
-#define SDBV18 (0x5 << 9)
-#define SDBV30 (0x6 << 9)
-#define SDBV33 (0x7 << 9)
-
-#define CLKCON_OFFSET (0x2C)
-#define TIMEOUTCON_OFFSET (0x2C) //only use [16:23]
-#define SDHC_SWRST_OFFSET (0x2C) //only use [24:31]
-#define ICE BIT0
-#define ICS BIT1
-#define CCE BIT2
-#define CCS BIT3
-#define SRA BIT24
-#define SRC BIT25
-#define SRD BIT26
-
-#define INTSTS_OFFSET (0x30)
-#define INTEN_OFFSET (0x34)
-#define CMDCOMP BIT0
-#define TRNSCOMP BIT1
-#define RDYFORWT BIT4
-#define RDYFORRD BIT5
-#define CARDINSERT BIT6
-#define CARDREMOVE BIT7
-#define ERRINT BIT15
-#define CMDTOUTERR BIT16
-#define CMDCRCERR BIT17
-#define CMDEBITERR BIT18
-#define CMDIDXERR BIT19
-#define DATATOUTERR BIT20
-#define DATACRCERR BIT21
-#define DATAEBITERR BIT22
-
-#define HosttoCard 0x1
-#define CardtoHost 0x0
-
-/* Command Definitions */
-#define CMD0 INDX(0)
-#define CMD0_INT_EN (CMDCOMP | CMDEBITERR)
-
-#define CMD1 (INDX(1) | RSPTYP48)
-#define CMD1_INT_EN (CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD2 (INDX(2) | ENCMDCRC | RSPTYP136)
-#define CMD2_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD3 (INDX(3) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD3_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD5 (INDX(5) | RSPTYP48)
-#define CMD5_INT_EN (CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD7 (INDX(7) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD7_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD8 (INDX(8) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD8_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-//Reserved(0)[12:31], Supply voltage(1)[11:8], check pattern(0xCE)[7:0] = 0x1CE
-#define CMD8_ARG (0x0UL << 12 | BIT8 | 0xCEUL << 0)
-
-#define CMD9 (INDX(9) | ENCMDCRC | RSPTYP136)
-#define CMD9_INT_EN (CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD16 (INDX(16) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD16_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD17 (INDX(17) | DATAPRNT | ENCMDIDX | ENCMDCRC | RSPTYP48 | RD1WT0)
-#define CMD17_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | TRNSCOMP | RDYFORRD | CMDTOUTERR | DATATOUTERR | DATACRCERR | DATAEBITERR | CMDEBITERR)
-
-#define CMD18 (INDX(18) | DATAPRNT | ENCMDIDX | ENCMDCRC | RSPTYP48 | MUL1SIN0 | RD1WT0 | ENBLKCNT | ENDMA)
-#define CMD18_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | TRNSCOMP | RDYFORRD | CMDTOUTERR | DATATOUTERR | DATACRCERR | DATAEBITERR | CMDEBITERR)
-
-#define CMD23 (INDX(23) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD23_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define CMD24 (INDX(24) | DATAPRNT | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD24_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | TRNSCOMP | RDYFORWT | CMDTOUTERR | DATATOUTERR | DATACRCERR | DATAEBITERR | CMDEBITERR)
-
-#define CMD25 (INDX(25) | DATAPRNT | ENCMDIDX | ENCMDCRC | RSPTYP48 | MUL1SIN0 | ENBLKCNT | ENDMA)
-#define CMD25_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | TRNSCOMP | RDYFORWT | CMDTOUTERR | DATATOUTERR | DATACRCERR | DATAEBITERR | CMDEBITERR)
-
-#define CMD55 (INDX(55) | ENCMDIDX | ENCMDCRC | RSPTYP48)
-#define CMD55_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define ACMD41 (INDX(41) | RSPTYP48)
-#define ACMD41_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-#define ACMD6 (INDX(6) | RSPTYP48)
-#define ACMD6_INT_EN (CMDIDXERR | CMDCRCERR | CMDCOMP | CMDEBITERR | CMDTOUTERR)
-
-
-#define HCS BIT30 //Host capacity support/1 = Supporting high capacity
-
-#define MAX_RETRY_COUNT (100000)
-#define MMC_REFERENCE_CLK (96000000)
-
-typedef struct {
- UINT32 Reserved0: 7; // 0
- UINT32 V170_V195: 1; // 1.70V - 1.95V
- UINT32 V200_V260: 7; // 2.00V - 2.60V
- UINT32 V270_V360: 9; // 2.70V - 3.60V
- UINT32 RESERVED_1: 5; // Reserved
- UINT32 AccessMode: 2; // 00b (byte mode), 10b (sector mode)
- UINT32 Busy: 1; // This bit is set to LOW if the card has not finished the power up routine
-}OCR;
-
-typedef struct {
- UINT32 NOT_USED; // 1 [0:0]
- UINT32 CRC; // CRC7 checksum [7:1]
- UINT32 MDT; // Manufacturing date [19:8]
- UINT32 RESERVED_1; // Reserved [23:20]
- UINT32 PSN; // Product serial number [55:24]
- UINT8 PRV; // Product revision [63:56]
- UINT8 PNM[5]; // Product name [64:103]
- UINT16 OID; // OEM/Application ID [119:104]
- UINT8 MID; // Manufacturer ID [127:120]
-}CID;
-
-typedef struct {
- UINT8 NOT_USED: 1; // Not used, always 1 [0:0]
- UINT8 CRC: 7; // CRC [7:1]
-
- UINT8 RESERVED_1: 2; // Reserved [9:8]
- UINT8 FILE_FORMAT: 2; // File format [11:10]
- UINT8 TMP_WRITE_PROTECT: 1; // Temporary write protection [12:12]
- UINT8 PERM_WRITE_PROTECT: 1; // Permanent write protection [13:13]
- UINT8 COPY: 1; // Copy flag (OTP) [14:14]
- UINT8 FILE_FORMAT_GRP: 1; // File format group [15:15]
-
- UINT16 RESERVED_2: 5; // Reserved [20:16]
- UINT16 WRITE_BL_PARTIAL: 1; // Partial blocks for write allowed [21:21]
- UINT16 WRITE_BL_LEN: 4; // Max. write data block length [25:22]
- UINT16 R2W_FACTOR: 3; // Write speed factor [28:26]
- UINT16 RESERVED_3: 2; // Reserved [30:29]
- UINT16 WP_GRP_ENABLE: 1; // Write protect group enable [31:31]
-
- UINT32 WP_GRP_SIZE: 7; // Write protect group size [38:32]
- UINT32 SECTOR_SIZE: 7; // Erase sector size [45:39]
- UINT32 ERASE_BLK_EN: 1; // Erase single block enable [46:46]
- UINT32 C_SIZE_MULT: 3; // Device size multiplier [49:47]
- UINT32 VDD_W_CURR_MAX: 3; // Max. write current @ VDD max [52:50]
- UINT32 VDD_W_CURR_MIN: 3; // Max. write current @ VDD min [55:53]
- UINT32 VDD_R_CURR_MAX: 3; // Max. read current @ VDD max [58:56]
- UINT32 VDD_R_CURR_MIN: 3; // Max. read current @ VDD min [61:59]
- UINT32 C_SIZELow2: 2; // Device size [63:62]
-
- UINT32 C_SIZEHigh10: 10;// Device size [73:64]
- UINT32 RESERVED_4: 2; // Reserved [75:74]
- UINT32 DSR_IMP: 1; // DSR implemented [76:76]
- UINT32 READ_BLK_MISALIGN: 1; // Read block misalignment [77:77]
- UINT32 WRITE_BLK_MISALIGN: 1; // Write block misalignment [78:78]
- UINT32 READ_BL_PARTIAL: 1; // Partial blocks for read allowed [79:79]
- UINT32 READ_BL_LEN: 4; // Max. read data block length [83:80]
- UINT32 CCC: 12;// Card command classes [95:84]
-
- UINT8 TRAN_SPEED ; // Max. bus clock frequency [103:96]
- UINT8 NSAC ; // Data read access-time 2 in CLK cycles (NSAC*100) [111:104]
- UINT8 TAAC ; // Data read access-time 1 [119:112]
-
- UINT8 RESERVED_5: 6; // Reserved [125:120]
- UINT8 CSD_STRUCTURE: 2; // CSD structure [127:126]
-}CSD;
-
-typedef struct {
- UINT8 NOT_USED: 1; // Not used, always 1 [0:0]
- UINT8 CRC: 7; // CRC [7:1]
- UINT8 RESERVED_1: 2; // Reserved [9:8]
- UINT8 FILE_FORMAT: 2; // File format [11:10]
- UINT8 TMP_WRITE_PROTECT: 1; // Temporary write protection [12:12]
- UINT8 PERM_WRITE_PROTECT: 1; // Permanent write protection [13:13]
- UINT8 COPY: 1; // Copy flag (OTP) [14:14]
- UINT8 FILE_FORMAT_GRP: 1; // File format group [15:15]
- UINT16 RESERVED_2: 5; // Reserved [20:16]
- UINT16 WRITE_BL_PARTIAL: 1; // Partial blocks for write allowed [21:21]
- UINT16 WRITE_BL_LEN: 4; // Max. write data block length [25:22]
- UINT16 R2W_FACTOR: 3; // Write speed factor [28:26]
- UINT16 RESERVED_3: 2; // Reserved [30:29]
- UINT16 WP_GRP_ENABLE: 1; // Write protect group enable [31:31]
- UINT16 WP_GRP_SIZE: 7; // Write protect group size [38:32]
- UINT16 SECTOR_SIZE: 7; // Erase sector size [45:39]
- UINT16 ERASE_BLK_EN: 1; // Erase single block enable [46:46]
- UINT16 RESERVED_4: 1; // Reserved [47:47]
- UINT32 C_SIZELow16: 16;// Device size [69:48]
- UINT32 C_SIZEHigh6: 6; // Device size [69:48]
- UINT32 RESERVED_5: 6; // Reserved [75:70]
- UINT32 DSR_IMP: 1; // DSR implemented [76:76]
- UINT32 READ_BLK_MISALIGN: 1; // Read block misalignment [77:77]
- UINT32 WRITE_BLK_MISALIGN: 1; // Write block misalignment [78:78]
- UINT32 READ_BL_PARTIAL: 1; // Partial blocks for read allowed [79:79]
- UINT16 READ_BL_LEN: 4; // Max. read data block length [83:80]
- UINT16 CCC: 12;// Card command classes [95:84]
- UINT8 TRAN_SPEED ; // Max. bus clock frequency [103:96]
- UINT8 NSAC ; // Data read access-time 2 in CLK cycles (NSAC*100) [111:104]
- UINT8 TAAC ; // Data read access-time 1 [119:112]
- UINT8 RESERVED_6: 6; // 0 [125:120]
- UINT8 CSD_STRUCTURE: 2; // CSD structure [127:126]
-}CSD_SDV2;
-
-typedef enum {
- UNKNOWN_CARD,
- MMC_CARD, //MMC card
- SD_CARD, //SD 1.1 card
- SD_CARD_2, //SD 2.0 or above standard card
- SD_CARD_2_HIGH //SD 2.0 or above high capacity card
-} CARD_TYPE;
-
-typedef enum {
- READ,
- WRITE
-} OPERATION_TYPE;
-
-typedef struct {
- UINT16 RCA;
- UINTN BlockSize;
- UINTN NumBlocks;
- UINTN ClockFrequencySelect;
- CARD_TYPE CardType;
- OCR OCRData;
- CID CIDData;
- CSD CSDData;
-} CARD_INFO;
-
-EFI_STATUS
-DetectCard (
- VOID
- );
-
-extern EFI_BLOCK_IO_PROTOCOL gBlockIo;
-
-#endif
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf b/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
deleted file mode 100755
index b50e769d1..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = SDHCDxe
- FILE_GUID = e7c3d754-8688-4586-b38f-4ae9b74b8ff1
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = SDHCInitialize
-
-
-[Sources.common]
- SDHCDxe.c
-
-[Packages]
- MdePkg/MdePkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
- SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec
-
-[LibraryClasses]
- UefiDriverEntryPoint
- IoLib
- TimerLib
-
-[Guids]
-
-[Protocols]
- gEfiBlockIoProtocolGuid
- gEfiDevicePathProtocolGuid
- gSamsungPlatformGpioProtocolGuid ## GPIO Protocol
-
-[FixedPcd]
- gExynosPkgTokenSpaceGuid.PcdCmuBase
- gExynosPkgTokenSpaceGuid.PcdSdMmcBase
-
-[Depex]
- TRUE
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.c b/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.c
deleted file mode 100755
index ea245343d..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/** @file
- Template for Timer Architecture Protocol driver of the ARM flavor
-
- Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-
- 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 <PiDxe.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Library/PcdLib.h>
-#include <Library/IoLib.h>
-
-#include <Protocol/Timer.h>
-#include <Protocol/HardwareInterrupt.h>
-
-#include <Library/ExynosTimerLib.h>
-#include <Platform/ArmPlatform.h>
-
-// The notification function to call on every timer interrupt.
-volatile EFI_TIMER_NOTIFY mTimerNotifyFunction = (EFI_TIMER_NOTIFY)NULL;
-EFI_EVENT EfiExitBootServicesEvent = (EFI_EVENT)NULL;
-
-// The current period of the timer interrupt
-volatile UINT64 mTimerPeriod = 0;
-
-// Cached copy of the Hardware Interrupt protocol instance
-EFI_HARDWARE_INTERRUPT_PROTOCOL *gInterrupt = NULL;
-
-// Cached interrupt vector
-UINTN gVector;
-
-UINT32 mLastTickCount;
-
-/**
-
- C Interrupt Handler called in the interrupt context when Source interrupt is active.
-
-
- @param Source Source of the interrupt. Hardware routing off a specific platform defines
- what source means.
-
- @param SystemContext Pointer to system register context. Mostly used by debuggers and will
- update the system context after the return from the interrupt if
- modified. Don't change these values unless you know what you are doing
-
-**/
-VOID
-EFIAPI
-TimerInterruptHandler (
- IN HARDWARE_INTERRUPT_SOURCE Source,
- IN EFI_SYSTEM_CONTEXT SystemContext
- )
-{
- EFI_TPL OriginalTPL;
- UINT32 IntStatus;
- UINT32 PWMTimerBase;
- EFI_STATUS Status;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- //
- // DXE core uses this callback for the EFI timer tick. The DXE core uses locks
- // that raise to TPL_HIGH and then restore back to current level. Thus we need
- // to make sure TPL level is set to TPL_HIGH while we are handling the timer tick.
- //
- OriginalTPL = gBS->RaiseTPL (TPL_HIGH_LEVEL);
-
- // clear the interrupt
- IntStatus = MmioRead32 (PWMTimerBase + PWM_TINT_CSTAT_OFFSET);
- if(IntStatus & TIMER_STATUS_MASK(TIMER_0)){
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(IntStatus | TIMER_STATUS_MASK(TIMER_0)));
- Status = RETURN_SUCCESS;
- DEBUG ((EFI_D_INFO, "\nTimer 0 ISR\n"));
- }
- if(IntStatus & TIMER_STATUS_MASK(TIMER_1)){
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(IntStatus | TIMER_STATUS_MASK(TIMER_1)));
- Status = RETURN_SUCCESS;
- DEBUG ((EFI_D_INFO, "\nTimer 1 ISR\n"));
- }
- if(IntStatus & TIMER_STATUS_MASK(TIMER_2)){
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(IntStatus | TIMER_STATUS_MASK(TIMER_2)));
- Status = RETURN_SUCCESS;
- DEBUG ((EFI_D_INFO, "\nTimer 2 ISR\n"));
- }
- if(IntStatus & TIMER_STATUS_MASK(TIMER_3)){
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(IntStatus | TIMER_STATUS_MASK(TIMER_3)));
- Status = RETURN_SUCCESS;
- DEBUG ((EFI_D_INFO, "\nTimer 3 ISR\n"));
- }
- if(IntStatus & TIMER_STATUS_MASK(TIMER_4)){
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(IntStatus | TIMER_STATUS_MASK(TIMER_4)));
- Status = RETURN_SUCCESS;
- DEBUG ((EFI_D_INFO, "\nTimer 4 ISR\n"));
- }
- if(EFI_ERROR(Status)){
- Status = RETURN_UNSUPPORTED;
- ASSERT_EFI_ERROR(FALSE);
- }
- // signal end of interrupt early to help avoid losing subsequent ticks from long duration handlers
- gInterrupt->EndOfInterrupt (gInterrupt, Source);
-
- if (mTimerNotifyFunction) {
- mTimerNotifyFunction (mTimerPeriod);
- }
-
- gBS->RestoreTPL (OriginalTPL);
-}
-
-/**
- This function registers the handler NotifyFunction so it is called every time
- the timer interrupt fires. It also passes the amount of time since the last
- handler call to the NotifyFunction. If NotifyFunction is NULL, then the
- handler is unregistered. If the handler is registered, then EFI_SUCCESS is
- returned. If the CPU does not support registering a timer interrupt handler,
- then EFI_UNSUPPORTED is returned. If an attempt is made to register a handler
- when a handler is already registered, then EFI_ALREADY_STARTED is returned.
- If an attempt is made to unregister a handler when a handler is not registered,
- then EFI_INVALID_PARAMETER is returned. If an error occurs attempting to
- register the NotifyFunction with the timer interrupt, then EFI_DEVICE_ERROR
- is returned.
-
- @param This The EFI_TIMER_ARCH_PROTOCOL instance.
- @param NotifyFunction The function to call when a timer interrupt fires. This
- function executes at TPL_HIGH_LEVEL. The DXE Core will
- register a handler for the timer interrupt, so it can know
- how much time has passed. This information is used to
- signal timer based events. NULL will unregister the handler.
- @retval EFI_SUCCESS The timer handler was registered.
- @retval EFI_UNSUPPORTED The platform does not support timer interrupts.
- @retval EFI_ALREADY_STARTED NotifyFunction is not NULL, and a handler is already
- registered.
- @retval EFI_INVALID_PARAMETER NotifyFunction is NULL, and a handler was not
- previously registered.
- @retval EFI_DEVICE_ERROR The timer handler could not be registered.
-
-**/
-EFI_STATUS
-EFIAPI
-TimerDriverRegisterHandler (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN EFI_TIMER_NOTIFY NotifyFunction
- )
-{
- if ((NotifyFunction == NULL) && (mTimerNotifyFunction == NULL)) {
- return EFI_INVALID_PARAMETER;
- }
-
- if ((NotifyFunction != NULL) && (mTimerNotifyFunction != NULL)) {
- return EFI_ALREADY_STARTED;
- }
-
- DEBUG ((EFI_D_INFO, "Handler Registered Successfully\n"));
- mTimerNotifyFunction = NotifyFunction;
-
- return EFI_SUCCESS;
-}
-
-/**
- Make sure all ArrmVe Timers are disabled
-**/
-VOID
-EFIAPI
-ExitBootServicesEvent (
- IN EFI_EVENT Event,
- IN VOID *Context
- )
-{
- UINT32 PWMTimerBase;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- // All PWM timer is off
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), 0);
- DEBUG ((EFI_D_INFO, "\nTimer Exit\n"));
-}
-
-/**
-
- This function adjusts the period of timer interrupts to the value specified
- by TimerPeriod. If the timer period is updated, then the selected timer
- period is stored in EFI_TIMER.TimerPeriod, and EFI_SUCCESS is returned. If
- the timer hardware is not programmable, then EFI_UNSUPPORTED is returned.
- If an error occurs while attempting to update the timer period, then the
- timer hardware will be put back in its state prior to this call, and
- EFI_DEVICE_ERROR is returned. If TimerPeriod is 0, then the timer interrupt
- is disabled. This is not the same as disabling the CPU's interrupts.
- Instead, it must either turn off the timer hardware, or it must adjust the
- interrupt controller so that a CPU interrupt is not generated when the timer
- interrupt fires.
-
- @param This The EFI_TIMER_ARCH_PROTOCOL instance.
- @param TimerPeriod The rate to program the timer interrupt in 100 nS units. If
- the timer hardware is not programmable, then EFI_UNSUPPORTED is
- returned. If the timer is programmable, then the timer period
- will be rounded up to the nearest timer period that is supported
- by the timer hardware. If TimerPeriod is set to 0, then the
- timer interrupts will be disabled.
-
-
- @retval EFI_SUCCESS The timer period was changed.
- @retval EFI_UNSUPPORTED The platform cannot change the period of the timer interrupt.
- @retval EFI_DEVICE_ERROR The timer period could not be changed due to a device error.
-
-**/
-EFI_STATUS
-EFIAPI
-TimerDriverSetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- IN UINT64 TimerPeriod
- )
-{
- EFI_STATUS Status;
- UINT64 TimerTicks;
- UINT32 rwVal;
- UINT32 PWMTimerBase;
-
- DEBUG ((EFI_D_INFO, "\nSetTimer called\n"));
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- // Stop PWM timer 0
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET),STOP_TIMER_VAL(TIMER_0));
-
- if (TimerPeriod == 0) {
- // leave timer disabled from above, and...
- rwVal = MmioRead32 (PWMTimerBase + PWM_TINT_CSTAT_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET),(rwVal & ~TIMER_INTR_MASK(TIMER_0)));
- // disable timer 0/1 interrupt for a TimerPeriod of 0
- Status = gInterrupt->DisableInterruptSource (gInterrupt, gVector);
- } else {
- // Convert TimerPeriod into 1MHz clock counts (us units = 100ns units / 10)
- TimerTicks = DivU64x32 (TimerPeriod, 10);
- // if it's larger than 32-bits, pin to highest value
- if (TimerTicks > 0xffffffff) {
- TimerTicks = 0xffffffff;
- }
-
- // PWM Timer 0 used by Period counter with Auto re-load mode
- MmioWrite32 ((PWMTimerBase + PWM_TCNTB0_OFFSET), TimerTicks);
- // Set and Clear PWM Manually update for Timer 0
- rwVal = MmioRead32 (PWMTimerBase + PWM_TCON_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | UPDATE_COUNT_BUF_MASK(TIMER_0));
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal & ~UPDATE_COUNT_BUF_MASK(TIMER_0));
-
- // Set Auto re-load and start Timer
- MmioWrite32 ((PWMTimerBase + PWM_TCON_OFFSET), rwVal | RELOAD_AND_START(TIMER_0));
-
- //PWM Timer0 INT enable
- rwVal = MmioRead32 (PWMTimerBase + PWM_TINT_CSTAT_OFFSET);
- MmioWrite32 ((PWMTimerBase + PWM_TINT_CSTAT_OFFSET), rwVal | TIMER_INTR_MASK(TIMER_0) );
-
- Status = gInterrupt->EnableInterruptSource (gInterrupt, gVector);
- }
-
- // Save the new timer period
- mTimerPeriod = TimerPeriod;
- return Status;
-}
-
-/**
- This function retrieves the period of timer interrupts in 100 ns units,
- returns that value in TimerPeriod, and returns EFI_SUCCESS. If TimerPeriod
- is NULL, then EFI_INVALID_PARAMETER is returned. If a TimerPeriod of 0 is
- returned, then the timer is currently disabled.
-
- @param This The EFI_TIMER_ARCH_PROTOCOL instance.
- @param TimerPeriod A pointer to the timer period to retrieve in 100 ns units. If
- 0 is returned, then the timer is currently disabled.
-
-
- @retval EFI_SUCCESS The timer period was returned in TimerPeriod.
- @retval EFI_INVALID_PARAMETER TimerPeriod is NULL.
-
-**/
-EFI_STATUS
-EFIAPI
-TimerDriverGetTimerPeriod (
- IN EFI_TIMER_ARCH_PROTOCOL *This,
- OUT UINT64 *TimerPeriod
- )
-{
- if (TimerPeriod == NULL) {
- return EFI_INVALID_PARAMETER;
- }
-
- *TimerPeriod = mTimerPeriod;
- return EFI_SUCCESS;
-}
-
-/**
- This function generates a soft timer interrupt. If the platform does not support soft
- timer interrupts, then EFI_UNSUPPORTED is returned. Otherwise, EFI_SUCCESS is returned.
- If a handler has been registered through the EFI_TIMER_ARCH_PROTOCOL.RegisterHandler()
- service, then a soft timer interrupt will be generated. If the timer interrupt is
- enabled when this service is called, then the registered handler will be invoked. The
- registered handler should not be able to distinguish a hardware-generated timer
- interrupt from a software-generated timer interrupt.
-
- @param This The EFI_TIMER_ARCH_PROTOCOL instance.
-
- @retval EFI_SUCCESS The soft timer interrupt was generated.
- @retval EFI_UNSUPPORTED The platform does not support the generation of soft timer interrupts.
-
-**/
-EFI_STATUS
-EFIAPI
-TimerDriverGenerateSoftInterrupt (
- IN EFI_TIMER_ARCH_PROTOCOL *This
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-/**
- Interface structure for the Timer Architectural Protocol.
-
- @par Protocol Description:
- This protocol provides the services to initialize a periodic timer
- interrupt, and to register a handler that is called each time the timer
- interrupt fires. It may also provide a service to adjust the rate of the
- periodic timer interrupt. When a timer interrupt occurs, the handler is
- passed the amount of time that has passed since the previous timer
- interrupt.
-
- @param RegisterHandler
- Registers a handler that will be called each time the
- timer interrupt fires. TimerPeriod defines the minimum
- time between timer interrupts, so TimerPeriod will also
- be the minimum time between calls to the registered
- handler.
-
- @param SetTimerPeriod
- Sets the period of the timer interrupt in 100 nS units.
- This function is optional, and may return EFI_UNSUPPORTED.
- If this function is supported, then the timer period will
- be rounded up to the nearest supported timer period.
-
-
- @param GetTimerPeriod
- Retrieves the period of the timer interrupt in 100 nS units.
-
- @param GenerateSoftInterrupt
- Generates a soft timer interrupt that simulates the firing of
- the timer interrupt. This service can be used to invoke the registered handler if the timer interrupt has been masked for
- a period of time.
-
-**/
-EFI_TIMER_ARCH_PROTOCOL gTimer = {
- TimerDriverRegisterHandler,
- TimerDriverSetTimerPeriod,
- TimerDriverGetTimerPeriod,
- TimerDriverGenerateSoftInterrupt
-};
-
-
-/**
- Initialize the state information for the Timer Architectural Protocol and
- the Timer Debug support protocol that allows the debugger to break into a
- running program.
-
- @param ImageHandle of the loaded driver
- @param SystemTable Pointer to the System Table
-
- @retval EFI_SUCCESS Protocol registered
- @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure
- @retval EFI_DEVICE_ERROR Hardware problems
-
-**/
-EFI_STATUS
-EFIAPI
-TimerInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_HANDLE Handle = NULL;
- EFI_STATUS Status;
-
- UINT32 Tmp;
- UINT32 PWMTimerBase;
-
- PWMTimerBase=PcdGet32(PcdPWMTimerBase);
- // Find the interrupt controller protocol. ASSERT if not found.
- Status = gBS->LocateProtocol (&gHardwareInterruptProtocolGuid, NULL, (VOID **)&gInterrupt);
- ASSERT_EFI_ERROR (Status);
-
- // PWM Input source clock is 100Mhz and Configure 1Mhz for PWM Timer
- Tmp = MmioRead32 (PWMTimerBase + PWM_TCFG0_OFFSET);
- Tmp &= ~(0xFF << PRESCALE_GRP0_START_POS);
- Tmp |= (PRESCALE_TIMER_GRP0 << PRESCALE_GRP0_START_POS);
- MmioWrite32 ((PWMTimerBase + PWM_TCFG0_OFFSET), Tmp);
- MmioWrite32 ((PWMTimerBase + PWM_TCFG1_OFFSET), 0);
-
- // Disable the timer
- Status = TimerDriverSetTimerPeriod (&gTimer, 0);
- ASSERT_EFI_ERROR (Status);
-
- // Install interrupt handler
- gVector = PWM_TIMER0_INTERRUPT_NUM;
- Status = gInterrupt->RegisterInterruptSource (gInterrupt, gVector, TimerInterruptHandler);
- ASSERT_EFI_ERROR (Status);
-
- // PWM Timer 0 used by Period counter with Auto re-load mode
- MmioWrite32 ((PWMTimerBase + PWM_TCNTB0_OFFSET), FixedPcdGet32(PcdTimerPeriod));
- Status = TimerDriverSetTimerPeriod (&gTimer, FixedPcdGet32(PcdTimerPeriod));
- ASSERT_EFI_ERROR (Status);
-
- // Install the Timer Architectural Protocol onto a new handle
- Status = gBS->InstallMultipleProtocolInterfaces(
- &Handle,
- &gEfiTimerArchProtocolGuid, &gTimer,
- NULL
- );
- ASSERT_EFI_ERROR(Status);
-
- // Register for an ExitBootServicesEvent
- Status = gBS->CreateEvent (EVT_SIGNAL_EXIT_BOOT_SERVICES, TPL_NOTIFY, ExitBootServicesEvent, NULL, &EfiExitBootServicesEvent);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}
diff --git a/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf b/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
deleted file mode 100755
index 1dba208c4..000000000
--- a/SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
+++ /dev/null
@@ -1,54 +0,0 @@
-#/** @file
-#
-# Component discription file for Timer module
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-# 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 = TimerDxe
- FILE_GUID = 494ffd22-3228-4b7e-ad40-7e780fa88301
- MODULE_TYPE = DXE_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = TimerInitialize
-
-[Sources.common]
- TimerDxe.c
-
-[Packages]
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
- MdePkg/MdePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
-
-
-[LibraryClasses]
- BaseLib
- IoLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- TimerLib
-
-[Guids]
-
-[Protocols]
- gEfiTimerArchProtocolGuid
- gHardwareInterruptProtocolGuid
-
-
-[Pcd.common]
- gEmbeddedTokenSpaceGuid.PcdTimerPeriod
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase
-[Depex]
- gHardwareInterruptProtocolGuid
diff --git a/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc b/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
deleted file mode 100644
index 8ac043d7f..000000000
--- a/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.dsc
+++ /dev/null
@@ -1,480 +0,0 @@
-#
-# Copyright (c) 2011, Samsung Electronics Co. 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 = OrigenBoard-Exynos
- PLATFORM_GUID = 66a5a01d-be0a-4398-9b74-5af4a261381f
- PLATFORM_VERSION = 0.1
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/OrigenBoard-Exynos
- SUPPORTED_ARCHITECTURES = ARM
- BUILD_TARGETS = DEBUG|RELEASE
- SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
-
-[LibraryClasses.common]
-!if $(TARGET) == RELEASE
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
-!else
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
-!endif
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
- ArmPlatformLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
- ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- EfiResetSystemLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf
- EblCmdLib|ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
- EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf
- PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
- ArmSmcLib|ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf
-
- #
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window
- # in the debugger will show load and unload commands for symbols. You can cut and paste this
- # into the command window to load symbols. We should be able to use a script to do this, but
- # the version of RVD I have does not support scripts accessing system memory.
- #
- CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
- DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
-
-#
-# Assume everything is fixed at build
-#
- ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
- CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
- DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
- DebugAgentTimerLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
- EblAddExternalCommandLib|EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf
- EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- SerialPortLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf
- SerialPortExtLib|EmbeddedPkg/Library/TemplateSerialPortExtLib/TemplateSerialPortExtLib.inf
- TimerLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf
- UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-
- # Samsung specific
- BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
- DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
- FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf
- GdbSerialLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf
-
- # iky for usb host
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
- UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
-
-[LibraryClasses.common.SEC]
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
- ArmTrustedMonitorLib|ArmPlatformPkg/Library/ArmTrustedMonitorLibNull/ArmTrustedMonitorLibNull.inf
- ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- ArmPlatformSecLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- # L2 Cache Driver
- L2X0CacheLib|ArmPlatformPkg/Drivers/PL310L2Cache/PL310L2CacheSec.inf
-
-!if $(EDK2_SKIP_PEICORE)==1
- PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
- ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
- LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
- MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
- HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
- PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
- PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
- MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf
-!endif
-
-[LibraryClasses.common.PEI_CORE]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- # note: this won't actually work since globals in PEI are not writeable
- # need to generate an ARM PEI services table pointer implementation
- PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
- PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.PEIM]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- # note: this won't actually work since globals in PEI are not writeable
- # need to generate an ARM PEI services table pointer implementation
- PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.DXE_CORE]
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
- ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
- MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
-
-[LibraryClasses.common.UEFI_APPLICATION]
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
- ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
-DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
-
-[LibraryClasses.ARM]
- #
- # It is not possible to prevent the ARM compiler for generic intrinsic functions.
- # This library provides the instrinsic functions generate by a given compiler.
- # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
-[BuildOptions]
- RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A9 --thumb --fpu=softvfp -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- GCC:*_*_ARM_ARCHCC_FLAGS == -march=armv7-a -mthumb -mthumb-interwork -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- GCC:*_*_ARM_ARCHASM_FLAGS == -march=armv7-a -mthumb-interwork -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- GCC:*_*_ARM_CC_FLAGS = -Os -mword-relocations -mfpu=vfp -ffixed-r8
- GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- XCODE:*_*_ARM_ARCHCC_FLAGS == -arch armv7 -march=armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:*_*_ARM_ARCHASM_FLAGS == -arch armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
-
-################################################################################
-#
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-
-[PcdsFeatureFlag.common]
- gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
- gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE
- gArmPlatformTokenSpaceGuid.PcdStandalone|TRUE
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE
- gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
-
-!if $(EDK2_SKIP_PEICORE) == 1
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE
- gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE
-!endif
-
-[PcdsFixedAtBuild.common]
- gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"ORIGEN %"
- gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|32
- gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0
- gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000
- gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0xAF
- gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|1
- gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0
- gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320
-
-# DEBUG_ASSERT_ENABLED 0x01
-# DEBUG_PRINT_ENABLED 0x02
-# DEBUG_CODE_ENABLED 0x04
-# CLEAR_MEMORY_ENABLED 0x08
-# ASSERT_BREAKPOINT_ENABLED 0x10
-# ASSERT_DEADLOOP_ENABLED 0x20
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
-
-# DEBUG_INIT 0x00000001 // Initialization
-# DEBUG_WARN 0x00000002 // Warnings
-# DEBUG_LOAD 0x00000004 // Load events
-# DEBUG_FS 0x00000008 // EFI File system
-# DEBUG_POOL 0x00000010 // Alloc & Free's
-# DEBUG_PAGE 0x00000020 // Alloc & Free's
-# DEBUG_INFO 0x00000040 // Verbose
-# DEBUG_DISPATCH 0x00000080 // PEI/DXE Dispatchers
-# DEBUG_VARIABLE 0x00000100 // Variable
-# DEBUG_BM 0x00000400 // Boot Manager
-# DEBUG_BLKIO 0x00001000 // BlkIo Driver
-# DEBUG_NET 0x00004000 // SNI Driver
-# DEBUG_UNDI 0x00010000 // UNDI Driver
-# DEBUG_LOADFILE 0x00020000 // UNDI Driver
-# DEBUG_EVENT 0x00080000 // Event messages
-# DEBUG_ERROR 0x80000000 // Error
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
- gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
- gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""
- gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07
- gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000
-
-#
-# Optional feature to help prevent EFI memory map fragments
-# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob
-# Values are in EFI Pages (4K). DXE Core will make sure that
-# at least this much of each type of memory can be allocated
-# from a single memory range. This way you only end up with
-# maximum of two fragements for each type in the memory map
-# (the memory used, and the free memory that was prereserved
-# but not used).
-#
- gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x00000000
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x01000000
- # Stacks for MPCores in Secure World
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x4B000000 # Top of SEC Stack for Secure World
- gArmPlatformTokenSpaceGuid.PcdSecGlobalVariableSize|0x100
-
- # Stacks for MPCores in Monitor Mode
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x4A000000 # Top of SEC Stack for Monitor World
- gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x2000 # Stack for each of the 4 CPU cores
- gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x48000000
- gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
-
- # Stacks for MPCores in Normal World
- gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 # expressed in 100ns units, 100,000 x 100 ns = 10,000,000 ns = 10 ms
- gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000
- gArmTokenSpaceGuid.PcdSystemMemorySize|0x10000000
- gArmTokenSpaceGuid.PcdArmPrimaryCoreMask|0x0f
- gArmTokenSpaceGuid.PcdArmPrimaryCore|0x00
- gArmTokenSpaceGuid.PcdTrustzoneSupport|FALSE
- #
- # ARM Pcds
- #
- gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000
- #
- # ARM EB PCDS
- #
- gExynosPkgTokenSpaceGuid.PcdGdbUartBase|0x1000a000
- gExynosPkgTokenSpaceGuid.PcdConsoleUartBase|0x13820000
- gExynosPkgTokenSpaceGuid.PcdCmuBase|0x10030000
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase|0x139d0000
- gExynosPkgTokenSpaceGuid.PcdPmuBase|0x10020000
- gExynosPkgTokenSpaceGuid.PcdGpioPart1Base|0x11400000
- gExynosPkgTokenSpaceGuid.PcdGpioPart2Base|0x11000000
- gExynosPkgTokenSpaceGuid.PcdSdMmcBase|0x12530000
- gExynosPkgTokenSpaceGuid.PcdSysBase|0x10010000
- gExynosPkgTokenSpaceGuid.PcdFIMD0Base|0x11C00000
- gExynosPkgTokenSpaceGuid.PcdGICBase|0x10500000
- gExynosPkgTokenSpaceGuid.PcdTZPCBase|0x10100000
- #
- # ARM PL390 General Interrupt Controller
- #
- gArmTokenSpaceGuid.PcdGicDistributorBase|0x10490000
- gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x10480000
-
- #
- # ARM OS Loader
- #
- #gArmTokenSpaceGuid.PcdArmMachineType|2925
- gArmTokenSpaceGuid.PcdArmMachineType |3455
- gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SD-MMC Booting"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x0B917605,0x1002,0x8000)/uImage"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/mmcblk0p2 rw rootwait console=ttySAC2,115200n8 init=/linuxrc"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1
- gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|L"Samsung Origen Board"
-
-
-
-# Use the Serial console (ConIn & ConOut) and the Graphic driver (ConOut)
- gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(c5deae31-fad2-4030-841b-cfc9644d2c5b)"
- gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
- gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|10
-
- #
- # ARM L2x0 PCDs
- #
- gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x10502000
-
-################################################################################
-#
-# Components Section - list of all EDK II Modules needed by this Platform
-#
-################################################################################
-[Components.common]
-
-#
-# SEC
-#
- ArmPlatformPkg/Sec/Sec.inf
-
-#
-# PEI Phase modules
-#
-!if $(EDK2_SKIP_PEICORE) == 1
- ArmPlatformPkg/PrePi/PeiMPCore.inf {
- <LibraryClasses>
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
- ArmPlatformLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.inf
- }
-!else
- ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf {
- <LibraryClasses>
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- }
- MdeModulePkg/Core/Pei/PeiMain.inf
- MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
- <LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- }
- ArmPlatformPkg/PlatformPei/PlatformPeim.inf
- ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
- ArmPkg/Drivers/CpuPei/CpuPei.inf
- IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
- Nt32Pkg/BootModePei/BootModePei.inf
- MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {
- <LibraryClasses>
- NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
- }
-!endif
-
-#
-# DXE
-#
- MdeModulePkg/Core/Dxe/DxeMain.inf {
- <LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
- }
-
- #
- # Architectural Protocols
- #
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
- EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
- EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
- EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
-
- MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
- MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
- MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
- EmbeddedPkg/SerialDxe/SerialDxe.inf
-
- MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
- MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
- MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
- MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
- MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
- SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
-
- #
- # Samsung specific Driver
- #
- ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf{
- <LibraryClasses>
- ExynosLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
- }
-
- #
- # Semi-hosting filesystem
- #
- ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
-
- #
- # FAT filesystem + GPT/MBR partitioning
- #
- MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
- MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
- MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-
- #
- # Application
- #
- EmbeddedPkg/Ebl/Ebl.inf
-
- #
- # Bds
- #
- MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
- ArmPlatformPkg/Bds/Bds.inf
-
- MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf b/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
deleted file mode 100644
index 479729349..000000000
--- a/SamsungPlatformPkgOrigen/OrigenBoardPkg/OrigenBoardPkg-Exynos.fdf
+++ /dev/null
@@ -1,363 +0,0 @@
-# FLASH layout file for ARM VE.
-#
-# Copyright (c) 2011, Samsung Electronics Co. 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.
-#
-
-################################################################################
-#
-# FD Section
-# The [FD] Section is made up of the definition statements and a
-# description of what goes into the Flash Device Image. Each FD section
-# defines one flash "device" image. A flash device image may be one of
-# the following: Removable media bootable image (like a boot floppy
-# image,) an Option ROM image (that would be "flashed" into an add-in
-# card,) a System "Flash" image (that would be burned into a system's
-# flash) or an Update ("Capsule") image that will be used to update and
-# existing system flash.
-#
-################################################################################
-
-
-[FD.OrigenBoard_EFI]
-BaseAddress = 0x43E00000|gArmTokenSpaceGuid.PcdFdBaseAddress
-Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize
-ErasePolarity = 1
-BlockSize = 0x00010000
-NumBlocks = 0x20
-
-################################################################################
-#
-# Following are lists of FD Region layout which correspond to the locations of different
-# images within the flash device.
-#
-# Regions must be defined in ascending order and may not overlap.
-#
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
-# the pipe "|" character, followed by the size of the region, also in hex with the leading
-# "0x" characters. Like:
-# Offset|Size
-# PcdOffsetCName|PcdSizeCName
-# RegionType <FV, DATA, or FILE>
-#
-################################################################################
-
-0x0000000|0x00010000
-gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvSize
-FV = FVMAIN_SEC
-
-0x00010000|0x00100000
-gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
-FV = FVMAIN_COMPACT
-
-0x00110000|0x00010000
-gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
-#NV_VARIABLE_STORE
-DATA = {
- ## This is the EFI_FIRMWARE_VOLUME_HEADER
- # ZeroVector []
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- # FileSystemGuid: gEfiSystemNvDataFvGuid =
- # { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}
- 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,
- 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,
- # FvLength: 0x20000
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
- #Signature "_FVH" #Attributes
- 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,
- #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision
- 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,
- #Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
- #Blockmap[1]: End
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- ## This is the VARIABLE_STORE_HEADER
- #Signature: gEfiVariableGuid =
- # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
- 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,
- 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,
- #Size: 0x10000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xFFB8
- # This can speed up the Variable Dispatch a bit.
- 0xB8, 0xFF, 0x00, 0x00,
- #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32
- 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-}
-
-################################################################################
-#
-# FV Section
-#
-# [FV] section is used to define what components or modules are placed within a flash
-# device file. This section also defines order the components and modules are positioned
-# within the image. The [FV] section consists of define statements, set statements and
-# module statements.
-#
-################################################################################
-
-[FV.FVMAIN_SEC]
-FvAlignment = 8
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-
- INF ArmPlatformPkg/Sec/Sec.inf
-
-
-[FV.FVMAIN]
-BlockSize = 0x40
-NumBlocks = 0 # This FV gets compressed so make it just big enough
-FvAlignment = 8 # FV alignment and FV attributes setting.
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-
- INF MdeModulePkg/Core/Dxe/DxeMain.inf
-
- #
- # PI DXE Drivers producing Architectural Protocols (EFI Services)
- #
- INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
- INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
- INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
- INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
- INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
-
- INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
- INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
- INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
- INF EmbeddedPkg/SerialDxe/SerialDxe.inf
-
-
- INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
- INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
- INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
- INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
-
- INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
- INF SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
-
- #
- # ACPI Support
- #
-
- #
- # Samsung specific Driver
- #
- INF SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
- INF SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf
- #
- # PCI EMULATION
- #
- #
- # Semi-hosting filesystem
- #
- INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
-
- #
- # FAT filesystem + GPT/MBR partitioning
- #
- INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
- INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
- INF FatBinPkg/EnhancedFatDxe/Fat.inf
- INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-
- #
- # USB HOST STACK
- #
- INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
-
- #
- # UEFI application (Shell Embedded Boot Loader)
- #
- INF EmbeddedPkg/Ebl/Ebl.inf
-
-
- #
- # Bds
- #
- INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
- INF ArmPlatformPkg/Bds/Bds.inf
-
-[FV.FVMAIN_COMPACT]
-FvAlignment = 8
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-
-!if $(EDK2_SKIP_PEICORE) == 1
- INF ArmPlatformPkg/PrePi/PeiMPCore.inf
-!else
- INF ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
- INF MdeModulePkg/Core/Pei/PeiMain.inf
- INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf
- INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
- INF ArmPkg/Drivers/CpuPei/CpuPei.inf
- INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
- INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
- INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
- INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
-!endif
-
- FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
- SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
- SECTION FV_IMAGE = FVMAIN
- }
- }
-
-
-################################################################################
-#
-# Rules are use with the [FV] section's module INF type to define
-# how an FFS file is created for a given INF file. The following Rule are the default
-# rules for the different module type. User can add the customized rules to define the
-# content of the FFS file.
-#
-################################################################################
-
-
-############################################################################
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #
-############################################################################
-#
-#[Rule.Common.DXE_DRIVER]
-# FILE DRIVER = $(NAMED_GUID) {
-# DXE_DEPEX DXE_DEPEX Optional |.depex
-# COMPRESS PI_STD {
-# GUIDED {
-# PE32 PE32 |.efi
-# UI STRING="$(MODULE_NAME)" Optional
-# VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
-# }
-# }
-# }
-#
-############################################################################
-
-[Rule.Common.SEC]
- FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
- TE TE Align = 32 |.efi
- }
-
-[Rule.Common.PEI_CORE]
- FILE PEI_CORE = $(NAMED_GUID) {
- TE TE |.efi
- UI STRING ="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.PEIM]
- FILE PEIM = $(NAMED_GUID) {
- PEI_DEPEX PEI_DEPEX Optional |.depex
- TE TE |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.PEIM.TIANOCOMPRESSED]
- FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
- PEI_DEPEX PEI_DEPEX Optional |.depex
- GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
- }
-
-[Rule.Common.DXE_CORE]
- FILE DXE_CORE = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.DXE_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.DXE_RUNTIME_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_APPLICATION]
- FILE APPLICATION = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING ="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_APPLICATION.BINARY]
- FILE APPLICATION = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
-
-[Rule.Common.UEFI_DRIVER.BINARY]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
-
diff --git a/SamsungPlatformPkgOrigen/README b/SamsungPlatformPkgOrigen/README
deleted file mode 100644
index b34c1baea..000000000
--- a/SamsungPlatformPkgOrigen/README
+++ /dev/null
@@ -1,67 +0,0 @@
-
-=== SmdkBoard OVERVIEW ===
-
-The SMDK project aims to support firmware for Exynos 4210 Soc using the edk2
-code base.
-
-=== STATUS ===
-
-Current status: Alpha
-
-Current capabilities:
-* Uefi Boot from SDMMC card
-
-=== FUTURE PLANS ===
-
-* SUpport for USB
- - KeyBoard, Mouse and MassStorage
-
-=== BUILDING SMDK Board ===
-
-Pre-requisites:
-* Build environment capable of build the edk2 MdeModulePkg.
-* A properly configured ASL compiler:
- - Intel ASL compiler: Available from http://www.acpica.org
- - Microsoft ASL compiler: Available from http://www.acpi.info
-
-Building the iRam_Bl:
-The iRam_Bl is the 1st stage bootloader which is executed by the IROM code.
-This code is reused from the u-boot project. this image has to be a plane binary image
-which will not have any header format. After generating the binary image the checksum is generated
-and stored in the same file at a particular offset. that is done by the executable generated with
-the iRam_Bl source files.
-
-To generate the iRAM_Bl image
-* Download the u-boot source from git://git.denx.de/u-boot.git by running below command
- git clone git://git.denx.de/u-boot.git
-* Run following commands
- - export ARCH=arm
- - export CROSS_COMPILE=/usr/local/arm/gcc-linaro-4.5-2011.03-0/bin/arm-linux-gnueabi- or respective toolchain path
- - make smdkv310_config
- - make mmc_spl
-* the binary "u-boot-mmc-spl.bin" will be generated in the spl directory.
-* copy the generated u-boot-mmc-spl.bin to the Uefi Workspace Build/SmdkBoard-Exynos/RELEASE_ARMGCC/FV/
-
-
-Build the SdmkBoardPkg by running from the Workspace
- build -p SamsungPlatformPkg/SmdkBoardPkg/SmdkBoardPkg-Exynos.dsc -a ARM -t ARMGCC -b RELEASE for release version
-
-Following the edk2 build process, you will find the SMDK binaries
-under the $WORKSPACE/Build/*/*/FV directory. You can find the below
-mentioned binary image.
-* SMDKBOARD_EFI.FD
-* u-boot-mmc-spl.bin
-
-=== RUNNING SmdkBoardPkg on the SMDK v310 board ===
-* need to be in Linux Environment to do the below procedure
-* After inserting the SD card. unmount the card by using the command umount /media/XXXXX.
-* copy the u-boot-mmc-spl.bin to the SD/MMC card by using the comand
- sudo dd if=Build/SmdkBoard-Exynos/RELEASE_ARMGCC/FV/u-boot-mmc-spl.bin of=/dev/sdc bs=512 seek=1
-* Copy the Uefi Image to SD/MMC with below command from the Workspace.
- sudo dd if=Build/SmdkBoard-Exynos/RELEASE_ARMGCC/FV/SMDKBOARD_EFI.fd of=/dev/sdc bs=512 seek=65
-* Now the booting device is ready to be used.
-* Insert the SDMMC card in the v310 board reader slot MMC Ch2.
-* Connect the Uart cable from the v310 device to the PC terminal.
-* POwer ON the Device.
-* The boot message should be visible on the termial.
-* use option 1 to enter the Embedded Boot loader.
diff --git a/SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec b/SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec
deleted file mode 100644
index 02169ffb5..000000000
--- a/SamsungPlatformPkgOrigen/SamsungPlatformPkg.dec
+++ /dev/null
@@ -1,40 +0,0 @@
-#/** @file
-# Arm RealView EB package.
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-#
-# 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 = SamsungPlatformPkgOrigen
- PACKAGE_GUID = ec1a4982-4a00-47e7-8df5-69c8ce895427
- PACKAGE_VERSION = 0.1
-
-################################################################################
-#
-# Include Section - list of Include Paths that are provided by this package.
-# Comments are used for Keywords and Module Types.
-#
-# Supported Module Types:
-# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
-#
-################################################################################
-[Includes.common]
-
-[Guids.common]
-
-[PcdsFeatureFlag.common]
-
-[PcdsFixedAtBuild.common]
-
-[Protocols.common]
- gSamsungPlatformGpioProtocolGuid = { 0x82b4b2f7, 0x8c18, 0x4dbe, { 0xb7, 0x2e, 0x6a, 0x59, 0xd4, 0x23, 0x0c, 0x40 }}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/AcpiTables.inf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/AcpiTables.inf
deleted file mode 100644
index a40aac687..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/AcpiTables.inf
+++ /dev/null
@@ -1,37 +0,0 @@
-## @file
-# Component description file for PlatformAcpiTables module.
-#
-# ACPI table data and ASL sources required to boot the platform.
-#
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>
-# 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 = PlatformAcpiTables
- FILE_GUID = 7E374E25-8E01-4FEE-87F2-390C23C606CD
- MODULE_TYPE = USER_DEFINED
- VERSION_STRING = 1.0
-#
-# The following information is for reference only and not required by the
-# build tools.
-#
-# VALID_ARCHITECTURES =
-#
-
-[Sources]
- Platform.h
- Madt.aslc
- Facp.aslc
- Facs.aslc
- Dsdt.asl
-[Packages]
- MdePkg/MdePkg.dec
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Dsdt.asl b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Dsdt.asl
deleted file mode 100644
index ca2b17275..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Dsdt.asl
+++ /dev/null
@@ -1,446 +0,0 @@
-/** @file
- Contains root level name space objects for the platform
-
- Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
- 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.
-
-**/
-
-DefinitionBlock ("Dsdt.aml", "DSDT", 1, "EXYNOS", "4210 ", 3) {
- //
- // System Sleep States
- //
- Name (\_S0, Package () {5, 0, 0, 0})
- Name (\_S4, Package () {1, 0, 0, 0})
- Name (\_S5, Package () {0, 0, 0, 0})
-
- //
- // System Bus
- //
- Scope (\_SB) {
- //
- // PCI Root Bridge
- //
- Device (PCI0) {
- Name (_HID, EISAID ("PNP0A03"))
- Name (_ADR, 0x00000000)
- Name (_BBN, 0x00)
- Name (_UID, 0x00)
-
- //
- // BUS, I/O, and MMIO resources
- //
- Name (_CRS, ResourceTemplate () {
- // Bus number resource (0); the bridge produces bus numbers for its
- // subsequent buses
- WORDBusNumber (
- ResourceProducer, // bit 0 of general flags is 1
- MinFixed, // Range is fixed
- MaxFixed, // Range is fixed
- PosDecode, // PosDecode
- 0x0000, // Granularity
- 0x0000, // Min
- 0x00FF, // Max
- 0x0000, // Translation
- 0x0100 // Range Length = Max-Min+1
- )
-
- //Consumed resource (0xCF8-0xCFF)
- IO (Decode16, 0xCF8, 0xCF8, 0x01, 0x08)
-
- // Consumed-and-produced resource (all I/O below CF8)
- WORDIO (
- ResourceProducer, // bit 0 of general flags is 0
- MinFixed, // Range is fixed
- MaxFixed, // Range is fixed
- PosDecode,
- EntireRange,
- 0x0000, // Granularity
- 0x0000, // Min
- 0x0CF7, // Max
- 0x0000, // Translation
- 0x0CF8 // Range Length
- )
-
- WORDIO ( // Consumed-and-produced resource
- // (all I/O above CFF)
- ResourceProducer, // bit 0 of general flags is 0
- MinFixed, // Range is fixed
- MaxFixed, // Range is fixed
- PosDecode,
- EntireRange,
- 0x0000, // Granularity
- 0x0D00, // Min
- 0xFFFF, // Max
- 0x0000, // Translation
- 0xF300 // Range Length
- )
-
- DWORDMEMORY ( // Descriptor for legacy VGA video RAM
- ResourceProducer, // bit 0 of general flags is 0
- PosDecode,
- MinFixed, // Range is fixed
- MaxFixed, // Range is Fixed
- Cacheable,
- ReadWrite,
- 0x00000000, // Granularity
- 0x000A0000, // Min
- 0x000BFFFF, // Max
- 0x00000000, // Translation
- 0x00020000 // Range Length
- )
-
- DWORDMEMORY ( // Descriptor for linear frame buffer video RAM
- ResourceProducer, // bit 0 of general flags is 0
- PosDecode,
- MinFixed, // Range is fixed
- MaxFixed, // Range is Fixed
- Cacheable,
- ReadWrite,
- 0x00000000, // Granularity
- 0xF8000000, // Min
- 0xFFFBFFFF, // Max
- 0x00000000, // Translation
- 0x07FC0000 // Range Length
- )
- })
-
- //
- // PCI Interrupt Routing Table - PIC Mode Only
- //
- Method (_PRT, 0, NotSerialized) {
- Return (
- Package () {
- //
- // Bus 0, Device 1
- //
- Package () {0x0001FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00},
- Package () {0x0001FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00},
- Package () {0x0001FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00},
- Package () {0x0001FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00},
- //
- // Bus 0, Device 3
- //
- Package () {0x0003FFFF, 0x00, \_SB.PCI0.LPC.LNKA, 0x00},
- Package () {0x0003FFFF, 0x01, \_SB.PCI0.LPC.LNKB, 0x00},
- Package () {0x0003FFFF, 0x02, \_SB.PCI0.LPC.LNKC, 0x00},
- Package () {0x0003FFFF, 0x03, \_SB.PCI0.LPC.LNKD, 0x00},
- }
- )
- }
-
- //
- // PCI to ISA Bridge (Bus 0, Device 1, Function 0)
- //
- Device (LPC) {
- Name (_ADR, 0x00010000)
-
- //
- // PCI Interrupt Routing Configuration Registers
- //
- OperationRegion (PRR0, PCI_Config, 0x60, 0x04)
- Field (PRR0, ANYACC, NOLOCK, PRESERVE) {
- PIRA, 8,
- PIRB, 8,
- PIRC, 8,
- PIRD, 8
- }
-
- //
- // _STA method for LNKA, LNKB, LNKC, LNKD
- //
- Method (PSTA, 1, NotSerialized) {
- If (And (Arg0, 0x80)) {
- Return (0x9)
- } Else {
- Return (0xB)
- }
- }
-
- //
- // _DIS method for LNKA, LNKB, LNKC, LNKD
- //
- Method (PDIS, 1, NotSerialized) {
- Or (Arg0, 0x80, Arg0)
- }
-
- //
- // _CRS method for LNKA, LNKB, LNKC, LNKD
- //
- Method (PCRS, 1, NotSerialized) {
- Name (BUF0, ResourceTemplate () {IRQ (Level, ActiveLow, Shared){0}})
- //
- // Define references to buffer elements
- //
- CreateWordField (BUF0, 0x01, IRQW) // IRQ low
- //
- // Write current settings into IRQ descriptor
- //
- If (And (Arg0, 0x80)) {
- Store (Zero, Local0)
- } Else {
- Store (One, Local0)
- }
- //
- // Shift 1 by value in register 70
- //
- ShiftLeft (Local0, And (Arg0, 0x0F), IRQW) // Save in buffer
- Return (BUF0) // Return Buf0
- }
-
- //
- // _PRS resource for LNKA, LNKB, LNKC, LNKD
- //
- Name (PPRS, ResourceTemplate () {
- IRQ (Level, ActiveLow, Shared) {3, 4, 5, 7, 9, 10, 11, 12, 14, 15}
- })
-
- //
- // _SRS method for LNKA, LNKB, LNKC, LNKD
- //
- Method (PSRS, 2, NotSerialized) {
- CreateWordField (Arg1, 0x01, IRQW) // IRQ low
- FindSetRightBit (IRQW, Local0) // Set IRQ
- If (LNotEqual (IRQW, Zero)) {
- And (Local0, 0x7F, Local0)
- Decrement (Local0)
- } Else {
- Or (Local0, 0x80, Local0)
- }
- Store (Local0, Arg0)
- }
-
- //
- // PCI IRQ Link A
- //
- Device (LNKA) {
- Name (_HID, EISAID("PNP0C0F"))
- Name (_UID, 1)
-
- Method (_STA, 0, NotSerialized) { Return (PSTA (PIRA)) }
- Method (_DIS, 0, NotSerialized) { PDIS (PIRA) }
- Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRA)) }
- Method (_PRS, 0, NotSerialized) { Return (PPRS) }
- Method (_SRS, 1, NotSerialized) { PSRS (PIRA, Arg0) }
- }
-
- //
- // PCI IRQ Link B
- //
- Device (LNKB) {
- Name (_HID, EISAID("PNP0C0F"))
- Name (_UID, 2)
-
- Method (_STA, 0, NotSerialized) { Return (PSTA (PIRB)) }
- Method (_DIS, 0, NotSerialized) { PDIS (PIRB) }
- Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRB)) }
- Method (_PRS, 0, NotSerialized) { Return (PPRS) }
- Method (_SRS, 1, NotSerialized) { PSRS (PIRB, Arg0) }
- }
-
- //
- // PCI IRQ Link C
- //
- Device (LNKC) {
- Name (_HID, EISAID("PNP0C0F"))
- Name (_UID, 3)
-
- Method (_STA, 0, NotSerialized) { Return (PSTA (PIRC)) }
- Method (_DIS, 0, NotSerialized) { PDIS (PIRC) }
- Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRC)) }
- Method (_PRS, 0, NotSerialized) { Return (PPRS) }
- Method (_SRS, 1, NotSerialized) { PSRS (PIRC, Arg0) }
- }
-
- //
- // PCI IRQ Link D
- //
- Device (LNKD) {
- Name (_HID, EISAID("PNP0C0F"))
- Name (_UID, 1)
-
- Method (_STA, 0, NotSerialized) { Return (PSTA (PIRD)) }
- Method (_DIS, 0, NotSerialized) { PDIS (PIRD) }
- Method (_CRS, 0, NotSerialized) { Return (PCRS (PIRD)) }
- Method (_PRS, 0, NotSerialized) { Return (PPRS) }
- Method (_SRS, 1, NotSerialized) { PSRS (PIRD, Arg0) }
- }
-
- //
- // Programmable Interrupt Controller (PIC)
- //
- Device(PIC) {
- Name (_HID, EISAID ("PNP0000"))
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0x020, 0x020, 0x00, 0x02)
- IO (Decode16, 0x0A0, 0x0A0, 0x00, 0x02)
- IO (Decode16, 0x4D0, 0x4D0, 0x00, 0x02)
- IRQNoFlags () {2}
- })
- }
-
- //
- // ISA DMA
- //
- Device (DMAC) {
- Name (_HID, EISAID ("PNP0200"))
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0x00, 0x00, 0, 0x10)
- IO (Decode16, 0x81, 0x81, 0, 0x03)
- IO (Decode16, 0x87, 0x87, 0, 0x01)
- IO (Decode16, 0x89, 0x89, 0, 0x03)
- IO (Decode16, 0x8f, 0x8f, 0, 0x01)
- IO (Decode16, 0xc0, 0xc0, 0, 0x20)
- DMA (Compatibility, NotBusMaster, Transfer8) {4}
- })
- }
-
- //
- // 8254 Timer
- //
- Device(TMR) {
- Name(_HID,EISAID("PNP0100"))
- Name(_CRS, ResourceTemplate () {
- IO (Decode16, 0x40, 0x40, 0x00, 0x04)
- IRQNoFlags () {0}
- })
- }
-
- //
- // Real Time Clock
- //
- Device (RTC) {
- Name (_HID, EISAID ("PNP0B00"))
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0x70, 0x70, 0x00, 0x02)
- IRQNoFlags () {8}
- })
- }
-
- //
- // PCAT Speaker
- //
- Device(SPKR) {
- Name (_HID, EISAID("PNP0800"))
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0x61, 0x61, 0x01, 0x01)
- })
- }
-
- //
- // Floating Point Coprocessor
- //
- Device(FPU) {
- Name (_HID, EISAID("PNP0C04"))
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0xF0, 0xF0, 0x00, 0x10)
- IRQNoFlags () {13}
- })
- }
-
- //
- // Generic motherboard devices and pieces that don't fit anywhere else
- //
- Device(XTRA) {
- Name (_HID, EISAID ("PNP0C02"))
- Name (_UID, 0x01)
- Name (_CRS, ResourceTemplate () {
- IO (Decode16, 0x010, 0x010, 0x00, 0x10)
- IO (Decode16, 0x022, 0x022, 0x00, 0x1E)
- IO (Decode16, 0x044, 0x044, 0x00, 0x1C)
- IO (Decode16, 0x062, 0x062, 0x00, 0x02)
- IO (Decode16, 0x065, 0x065, 0x00, 0x0B)
- IO (Decode16, 0x072, 0x072, 0x00, 0x0E)
- IO (Decode16, 0x080, 0x080, 0x00, 0x01)
- IO (Decode16, 0x084, 0x084, 0x00, 0x03)
- IO (Decode16, 0x088, 0x088, 0x00, 0x01)
- IO (Decode16, 0x08c, 0x08c, 0x00, 0x03)
- IO (Decode16, 0x090, 0x090, 0x00, 0x10)
- IO (Decode16, 0x0A2, 0x0A2, 0x00, 0x1E)
- IO (Decode16, 0x0E0, 0x0E0, 0x00, 0x10)
- IO (Decode16, 0x1E0, 0x1E0, 0x00, 0x10)
- IO (Decode16, 0x160, 0x160, 0x00, 0x10)
- IO (Decode16, 0x278, 0x278, 0x00, 0x08)
- IO (Decode16, 0x370, 0x370, 0x00, 0x02)
- IO (Decode16, 0x378, 0x378, 0x00, 0x08)
- IO (Decode16, 0x400, 0x400, 0x00, 0x40) // PMBLK1
- IO (Decode16, 0x440, 0x440, 0x00, 0x10)
- IO (Decode16, 0x678, 0x678, 0x00, 0x08)
- IO (Decode16, 0x778, 0x778, 0x00, 0x08)
- Memory32Fixed (ReadOnly, 0xFEC00000, 0x1000) // IO APIC
- Memory32Fixed (ReadOnly, 0xFEE00000, 0x1000)
- })
- }
-
- //
- // PS/2 Keyboard and PC/AT Enhanced Keyboard 101/102
- //
- Device (PS2K) {
- Name (_HID, EISAID ("PNP0303"))
- Name (_CID, EISAID ("PNP030B"))
- Name(_CRS,ResourceTemplate() {
- IO (Decode16, 0x60, 0x60, 0x00, 0x01)
- IO (Decode16, 0x64, 0x64, 0x00, 0x01)
- IRQNoFlags () {1}
- })
- }
-
- //
- // PS/2 Mouse and Microsoft Mouse
- //
- Device (PS2M) { // PS/2 stype mouse port
- Name (_HID, EISAID ("PNP0F03"))
- Name (_CID, EISAID ("PNP0F13"))
- Name (_CRS, ResourceTemplate() {
- IRQNoFlags () {12}
- })
- }
-
- //
- // UART Serial Port - COM1
- //
- Device (UAR1) {
- Name (_HID, EISAID ("PNP0501"))
- Name (_DDN, "COM1")
- Name (_UID, 0x01)
- Name(_CRS,ResourceTemplate() {
- IO (Decode16, 0x3F8, 0x3F8, 0x01, 0x08)
- IRQ (Edge, ActiveHigh, Exclusive, ) {4}
- })
- }
-
- //
- // UART Serial Port - COM2
- //
- Device (UAR2) {
- Name (_HID, EISAID ("PNP0501"))
- Name (_DDN, "COM2")
- Name (_UID, 0x02)
- Name(_CRS,ResourceTemplate() {
- IO (Decode16, 0x2F8, 0x2F8, 0x01, 0x08)
- IRQ (Edge, ActiveHigh, Exclusive, ) {3}
- })
- }
-
- //
- // Floppy Disk Controller
- //
- Device (FDC) {
- Name (_HID, EISAID ("PNP0700"))
- Name (_CRS,ResourceTemplate() {
- IO (Decode16, 0x3F0, 0x3F0, 0x01, 0x06)
- IO (Decode16, 0x3F7, 0x3F7, 0x01, 0x01)
- IRQNoFlags () {6}
- DMA (Compatibility, NotBusMaster, Transfer8) {2}
- })
- }
- }
- }
- }
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facp.aslc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facp.aslc
deleted file mode 100644
index 593861eb6..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facp.aslc
+++ /dev/null
@@ -1,79 +0,0 @@
-/** @file
- FACP Table
-
- Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
- 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 "Platform.h"
-
-EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE FACP = {
- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
- sizeof (EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE),
- EFI_ACPI_1_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION,
- 0, // to make sum of entire table == 0
- EFI_ACPI_OEM_ID, // OEMID is a 6 bytes long field
- EFI_ACPI_OEM_TABLE_ID, // OEM table identification(8 bytes long)
- EFI_ACPI_OEM_REVISION, // OEM revision number
- EFI_ACPI_CREATOR_ID, // ASL compiler vendor ID
- EFI_ACPI_CREATOR_REVISION, // ASL compiler revision number
- 0, // Physical addesss of FACS
- 0, // Physical address of DSDT
- INT_MODEL, // System Interrupt Model
- RESERVED, // reserved
- SCI_INT_VECTOR, // System vector of SCI interrupt
- SMI_CMD_IO_PORT, // Port address of SMI command port
- ACPI_ENABLE, // value to write to port smi_cmd to enable ACPI
- ACPI_DISABLE, // value to write to port smi_cmd to disable ACPI
- S4BIOS_REQ, // Value to write to SMI CMD port to enter the S4BIOS state
- 0xE2, // PState control
- PM1a_EVT_BLK, // Port address of Power Mgt 1a Event Reg Blk
- PM1b_EVT_BLK, // Port address of Power Mgt 1b Event Reg Blk
- PM1a_CNT_BLK, // Port address of Power Mgt 1a Ctrl Reg Blk
- PM1b_CNT_BLK, // Port address of Power Mgt 1b Ctrl Reg Blk
- PM2_CNT_BLK, // Port address of Power Mgt 2 Ctrl Reg Blk
- PM_TMR_BLK, // Port address of Power Mgt Timer Ctrl Reg Blk
- GPE0_BLK, // Port addr of General Purpose Event 0 Reg Blk
- GPE1_BLK, // Port addr of General Purpose Event 1 Reg Blk
- PM1_EVT_LEN, // Byte Length of ports at pm1X_evt_blk
- PM1_CNT_LEN, // Byte Length of ports at pm1X_cnt_blk
- PM2_CNT_LEN, // Byte Length of ports at pm2_cnt_blk
- PM_TM_LEN, // Byte Length of ports at pm_tm_blk
- GPE0_BLK_LEN, // Byte Length of ports at gpe0_blk
- GPE1_BLK_LEN, // Byte Length of ports at gpe1_blk
- GPE1_BASE, // offset in gpe model where gpe1 events start
- 0xE3, // _CST support
- P_LVL2_LAT, // worst case HW latency to enter/exit C2 state
- P_LVL3_LAT, // worst case HW latency to enter/exit C3 state
- FLUSH_SIZE, // Size of area read to flush caches
- FLUSH_STRIDE, // Stride used in flushing caches
- DUTY_OFFSET, // bit location of duty cycle field in p_cnt reg
- DUTY_WIDTH, // bit width of duty cycle field in p_cnt reg
- DAY_ALRM, // index to day-of-month alarm in RTC CMOS RAM
- MON_ALRM, // index to month-of-year alarm in RTC CMOS RAM
- CENTURY, // index to century in RTC CMOS RAM
- 0x03, // Boot architecture flag
- 0x00, // Boot architecture flag
- RESERVED, // reserved
- FLAG
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from
- // removing the data structure from the exeutable
- //
- return (VOID*)&FACP;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facs.aslc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facs.aslc
deleted file mode 100644
index 2d2129c42..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Facs.aslc
+++ /dev/null
@@ -1,81 +0,0 @@
-/** @file
- FACS Table
-
- Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
- 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 <IndustryStandard/Acpi.h>
-
-EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE FACS = {
- EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE,
- sizeof (EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE),
-
- //
- // Hardware Signature will be updated at runtime
- //
- 0x00000000,
- 0x00,
- 0x00,
- 0x00,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE,
- EFI_ACPI_RESERVED_BYTE
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from
- // removing the data structure from the exeutable
- //
- return (VOID*)&FACS;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Madt.aslc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Madt.aslc
deleted file mode 100644
index 7e360dd69..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Madt.aslc
+++ /dev/null
@@ -1,158 +0,0 @@
-/** @file
- MADT Table
-
- This file contains a structure definition for the ACPI 1.0 Multiple APIC
- Description Table (MADT).
-
- Copyright (c) 2008 - 2009, Intel Corporation. All rights reserved.<BR>
- 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 <IndustryStandard/Acpi.h>
-
-//
-// MADT Definitions
-//
-#define EFI_ACPI_OEM_MADT_REVISION 0x00000000 // TBD
-
-//
-// Local APIC address
-//
-#define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000 // TBD
-
-//
-// Multiple APIC Flags are defined in AcpiX.0.h
-//
-#define EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS (EFI_ACPI_1_0_PCAT_COMPAT)
-
-//
-// Define the number of each table type.
-// This is where the table layout is modified.
-//
-#define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT 1
-#define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2
-#define EFI_ACPI_IO_APIC_COUNT 1
-
-//
-// Ensure proper structure formats
-//
-#pragma pack (1)
-
-//
-// ACPI 1.0 MADT structure
-//
-typedef struct {
- EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;
-
-#if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0
- EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE \
- LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
-#endif
-
-#if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0
- EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE \
- Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
-#endif
-
-#if EFI_ACPI_IO_APIC_COUNT > 0
- EFI_ACPI_1_0_IO_APIC_STRUCTURE \
- IoApic[EFI_ACPI_IO_APIC_COUNT];
-#endif
-
-} EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE;
-
-#pragma pack ()
-
-//
-// Multiple APIC Description Table
-//
-EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE Madt = {
- EFI_ACPI_1_0_APIC_SIGNATURE,
- sizeof (EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE),
- EFI_ACPI_1_0_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
-
- //
- // Checksum will be updated at runtime
- //
- 0x00,
-
- //
- // It is expected that these values will be programmed at runtime
- //
- 'E', 'X', 'Y', 'N', 'O', 'S',
-
- 0x30313234,
- EFI_ACPI_OEM_MADT_REVISION,
- 0,
- 0,
-
- //
- // MADT specific fields
- //
- EFI_ACPI_LOCAL_APIC_ADDRESS,
- EFI_ACPI_1_0_MULTIPLE_APIC_FLAGS,
-
- //
- // Processor Local APIC Structure
- //
-
- EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC, // Type
- sizeof (EFI_ACPI_1_0_PROCESSOR_LOCAL_APIC_STRUCTURE), // Length
- 0x01, // Processor ID
- 0x00, // Local APIC ID
- 0x00000001, // Flags - Enabled by default
-
- //
- // Interrupt Source Override Structure
- //
-
- //
- // IRQ0=>IRQ2 Interrupt Source Override Structure
- //
- EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type
- sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length
- 0x00, // Bus - ISA
- 0x00, // Source - IRQ0
- 0x00000002, // Global System Interrupt - IRQ2
- 0x0000, // Flags - Conforms to specifications of the bus
-
- //
- // ISO (SCI Active High) Interrupt Source Override Structure
- //
- EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE, // Type
- sizeof (EFI_ACPI_1_0_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE),// Length
- 0x00, // Bus - ISA
- 0x09, // Source - IRQ0
- 0x00000009, // Global System Interrupt - IRQ2
- 0x000D, // Flags - Level-tiggered, Active High
-
- //
- // IO APIC Structure
- //
- EFI_ACPI_1_0_IO_APIC, // Type
- sizeof (EFI_ACPI_1_0_IO_APIC_STRUCTURE), // Length
- 0x02, // IO APIC ID
- EFI_ACPI_RESERVED_BYTE, // Reserved
- 0xFEC00000, // IO APIC Address (physical)
- 0x00000000 // Global System Interrupt Base
-};
-
-
-VOID*
-ReferenceAcpiTable (
- VOID
- )
-{
- //
- // Reference the table being generated to prevent the optimizer from
- // removing the data structure from the exeutable
- //
- return (VOID*)&Madt;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Platform.h b/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Platform.h
deleted file mode 100644
index 307983933..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/AcpiTables/Platform.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/** @file
- Platform specific defines for constructing ACPI tables
-
- Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
- 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 _Platform_h_INCLUDED_
-#define _Platform_h_INCLUDED_
-
-#include <PiDxe.h>
-#include <IndustryStandard/Acpi.h>
-
-//
-// ACPI table information used to initialize tables.
-//
-#define EFI_ACPI_OEM_ID 'E','X','Y','N','O','S' // OEMID 6 bytes long
-// OEM table id 8 bytes long
-#define EFI_ACPI_OEM_TABLE_ID SIGNATURE_64('4','2','1','0',' ',' ',' ',' ')
-#define EFI_ACPI_OEM_REVISION 0x02000820
-#define EFI_ACPI_CREATOR_ID SIGNATURE_32('S','M','D','K')
-#define EFI_ACPI_CREATOR_REVISION 0x00000097
-
-#define INT_MODEL 0x01
-#define SCI_INT_VECTOR 0x0009
-#define SMI_CMD_IO_PORT 0 // If SMM was supported, then this would be 0xB2
-#define ACPI_ENABLE 0x0E1
-#define ACPI_DISABLE 0x01E
-#define S4BIOS_REQ 0x00
-#define PM1a_EVT_BLK 0x00000400
-#define PM1b_EVT_BLK 0x00000000
-#define PM1a_CNT_BLK 0x00000404
-#define PM1b_CNT_BLK 0x00000000
-#define PM2_CNT_BLK 0x00000022
-#define PM_TMR_BLK 0x00000408
-#define GPE0_BLK 0x0000040C
-#define GPE1_BLK 0x00000000
-#define PM1_EVT_LEN 0x04
-#define PM1_CNT_LEN 0x02
-#define PM2_CNT_LEN 0x01
-#define PM_TM_LEN 0x04
-#define GPE0_BLK_LEN 0x04
-#define GPE1_BLK_LEN 0x00
-#define GPE1_BASE 0x00
-#define RESERVED 0x00
-#define P_LVL2_LAT 0x0065
-#define P_LVL3_LAT 0x03E9
-#define FLUSH_SIZE 0x0400
-#define FLUSH_STRIDE 0x0010
-#define DUTY_OFFSET 0x00
-#define DUTY_WIDTH 0x00
-#define DAY_ALRM 0x0D
-#define MON_ALRM 0x00
-#define CENTURY 0x00
-#define FLAG EFI_ACPI_1_0_WBINVD | EFI_ACPI_1_0_PROC_C1 | \
- EFI_ACPI_1_0_SLP_BUTTON | EFI_ACPI_1_0_RTC_S4 | \
- EFI_ACPI_1_0_TMR_VAL_EXT
-
-#endif
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EBLoadSecSyms.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EBLoadSecSyms.inc
deleted file mode 100644
index 281c99b4a..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EBLoadSecSyms.inc
+++ /dev/null
@@ -1,15 +0,0 @@
-// returns the base address of the SEC FV in flash on the EB board
-// change this address for where your platform's SEC FV is located
-// (or make it more intelligent to search for it)
-define /r FindFv()
-{
- return 0x40000000;
-}
-.
-
-include /s 'ZZZZZZ/EfiFuncs.inc'
-error=continue
-unload ,all
-error=abort
-LoadPeiSec()
-include C:\loadfiles.inc
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EfiFuncs.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EfiFuncs.inc
deleted file mode 100644
index 014d09440..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/EfiFuncs.inc
+++ /dev/null
@@ -1,463 +0,0 @@
-error=abort
-
-// NOTE: THIS MAY NEED TO BE ADJUSTED
-// change to reflect the total amount of ram in your system
-define /r GetMaxMem()
-{
- return 0x10000000; // 256 MB
-}
-.
-
-define /r GetWord(Addr)
-{
- unsigned long data;
-
- if( (Addr & 0x2) == 0 )
- {
- data = dword(Addr);
- data = data & 0xffff;
- //$printf "getword data is %x\n", data$;
- return data;
- }
- else
- {
- data = dword(Addr & 0xfffffffc);
- //data = data >> 16;
- data = data / 0x10000;
- //$printf "getword data is %x (1)\n", data$;
- return data;
- }
-}
-.
-
-define /r ProcessPE32(imgstart)
-unsigned long imgstart;
-{
- unsigned long filehdrstart;
- unsigned long debugdirentryrva;
- unsigned long debugtype;
- unsigned long debugrva;
- unsigned long dwarfsig;
- unsigned long baseofcode;
- unsigned long baseofdata;
- unsigned long elfbase;
- char *elfpath;
-
- $printf "PE32 image found at %x",imgstart$;
-
- //$printf "PE file hdr offset %x",dword(imgstart+0x3C)$;
-
- // offset from dos hdr to PE file hdr
- filehdrstart = imgstart + dword(imgstart+0x3C);
-
- // offset to debug dir in PE hdrs
- //$printf "debug dir is at %x",(filehdrstart+0xA8)$;
- debugdirentryrva = dword(filehdrstart + 0xA8);
- if(debugdirentryrva == 0)
- {
- $printf "no debug dir for image at %x",imgstart$;
- return;
- }
-
- //$printf "debug dir entry rva is %x",debugdirentryrva$;
-
- debugtype = dword(imgstart + debugdirentryrva + 0xc);
- if( (debugtype != 0xdf) && (debugtype != 0x2) )
- {
- $printf "debug type is not dwarf for image at %x",imgstart$;
- $printf "debug type is %x",debugtype$;
- return;
- }
-
- debugrva = dword(imgstart + debugdirentryrva + 0x14);
- dwarfsig = dword(imgstart + debugrva);
- if(dwarfsig != 0x66727764)
- {
- $printf "dwarf debug signature not found for image at %x",imgstart$;
- return;
- }
-
- elfpath = (char *)(imgstart + debugrva + 0xc);
-
- baseofcode = imgstart + dword(filehdrstart + 0x28);
- baseofdata = imgstart + dword(filehdrstart + 0x2c);
-
- if( (baseofcode < baseofdata) && (baseofcode != 0) )
- {
- elfbase = baseofcode;
- }
- else
- {
- elfbase = baseofdata;
- }
-
- $printf "found path %s",elfpath$;
- $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$;
-}
-.
-
-define /r ProcessTE(imgstart)
-unsigned long imgstart;
-{
- unsigned long strippedsize;
- unsigned long debugdirentryrva;
- unsigned long debugtype;
- unsigned long debugrva;
- unsigned long dwarfsig;
- unsigned long elfbase;
- char *elfpath;
-
- $printf "TE image found at %x",imgstart$;
-
- // determine pe header bytes removed to account for in rva references
- //strippedsize = word(imgstart + 0x6);
- //strippedsize = (dword(imgstart + 0x4) & 0xffff0000) >> 16;
- strippedsize = (dword(imgstart + 0x4) & 0xffff0000) / 0x10000;
- strippedsize = strippedsize - 0x28;
-
- debugdirentryrva = dword(imgstart + 0x20);
- if(debugdirentryrva == 0)
- {
- $printf "no debug dir for image at %x",imgstart$;
- return;
- }
- debugdirentryrva = debugdirentryrva - strippedsize;
-
- //$printf "debug dir entry rva is %x",debugdirentryrva$;
-
- debugtype = dword(imgstart + debugdirentryrva + 0xc);
- if( (debugtype != 0xdf) && (debugtype != 0x2) )
- {
- $printf "debug type is not dwarf for image at %x",imgstart$;
- $printf "debug type is %x",debugtype$;
- return;
- }
-
- debugrva = dword(imgstart + debugdirentryrva + 0x14);
- debugrva = debugrva - strippedsize;
- dwarfsig = dword(imgstart + debugrva);
- if( (dwarfsig != 0x66727764) && (dwarfsig != 0x3031424e) )
- {
- $printf "dwarf debug signature not found for image at %x",imgstart$;
- $printf "found %x", dwarfsig$;
- return;
- }
-
- if( dwarfsig == 0x66727764 )
- {
- elfpath = (char *)(imgstart + debugrva + 0xc);
- $printf "looking for elf path at 0x%x", elfpath$;
- }
- else
- {
- elfpath = (char *)(imgstart + debugrva + 0x10);
- $printf "looking for elf path at 0x%x", elfpath$;
- }
-
- // elf base is baseofcode (we hope that for TE images it's not baseofdata)
- elfbase = imgstart + dword(imgstart + 0xc) - strippedsize;
-
- $printf "found path %s",elfpath$;
- $fprintf 50, "load /ni /np /a %s &0x%x\n",elfpath,elfbase$;
-}
-.
-
-define /r ProcessFvSection(secstart)
-unsigned long secstart;
-{
- unsigned long sectionsize;
- unsigned char sectiontype;
-
- sectionsize = dword(secstart);
- //sectiontype = (sectionsize & 0xff000000) >> 24;
- sectiontype = (sectionsize & 0xff000000) / 0x1000000;
- sectionsize = sectionsize & 0x00ffffff;
-
- $printf "fv section at %x size %x type %x",secstart,sectionsize,sectiontype$;
-
- if(sectiontype == 0x10) // PE32
- {
- ProcessPE32(secstart+0x4);
- }
- else if(sectiontype == 0x12) // TE
- {
- ProcessTE(secstart+0x4);
- }
-}
-.
-
-define /r ProcessFfsFile(ffsfilestart)
-unsigned long ffsfilestart;
-{
- unsigned long ffsfilesize;
- unsigned long ffsfiletype;
- unsigned long secoffset;
- unsigned long secsize;
-
- //ffsfiletype = byte(ffsfilestart + 0x12);
- ffsfilesize = dword(ffsfilestart + 0x14);
- //ffsfiletype = (ffsfilesize & 0xff000000) >> 24;
- ffsfiletype = (ffsfilesize & 0xff000000) / 0x1000000;
- ffsfilesize = ffsfilesize & 0x00ffffff;
-
- if(ffsfiletype == 0xff) return;
-
- $printf "ffs file at %x size %x type %x",ffsfilestart,ffsfilesize,ffsfiletype$;
-
- secoffset = ffsfilestart + 0x18;
-
- // loop through sections in file
- while(secoffset < (ffsfilestart + ffsfilesize))
- {
- // process fv section and increment section offset by size
- secsize = dword(secoffset) & 0x00ffffff;
- ProcessFvSection(secoffset);
- secoffset = secoffset + secsize;
-
- // align to next 4 byte boundary
- if( (secoffset & 0x3) != 0 )
- {
- secoffset = secoffset + (0x4 - (secoffset & 0x3));
- }
- } // end section loop
-}
-.
-
-define /r LoadPeiSec()
-{
- unsigned long fvbase;
- unsigned long fvlen;
- unsigned long fvsig;
- unsigned long ffsoffset;
- unsigned long ffsfilesize;
-
- fvbase = FindFv();
- $printf "fvbase %x",fvbase$;
-
- // get fv signature field
- fvsig = dword(fvbase + 0x28);
- if(fvsig != 0x4856465F)
- {
- $printf "FV does not have proper signature, exiting"$;
- return 0;
- }
-
- $printf "FV signature found"$;
-
- $fopen 50, 'C:\loadfiles.inc'$;
-
- fvlen = dword(fvbase + 0x20);
-
- // first ffs file is after fv header, use headerlength field
- //ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) >> 16;
- ffsoffset = (dword(fvbase + 0x30) & 0xffff0000) / 0x10000;
- ffsoffset = fvbase + GetWord(fvbase + 0x30);
-
- // loop through ffs files
- while(ffsoffset < (fvbase+fvlen))
- {
- // process ffs file and increment by ffs file size field
- ProcessFfsFile(ffsoffset);
- ffsfilesize = (dword(ffsoffset + 0x14) & 0x00ffffff);
- if(ffsfilesize == 0)
- {
- break;
- }
- ffsoffset = ffsoffset + ffsfilesize;
-
-
- // align to next 8 byte boundary
- if( (ffsoffset & 0x7) != 0 )
- {
- ffsoffset = ffsoffset + (0x8 - (ffsoffset & 0x7));
- }
-
- } // end fv ffs loop
-
- $vclose 50$;
-
-}
-.
-
-define /r FindSystemTable(TopOfRam)
-unsigned long TopOfRam;
-{
- unsigned long offset;
-
- $printf "FindSystemTable"$;
- $printf "top of mem is %x",TopOfRam$;
-
- offset = TopOfRam;
-
- // align to highest 4MB boundary
- offset = offset & 0xFFC00000;
-
- // start at top and look on 4MB boundaries for system table ptr structure
- while(offset > 0)
- {
- //$printf "checking %x",offset$;
- //$printf "value is %x",dword(offset)$;
-
- // low signature match
- if(dword(offset) == 0x20494249)
- {
- // high signature match
- if(dword(offset+4) == 0x54535953)
- {
- // less than 4GB?
- if(dword(offset+0x0c) == 0)
- {
- // less than top of ram?
- if(dword(offset+8) < TopOfRam)
- {
- return(dword(offset+8));
- }
- }
- }
-
- }
-
- if(offset < 0x400000) break;
- offset = offset - 0x400000;
- }
-
- return 0;
-}
-.
-
-define /r ProcessImage(ImageBase)
-unsigned long ImageBase;
-{
- $printf "ProcessImage %x", ImageBase$;
-}
-.
-
-define /r FindDebugInfo(SystemTable)
-unsigned long SystemTable;
-{
- unsigned long CfgTableEntries;
- unsigned long ConfigTable;
- unsigned long i;
- unsigned long offset;
- unsigned long dbghdr;
- unsigned long dbgentries;
- unsigned long dbgptr;
- unsigned long dbginfo;
- unsigned long loadedimg;
-
- $printf "FindDebugInfo"$;
-
- dbgentries = 0;
- CfgTableEntries = dword(SystemTable + 0x40);
- ConfigTable = dword(SystemTable + 0x44);
-
- $printf "config table is at %x (%d entries)", ConfigTable, CfgTableEntries$;
-
- // now search for debug info entry with guid 49152E77-1ADA-4764-B7A2-7AFEFED95E8B
- // 0x49152E77 0x47641ADA 0xFE7AA2B7 0x8B5ED9FE
- for(i=0; i<CfgTableEntries; i++)
- {
- offset = ConfigTable + (i*0x14);
- if(dword(offset) == 0x49152E77)
- {
- if(dword(offset+4) == 0x47641ADA)
- {
- if(dword(offset+8) == 0xFE7AA2B7)
- {
- if(dword(offset+0xc) == 0x8B5ED9FE)
- {
- dbghdr = dword(offset+0x10);
- dbgentries = dword(dbghdr + 4);
- dbgptr = dword(dbghdr + 8);
- }
- }
- }
- }
- }
-
- if(dbgentries == 0)
- {
- $printf "no debug entries found"$;
- return;
- }
-
- $printf "debug table at %x (%d entries)", dbgptr, dbgentries$;
-
- for(i=0; i<dbgentries; i++)
- {
- dbginfo = dword(dbgptr + (i*4));
- if(dbginfo != 0)
- {
- if(dword(dbginfo) == 1) // normal debug info type
- {
- loadedimg = dword(dbginfo + 4);
- ProcessPE32(dword(loadedimg + 0x20));
- }
- }
- }
-}
-.
-
-define /r LoadDxe()
-{
- unsigned long maxmem;
- unsigned long systbl;
-
- $printf "LoadDxe"$;
-
- $fopen 50, 'C:\loadfiles.inc'$;
-
- maxmem = GetMaxMem();
- systbl = FindSystemTable(maxmem);
- if(systbl != 0)
- {
- $printf "found system table at %x",systbl$;
- FindDebugInfo(systbl);
- }
-
- $vclose 50$;
-}
-.
-
-define /r LoadRuntimeDxe()
-
-{
- unsigned long maxmem;
- unsigned long SystemTable;
- unsigned long CfgTableEntries;
- unsigned long ConfigTable;
- unsigned long i;
- unsigned long offset;
- unsigned long numentries;
- unsigned long RuntimeDebugInfo;
- unsigned long DebugInfoOffset;
- unsigned long imgbase;
-
- $printf "LoadRuntimeDxe"$;
-
- $fopen 50, 'C:\loadfiles.inc'$;
-
- RuntimeDebugInfo = 0x80000010;
-
- if(RuntimeDebugInfo != 0)
- {
- numentries = dword(RuntimeDebugInfo);
-
- $printf "runtime debug info is at %x (%d entries)", RuntimeDebugInfo, numentries$;
-
- DebugInfoOffset = RuntimeDebugInfo + 0x4;
- for(i=0; i<numentries; i++)
- {
- imgbase = dword(DebugInfoOffset);
- if(imgbase != 0)
- {
- $printf "found image at %x",imgbase$;
- ProcessPE32(imgbase);
- }
- DebugInfoOffset = DebugInfoOffset + 0x4;
- }
- }
-
- $vclose 50$;
-}
-.
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_boot_from_ram.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_boot_from_ram.inc
deleted file mode 100644
index cd273a423..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_boot_from_ram.inc
+++ /dev/null
@@ -1,20 +0,0 @@
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// 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.
-//
-error = continue
-unload
-error = abort
-
-setreg @CP15_CONTROL = 0x0005107E
-setreg @pc=0x80008208
-setreg @cpsr=0x000000D3
-dis/D
-readfile,raw,nowarn "ZZZZZZ/FV/BEAGLEBOARD_EFI.fd"=0x80008000
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_convert_symbols.sh b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_convert_symbols.sh
deleted file mode 100644
index 46dd65cf3..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_convert_symbols.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-#
-# 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.
-#
-
-
-IN=`/usr/bin/cygpath -u $1`
-OUT=`/usr/bin/cygpath -u $2`
-
-/usr/bin/sed -e "s/\/cygdrive\/\(.\)/load\/a\/ni\/np \"\1:/g" \
- -e 's:\\:/:g' \
- -e "s/^/load\/a\/ni\/np \"/g" \
- -e "s/dll /dll\" \&/g" \
- $IN | /usr/bin/sort.exe --key=3 --output=$OUT
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_hw_setup.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_hw_setup.inc
deleted file mode 100644
index c03a443e8..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_hw_setup.inc
+++ /dev/null
@@ -1,67 +0,0 @@
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// 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.
-//
-
-error = continue
-unload
-error = abort
-
-setreg @CP15_CONTROL = 0x0005107E
-setreg @cpsr=0x000000D3
-
-; General clock settings.
-setmem /32 0x48307270=0x00000080
-setmem /32 0x48306D40=0x00000003
-setmem /32 0x48005140=0x03020A50
-
-;Clock configuration
-setmem /32 0x48004A40=0x0000030A
-setmem /32 0x48004C40=0x00000015
-
-;DPLL3 (Core) settings
-setmem /32 0x48004D00=0x00370037
-setmem /32 0x48004D30=0x00000000
-setmem /32 0x48004D40=0x094C0C00
-
-;DPLL4 (Peripheral) settings
-setmem /32 0x48004D00=0x00370037
-setmem /32 0x48004D30=0x00000000
-setmem /32 0x48004D44=0x0001B00C
-setmem /32 0x48004D48=0x00000009
-
-;DPLL1 (MPU) settings
-setmem /32 0x48004904=0x00000037
-setmem /32 0x48004934=0x00000000
-setmem /32 0x48004940=0x0011F40C
-setmem /32 0x48004944=0x00000001
-setmem /32 0x48004948=0x00000000
-
-;RAM setup.
-setmem /16 0x6D000010=0x0000
-setmem /16 0x6D000040=0x0001
-setmem /16 0x6D000044=0x0100
-setmem /16 0x6D000048=0x0000
-setmem /32 0x6D000060=0x0000000A
-setmem /32 0x6D000070=0x00000081
-setmem /16 0x6D000040=0x0003
-setmem /32 0x6D000080=0x02D04011
-setmem /16 0x6D000084=0x0032
-setmem /16 0x6D00008C=0x0000
-setmem /32 0x6D00009C=0xBA9DC4C6
-setmem /32 0x6D0000A0=0x00012522
-setmem /32 0x6D0000A4=0x0004E201
-setmem /16 0x6D000040=0x0003
-setmem /32 0x6D0000B0=0x02D04011
-setmem /16 0x6D0000B4=0x0032
-setmem /16 0x6D0000BC=0x0000
-setmem /32 0x6D0000C4=0xBA9DC4C6
-setmem /32 0x6D0000C8=0x00012522
-setmem /32 0x6D0000D4=0x0004E201 \ No newline at end of file
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_load_symbols.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_load_symbols.inc
deleted file mode 100644
index a8f98433d..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_load_symbols.inc
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// 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 'ZZZZZZ/rvi_symbols_macros.inc'
-
-macro write_symbols_file("ZZZZZZ/rvi_symbols.tmp", 0x00000000, 0x10000000)
-
-host "bash -o igncr ZZZZZZ/rvi_convert_symbols.sh ZZZZZZ/rvi_symbols.tmp ZZZZZZ/rvi_symbols.inc"
-include 'ZZZZZZ/rvi_symbols.inc'
-load /NI /NP 'ZZZZZZ/rvi_dummy.axf' ;.constdata
-unload rvi_dummy.axf
-delfile rvi_dummy.axf
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_symbols_macros.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_symbols_macros.inc
deleted file mode 100644
index 6f7377cbb..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_symbols_macros.inc
+++ /dev/null
@@ -1,193 +0,0 @@
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// 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.
-//
-
-define /R int compare_guid(guid1, guid2)
- unsigned char *guid1;
- unsigned char *guid2;
-{
- return strncmp(guid1, guid2, 16);
-}
-.
-
-define /R unsigned char * find_system_table(mem_start, mem_size)
- unsigned char *mem_start;
- unsigned long mem_size;
-{
- unsigned char *mem_ptr;
-
- mem_ptr = mem_start + mem_size;
-
- do
- {
- mem_ptr -= 0x400000; // 4 MB
-
- if (strncmp(mem_ptr, "IBI SYST", 8) == 0)
- {
- return *(unsigned long *)(mem_ptr + 8); // EfiSystemTableBase
- }
-
- } while (mem_ptr > mem_start);
-
- return 0;
-}
-.
-
-define /R unsigned char * find_debug_info_table_header(system_table)
- unsigned char *system_table;
-{
- unsigned long configuration_table_entries;
- unsigned char *configuration_table;
- unsigned long index;
- unsigned char debug_table_guid[16];
-
- // Fill in the debug table's guid
- debug_table_guid[ 0] = 0x77;
- debug_table_guid[ 1] = 0x2E;
- debug_table_guid[ 2] = 0x15;
- debug_table_guid[ 3] = 0x49;
- debug_table_guid[ 4] = 0xDA;
- debug_table_guid[ 5] = 0x1A;
- debug_table_guid[ 6] = 0x64;
- debug_table_guid[ 7] = 0x47;
- debug_table_guid[ 8] = 0xB7;
- debug_table_guid[ 9] = 0xA2;
- debug_table_guid[10] = 0x7A;
- debug_table_guid[11] = 0xFE;
- debug_table_guid[12] = 0xFE;
- debug_table_guid[13] = 0xD9;
- debug_table_guid[14] = 0x5E;
- debug_table_guid[15] = 0x8B;
-
- configuration_table_entries = *(unsigned long *)(system_table + 64);
- configuration_table = *(unsigned long *)(system_table + 68);
-
- for (index = 0; index < configuration_table_entries; index++)
- {
- if (compare_guid(configuration_table, debug_table_guid) == 0)
- {
- return *(unsigned long *)(configuration_table + 16);
- }
-
- configuration_table += 20;
- }
-
- return 0;
-}
-.
-
-define /R int valid_pe_header(header)
- unsigned char *header;
-{
- if ((header[0x00] == 'M') &&
- (header[0x01] == 'Z') &&
- (header[0x80] == 'P') &&
- (header[0x81] == 'E'))
- {
- return 1;
- }
-
- return 0;
-}
-.
-
-define /R unsigned long pe_headersize(header)
- unsigned char *header;
-{
- unsigned long *size;
-
- size = header + 0x00AC;
-
- return *size;
-}
-.
-
-define /R unsigned char *pe_filename(header)
- unsigned char *header;
-{
- unsigned long *debugOffset;
- unsigned char *stringOffset;
-
- if (valid_pe_header(header))
- {
- debugOffset = header + 0x0128;
- stringOffset = header + *debugOffset + 0x002C;
-
- return stringOffset;
- }
-
- return 0;
-}
-.
-
-define /R int char_is_valid(c)
- unsigned char c;
-{
- if (c >= 32 && c < 127)
- return 1;
-
- return 0;
-}
-.
-
-define /R write_symbols_file(filename, mem_start, mem_size)
- unsigned char *filename;
- unsigned char *mem_start;
- unsigned long mem_size;
-{
- unsigned char *system_table;
- unsigned char *debug_info_table_header;
- unsigned char *debug_info_table;
- unsigned long debug_info_table_size;
- unsigned long index;
- unsigned char *debug_image_info;
- unsigned char *loaded_image_protocol;
- unsigned char *image_base;
- unsigned char *debug_filename;
- unsigned long header_size;
- int status;
-
- system_table = find_system_table(mem_start, mem_size);
- if (system_table == 0)
- {
- return;
- }
-
- status = fopen(88, filename, "w");
-
- debug_info_table_header = find_debug_info_table_header(system_table);
-
- debug_info_table = *(unsigned long *)(debug_info_table_header + 8);
- debug_info_table_size = *(unsigned long *)(debug_info_table_header + 4);
-
- for (index = 0; index < (debug_info_table_size * 4); index += 4)
- {
- debug_image_info = *(unsigned long *)(debug_info_table + index);
-
- if (debug_image_info == 0)
- {
- break;
- }
-
- loaded_image_protocol = *(unsigned long *)(debug_image_info + 4);
-
- image_base = *(unsigned long *)(loaded_image_protocol + 32);
-
- debug_filename = pe_filename(image_base);
- header_size = pe_headersize(image_base);
-
- $fprintf 88, "%s 0x%08x\n", debug_filename, image_base + header_size$;
- }
-
-
- fclose(88);
-}
-.
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_unload_symbols.inc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_unload_symbols.inc
deleted file mode 100644
index 4a7e12b81..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Debugger_scripts/rvi_unload_symbols.inc
+++ /dev/null
@@ -1,118 +0,0 @@
-//
-// Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
-//
-// 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.
-//
-
-error = continue
-
-unload
-
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-delfile 1
-
-error = abort
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.c b/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.c
deleted file mode 100644
index 2e13d1a42..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*++
-RealView EB FVB DXE Driver
-
-Copyright (c) 2010, Apple Inc. All rights reserved.<BR>
-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 <PiDxe.h>
-
-#include <Library/BaseLib.h>
-#include <Library/DebugLib.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiLib.h>
-#include <Library/PcdLib.h>
-
-#include <Protocol/FirmwareVolumeBlock.h>
-
-
-
-/**
- The GetAttributes() function retrieves the attributes and
- current settings of the block.
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Attributes Pointer to EFI_FVB_ATTRIBUTES_2 in which the
- attributes and current settings are
- returned. Type EFI_FVB_ATTRIBUTES_2 is defined
- in EFI_FIRMWARE_VOLUME_HEADER.
-
- @retval EFI_SUCCESS The firmware volume attributes were
- returned.
-
-**/
-
-EFI_STATUS
-EFIAPI
-FvbGetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- The SetAttributes() function sets configurable firmware volume
- attributes and returns the new settings of the firmware volume.
-
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Attributes On input, Attributes is a pointer to
- EFI_FVB_ATTRIBUTES_2 that contains the
- desired firmware volume settings. On
- successful return, it contains the new
- settings of the firmware volume. Type
- EFI_FVB_ATTRIBUTES_2 is defined in
- EFI_FIRMWARE_VOLUME_HEADER.
-
- @retval EFI_SUCCESS The firmware volume attributes were returned.
-
- @retval EFI_INVALID_PARAMETER The attributes requested are in
- conflict with the capabilities
- as declared in the firmware
- volume header.
-
-**/
-EFI_STATUS
-EFIAPI
-FvbSetAttributes (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- The GetPhysicalAddress() function retrieves the base address of
- a memory-mapped firmware volume. This function should be called
- only for memory-mapped firmware volumes.
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Address Pointer to a caller-allocated
- EFI_PHYSICAL_ADDRESS that, on successful
- return from GetPhysicalAddress(), contains the
- base address of the firmware volume.
-
- @retval EFI_SUCCESS The firmware volume base address was returned.
-
- @retval EFI_NOT_SUPPORTED The firmware volume is not memory mapped.
-
-**/
-EFI_STATUS
-EFIAPI
-FvbGetPhysicalAddress (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- OUT EFI_PHYSICAL_ADDRESS *Address
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- The GetBlockSize() function retrieves the size of the requested
- block. It also returns the number of additional blocks with
- the identical size. The GetBlockSize() function is used to
- retrieve the block map (see EFI_FIRMWARE_VOLUME_HEADER).
-
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Lba Indicates the block for which to return the size.
-
- @param BlockSize Pointer to a caller-allocated UINTN in which
- the size of the block is returned.
-
- @param NumberOfBlocks Pointer to a caller-allocated UINTN in
- which the number of consecutive blocks,
- starting with Lba, is returned. All
- blocks in this range have a size of
- BlockSize.
-
-
- @retval EFI_SUCCESS The firmware volume base address was returned.
-
- @retval EFI_INVALID_PARAMETER The requested LBA is out of range.
-
-**/
-EFI_STATUS
-EFIAPI
-FvbGetBlockSize (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- IN EFI_LBA Lba,
- OUT UINTN *BlockSize,
- OUT UINTN *NumberOfBlocks
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-
-/**
- Reads the specified number of bytes into a buffer from the specified block.
-
- The Read() function reads the requested number of bytes from the
- requested block and stores them in the provided buffer.
- Implementations should be mindful that the firmware volume
- might be in the ReadDisabled state. If it is in this state,
- the Read() function must return the status code
- EFI_ACCESS_DENIED without modifying the contents of the
- buffer. The Read() function must also prevent spanning block
- boundaries. If a read is requested that would span a block
- boundary, the read must read up to the boundary but not
- beyond. The output parameter NumBytes must be set to correctly
- indicate the number of bytes actually read. The caller must be
- aware that a read may be partially completed.
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Lba The starting logical block index
- from which to read.
-
- @param Offset Offset into the block at which to begin reading.
-
- @param NumBytes Pointer to a UINTN. At entry, *NumBytes
- contains the total size of the buffer. At
- exit, *NumBytes contains the total number of
- bytes read.
-
- @param Buffer Pointer to a caller-allocated buffer that will
- be used to hold the data that is read.
-
- @retval EFI_SUCCESS The firmware volume was read successfully,
- and contents are in Buffer.
-
- @retval EFI_BAD_BUFFER_SIZE Read attempted across an LBA
- boundary. On output, NumBytes
- contains the total number of bytes
- returned in Buffer.
-
- @retval EFI_ACCESS_DENIED The firmware volume is in the
- ReadDisabled state.
-
- @retval EFI_DEVICE_ERROR The block device is not
- functioning correctly and could
- not be read.
-
-**/
-EFI_STATUS
-EFIAPI
-FvbRead (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN OUT UINT8 *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Writes the specified number of bytes from the input buffer to the block.
-
- The Write() function writes the specified number of bytes from
- the provided buffer to the specified block and offset. If the
- firmware volume is sticky write, the caller must ensure that
- all the bits of the specified range to write are in the
- EFI_FVB_ERASE_POLARITY state before calling the Write()
- function, or else the result will be unpredictable. This
- unpredictability arises because, for a sticky-write firmware
- volume, a write may negate a bit in the EFI_FVB_ERASE_POLARITY
- state but cannot flip it back again. Before calling the
- Write() function, it is recommended for the caller to first call
- the EraseBlocks() function to erase the specified block to
- write. A block erase cycle will transition bits from the
- (NOT)EFI_FVB_ERASE_POLARITY state back to the
- EFI_FVB_ERASE_POLARITY state. Implementations should be
- mindful that the firmware volume might be in the WriteDisabled
- state. If it is in this state, the Write() function must
- return the status code EFI_ACCESS_DENIED without modifying the
- contents of the firmware volume. The Write() function must
- also prevent spanning block boundaries. If a write is
- requested that spans a block boundary, the write must store up
- to the boundary but not beyond. The output parameter NumBytes
- must be set to correctly indicate the number of bytes actually
- written. The caller must be aware that a write may be
- partially completed. All writes, partial or otherwise, must be
- fully flushed to the hardware before the Write() service
- returns.
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL instance.
-
- @param Lba The starting logical block index to write to.
-
- @param Offset Offset into the block at which to begin writing.
-
- @param NumBytes The pointer to a UINTN. At entry, *NumBytes
- contains the total size of the buffer. At
- exit, *NumBytes contains the total number of
- bytes actually written.
-
- @param Buffer The pointer to a caller-allocated buffer that
- contains the source for the write.
-
- @retval EFI_SUCCESS The firmware volume was written successfully.
-
- @retval EFI_BAD_BUFFER_SIZE The write was attempted across an
- LBA boundary. On output, NumBytes
- contains the total number of bytes
- actually written.
-
- @retval EFI_ACCESS_DENIED The firmware volume is in the
- WriteDisabled state.
-
- @retval EFI_DEVICE_ERROR The block device is malfunctioning
- and could not be written.
-
-
-**/
-EFI_STATUS
-EFIAPI
-FvbWrite (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- IN EFI_LBA Lba,
- IN UINTN Offset,
- IN OUT UINTN *NumBytes,
- IN UINT8 *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-/**
- Erases and initializes a firmware volume block.
-
- The EraseBlocks() function erases one or more blocks as denoted
- by the variable argument list. The entire parameter list of
- blocks must be verified before erasing any blocks. If a block is
- requested that does not exist within the associated firmware
- volume (it has a larger index than the last block of the
- firmware volume), the EraseBlocks() function must return the
- status code EFI_INVALID_PARAMETER without modifying the contents
- of the firmware volume. Implementations should be mindful that
- the firmware volume might be in the WriteDisabled state. If it
- is in this state, the EraseBlocks() function must return the
- status code EFI_ACCESS_DENIED without modifying the contents of
- the firmware volume. All calls to EraseBlocks() must be fully
- flushed to the hardware before the EraseBlocks() service
- returns.
-
- @param This Indicates the EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL
- instance.
-
- @param ... The variable argument list is a list of tuples.
- Each tuple describes a range of LBAs to erase
- and consists of the following:
- - An EFI_LBA that indicates the starting LBA
- - A UINTN that indicates the number of blocks to
- erase.
-
- The list is terminated with an
- EFI_LBA_LIST_TERMINATOR. For example, the
- following indicates that two ranges of blocks
- (5-7 and 10-11) are to be erased: EraseBlocks
- (This, 5, 3, 10, 2, EFI_LBA_LIST_TERMINATOR);
-
- @retval EFI_SUCCESS The erase request successfully
- completed.
-
- @retval EFI_ACCESS_DENIED The firmware volume is in the
- WriteDisabled state.
- @retval EFI_DEVICE_ERROR The block device is not functioning
- correctly and could not be written.
- The firmware device may have been
- partially erased.
- @retval EFI_INVALID_PARAMETER One or more of the LBAs listed
- in the variable argument list do
- not exist in the firmware volume.
-
-**/
-EFI_STATUS
-EFIAPI
-FvbEraseBlocks (
- IN CONST EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL *This,
- ...
- )
-{
- return EFI_UNSUPPORTED;
-}
-
-
-//
-// Making this global saves a few bytes in image size
-//
-EFI_HANDLE gFvbHandle = NULL;
-
-
-///
-/// The Firmware Volume Block Protocol is the low-level interface
-/// to a firmware volume. File-level access to a firmware volume
-/// should not be done using the Firmware Volume Block Protocol.
-/// Normal access to a firmware volume must use the Firmware
-/// Volume Protocol. Typically, only the file system driver that
-/// produces the Firmware Volume Protocol will bind to the
-/// Firmware Volume Block Protocol.
-///
-EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL gFvbProtocol = {
- FvbGetAttributes,
- FvbSetAttributes,
- FvbGetPhysicalAddress,
- FvbGetBlockSize,
- FvbRead,
- FvbWrite,
- FvbEraseBlocks,
- ///
- /// The handle of the parent firmware volume.
- ///
- NULL
-};
-
-
-/**
- Initialize the state information for the CPU Architectural Protocol
-
- @param ImageHandle of the loaded driver
- @param SystemTable Pointer to the System Table
-
- @retval EFI_SUCCESS Protocol registered
- @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure
- @retval EFI_DEVICE_ERROR Hardware problems
-
-**/
-EFI_STATUS
-EFIAPI
-FvbDxeInitialize (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
-
- Status = gBS->InstallMultipleProtocolInterfaces (
- &gFvbHandle,
- &gEfiFirmwareVolumeBlockProtocolGuid, &gFvbProtocol,
- NULL
- );
- ASSERT_EFI_ERROR (Status);
-
- // SetVertAddressEvent ()
-
- // GCD Map NAND as RT
-
- return Status;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf
deleted file mode 100644
index 9e320d85c..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf
+++ /dev/null
@@ -1,53 +0,0 @@
-#/** @file
-#
-# Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-# 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 = FvbDxe
- FILE_GUID = 43ECE281-D9E2-4DD0-B304-E6A5689256F4
- MODULE_TYPE = DXE_RUNTIME_DRIVER
- VERSION_STRING = 1.0
-
- ENTRY_POINT = FvbDxeInitialize
-
-
-[Sources.common]
- FvbDxe.c
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec
-
-[LibraryClasses]
- BaseLib
- UefiLib
- UefiBootServicesTableLib
- DebugLib
- PrintLib
- UefiDriverEntryPoint
- IoLib
-
-[Guids]
-
-
-[Protocols]
- gEfiFirmwareVolumeBlockProtocolGuid
-
-[FixedPcd.common]
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
- gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase
-
-[depex]
- TRUE
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c
deleted file mode 100644
index 2fd2b8353..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/** @file
- Template for ArmEb DebugAgentLib.
-
- For ARM we reserve FIQ for the Debug Agent Timer. We don't care about
- laytency as we only really need the timer to run a few times a second
- (how fast can some one type a ctrl-c?), but it works much better if
- the interrupt we are using to break into the debugger is not being
- used, and masked, by the system.
-
- Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.<BR>
-
- 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 <Base.h>
-
-#include <Library/DebugAgentTimerLib.h>
-
-#include <ArmEb/ArmEb.h>
-
-
-/**
- Setup all the hardware needed for the debug agents timer.
-
- This function is used to set up debug enviroment.
-
-**/
-VOID
-EFIAPI
-DebugAgentTimerIntialize (
- VOID
- )
-{
- // Map Timer to FIQ
-}
-
-
-/**
- Set the period for the debug agent timer. Zero means disable the timer.
-
- @param[in] TimerPeriodMilliseconds Frequency of the debug agent timer.
-
-**/
-VOID
-EFIAPI
-DebugAgentTimerSetPeriod (
- IN UINT32 TimerPeriodMilliseconds
- )
-{
- if (TimerPeriodMilliseconds == 0) {
- // Disable timer and Disable FIQ
- return;
- }
-
- // Set timer period and unmask FIQ
-}
-
-
-/**
- Perform End Of Interrupt for the debug agent timer. This is called in the
- interrupt handler after the interrupt has been processed.
-
-**/
-VOID
-EFIAPI
-DebugAgentTimerEndOfInterrupt (
- VOID
- )
-{
- // EOI Timer interrupt for FIQ
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
deleted file mode 100644
index 7eb16cd30..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
+++ /dev/null
@@ -1,37 +0,0 @@
-#/** @file
-# Component description file for Base PCI Cf8 Library.
-#
-# PCI CF8 Library that uses I/O ports 0xCF8 and 0xCFC to perform PCI Configuration cycles.
-# Layers on top of an I/O Library instance.
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
-#
-# 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 = ArmEbDebugAgentTimerLib
- FILE_GUID = 80949BBB-68EE-4a4c-B434-D5DB5A232F0C
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = DebugAgentTimerLib|SEC BASE DXE_CORE
-
-
-[Sources.common]
- DebugAgentTimerLib.c
-
-
-[Packages]
- MdePkg/MdePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec
-
-[LibraryClasses]
- IoLib
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
deleted file mode 100644
index 2f734f692..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoard.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/** @file
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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 <Library/IoLib.h>
-#include <Library/ArmPlatformLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Drivers/PL341Dmc.h>
-#include <Platform/ArmPlatform.h>
-#include <Ppi/ArmMpCoreInfo.h>
-
-ARM_CORE_INFO mExynosMpCoreInfo[] = {
- {
- // Cluster 0, Core 0
- 0x0, 0x0,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_REG,
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_SET_REG,
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_CLR_REG,
- (UINT64)0xFFFFFFFF
- },
- {
- // Cluster 0, Core 1
- 0x0, 0x1,
-
- // MP Core MailBox Set/Get/Clear Addresses and Clear Value
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_REG,
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_SET_REG,
- (EFI_PHYSICAL_ADDRESS)ARM_EB_SYS_FLAGS_CLR_REG,
- (UINT64)0xFFFFFFFF
- }
-};
-/**
- Return if Trustzone is supported by your platform
-
- A non-zero value must be returned if you want to support a Secure World on your platform.
- ArmPlatformTrustzoneInit() will later set up the secure regions.
- This function can return 0 even if Trustzone is supported by your processor. In this case,
- the platform will continue to run in Secure World.
-
- @return A non-zero value if Trustzone supported.
-
-**/
-UINTN ArmPlatformTrustzoneSupported(VOID) {
- // There is no Trustzone controllers (TZPC & TZASC) and no Secure Memory on RTSM
- return TRUE;
-}
-
-/**
- Initialize the Secure peripherals and memory regions
-
- If Trustzone is supported by your platform then this function makes the required initialization
- of the secure peripherals and memory regions.
-
-**/
-VOID ArmPlatformTrustzoneInit(VOID) {
- UINT32 TZPCBase;
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC0_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC1_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC2_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC3_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC4_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-
-
- TZPCBase = PcdGet32(PcdTZPCBase) + TZPC5_OFFSET;
- MmioWrite32((TZPCBase + 0x00),0x00);
- MmioWrite32((TZPCBase +TZPC_DECPROT0SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT1SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT2SET_OFFSET),0xFF);
- MmioWrite32((TZPCBase +TZPC_DECPROT3SET_OFFSET),0xFF);
-}
-
-/**
- Remap the memory at 0x0
-
- Some platform requires or gives the ability to remap the memory at the address 0x0.
- This function can do nothing if this feature is not relevant to your platform.
-
-**/
-VOID ArmPlatformBootRemapping(VOID) {
- // Disable memory remapping and return to normal mapping
- MmioOr32 (ARM_EB_SYSCTRL, BIT8); //EB_SP810_CTRL_BASE
-}
-
-
-/**
- Return the current Boot Mode
-
- This function returns the boot reason on the platform
-
- @return Return the current Boot Mode of the platform
-
-**/
-EFI_BOOT_MODE
-ArmPlatformGetBootMode (
- VOID
- )
-{
- return BOOT_WITH_FULL_CONFIGURATION;
-}
-
-/**
- Initialize the system (or sometimes called permanent) memory
-
- This memory is generally represented by the DRAM.
-
-**/
-VOID ArmPlatformInitializeSystemMemory(VOID) {
- // We do not need to initialize the System Memory on RTSM
-}
-
-RETURN_STATUS
-ArmPlatformInitialize (
- IN UINTN MpId
- )
-{
-return RETURN_SUCCESS;
-}
-
-
-VOID
-ArmPlatformNormalInitialize (
- VOID
- ) {
-
-}
-
-VOID
-ArmPlatformSecExtraAction (
- IN UINTN CoreId,
- OUT UINTN* JumpAddress
- )
-{
- *JumpAddress = PcdGet32(PcdFvBaseAddress);
-}
-
-EFI_STATUS
-PrePeiCoreGetMpCoreInfo (
- OUT UINTN *CoreCount,
- OUT ARM_CORE_INFO **ArmCoreTable
- )
-{
- *CoreCount = sizeof(mExynosMpCoreInfo) / sizeof(ARM_CORE_INFO);
- *ArmCoreTable = mExynosMpCoreInfo;
-
- return EFI_SUCCESS;
-}
-
-// Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
-EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
-ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
-
-EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
- {
- EFI_PEI_PPI_DESCRIPTOR_PPI,
- &mArmMpCoreInfoPpiGuid,
- &mMpCoreInfoPpi
- }
-};
-
-VOID
-ArmPlatformGetPlatformPpiList (
- OUT UINTN *PpiListSize,
- OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
- )
-{
- *PpiListSize = sizeof(gPlatformPpiTable);
- *PpiList = gPlatformPpiTable;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
deleted file mode 100644
index 9dc7abdf9..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.S
+++ /dev/null
@@ -1,635 +0,0 @@
-/*
- * Copyright (c) 2011, Samsung Electronics Co. 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 <AsmMacroIoLib.h>
-#include <Base.h>
-#include <Library/PcdLib.h>
-#include <Platform/ArmPlatform.h>
-#include <AutoGen.h>
-
-/* Start of Code section */
-.text
-.align 3
-
-GCC_ASM_IMPORT(_SetupPrimaryCoreStack)
-GCC_ASM_EXPORT(ArmPlatformTZPCInitialized)
-GCC_ASM_EXPORT(ArmPlatformUARTInitialized)
-GCC_ASM_EXPORT(ArmPlatformIsClockInitialized)
-GCC_ASM_EXPORT(ArmPlatformIsMemoryInitialized)
-GCC_ASM_EXPORT(ArmPlatformInitializeBootMemory)
-GCC_ASM_EXPORT(ArmPlatformSecBootAction)
-GCC_ASM_EXPORT(ArmPlatformSecBootMemoryInit)
-
-ASM_PFX(ArmPlatformTZPCInitialized):
- ldr r0, =Exynos4210_TZPC0_BASE
- mov r1, #0x0
- str r1, [r0]
- mov r1, #0xff
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC1_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC2_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC3_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC4_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC5_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- bx lr
-
-ASM_PFX(ArmPlatformUARTInitialized):
- ldr r0, =0x11400000
- ldr r1, =0x22222222
- str r1, [r0]
- ldr r0, =0x11400020
- ldr r1, =0x222222
- str r1, [r0]
-
- ldr r0, =Exynos4210_CMU_BASE
- ldr r1, =CLK_SRC_PERIL0_VAL
- ldr r2, =CLK_SRC_PERIL0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_PERIL0_VAL
- ldr r2, =CLK_DIV_PERIL0_OFFSET
- str r1, [r0, r2]
-
- ldr r0, =Exynos4210_UART_BASE
- ldr r1, =0x111
- str r1, [r0, #UFCON_OFFSET]
-
- mov r1, #0x3
- str r1, [r0, #ULCON_OFFSET]
-
- ldr r1, =0x3c5
- str r1, [r0, #UCON_OFFSET]
-
- ldr r1, =UART_UBRDIV_VAL
- str r1, [r0, #UBRDIV_OFFSET]
-
- ldr r1, =UART_UDIVSLOT_VAL
- str r1, [r0, #UDIVSLOT_OFFSET]
-
- ldr r1, =0x4c4c4c4c
- str r1, [r0, #UTXH_OFFSET] // 'L'
-
- ldr r1, =0x4a4a4a4a
- str r1, [r0, #UTXH_OFFSET] // 'J'
-
- ldr r1, =0x50505050
- str r1, [r0, #UTXH_OFFSET] // 'P'
-
- bx lr
-
-
-ASM_PFX(ArmPlatformIsClockInitialized):
- ldr r0, =Exynos4210_CMU_BASE
-
- ldr r1, =0x0
- ldr r2, =CLK_SRC_CPU_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_1:
- subs r1, r1, #1
- bne cmu_1
-
- ldr r1, =CLK_DIV_CPU0_VAL
- ldr r2, =CLK_DIV_CPU0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_CPU1_VAL
- ldr r2, =CLK_DIV_CPU1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =0x10000
- ldr r2, =CLK_SRC_DMC_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_2:
- subs r1, r1, #1
- bne cmu_2
-
- ldr r1, =CLK_DIV_DMC0_VAL
- ldr r2, =CLK_DIV_DMC0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_DMC1_VAL
- ldr r2, =CLK_DIV_DMC1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_TOP0_VAL
- ldr r2, =CLK_SRC_TOP0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_SRC_TOP1_VAL
- ldr r2, =CLK_SRC_TOP1_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-
-cmu_3:
- subs r1, r1, #1
- bne cmu_3
-
- ldr r1, =CLK_DIV_TOP_VAL
- ldr r2, =CLK_DIV_TOP_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_LEFTBUS_VAL
- ldr r2, =CLK_SRC_LEFTBUS_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_4:
- subs r1, r1, #1
- bne cmu_4
-
- ldr r1, =CLK_DIV_LEFRBUS_VAL
- ldr r2, =CLK_DIV_LEFTBUS_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_RIGHTBUS_VAL
- ldr r2, =CLK_SRC_RIGHTBUS_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_5:
- subs r1, r1, #1
- bne cmu_5
-
- ldr r1, =CLK_DIV_RIGHTBUS_VAL
- ldr r2, =CLK_DIV_RIGHTBUS_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_LOCK_VAL
- ldr r2, =APLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =MPLL_LOCK_VAL
- ldr r2, =MPLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =EPLL_LOCK_VAL
- ldr r2, =EPLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =VPLL_LOCK_VAL
- ldr r2, =VPLL_LOCK_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_CON1_VAL
- ldr r2, =APLL_CON1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_CON0_VAL
- ldr r2, =APLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =MPLL_CON1_VAL
- ldr r2, =MPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =MPLL_CON0_VAL
- ldr r2, =MPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =EPLL_CON1_VAL
- ldr r2, =EPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =EPLL_CON0_VAL
- ldr r2, =EPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =VPLL_CON1_VAL
- ldr r2, =VPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =VPLL_CON0_VAL
- ldr r2, =VPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_6:
- subs r1, r1, #1
- bne cmu_6
-
- ldr r1, =CLK_SRC_CPU_VAL_MOUTMPLLFOUT
- ldr r2, =CLK_SRC_CPU_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_7:
- subs r1, r1, #1
- bne cmu_7
-
- ldr r0, =Exynos4210_DMC_0_BASE
-
- ldr r1, =0x6910100A
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- ldr r1, =0x6910100B
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_8:
- subs r1, r1, #1
- bne cmu_8
-
- ldr r1, =0x0000008C
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_9:
- subs r1, r1, #1
- bne cmu_9
-
- ldr r0, =Exynos4210_DMC_1_BASE
-
- ldr r1, =0xe910100A
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- ldr r1, =0xe910100B
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_10:
- subs r1, r1, #1
- bne cmu_10
-
- ldr r1, =0x0000008C
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_11:
- subs r1, r1, #1
- bne cmu_11
-
- ldr r0, =Exynos4210_DMC_0_BASE
- ldr r1, =0x0FFF30fa
- ldr r2, =DMC_CONCONTROL
- str r1, [r0, r2]
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0x0FFF30fa
- ldr r2, =DMC_CONCONTROL
- str r1, [r0, r2]
-
- ldr r0, =Exynos4210_DMC_0_BASE
- ldr r1, =0x00202537
- ldr r2, =DMC_MEMCONTROL
- str r1, [r0, r2]
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0x00202537
- ldr r2, =DMC_MEMCONTROL
- str r1, [r0, r2]
-
- bx lr
-
-/*
- * Call at the beginning of the platform boot up
- *
- * This function allows the firmware platform to do extra actions at the early
- * stage of the platform power up.
- *
- * Note: This function must be implemented in assembler
- * as there is no stack set up yet
- */
-ASM_PFX(ArmPlatformSecBootAction):
- bx lr
-
-
-ASM_PFX(ArmPlatformSecBootMemoryInit):
- bx lr
-
-/*
- * Called at the early stage of the Boot phase to know if the memory has
- * already been initialized. Running the code from the reset vector does
- * not mean we start from cold boot. In some case, we can go through this
- * code with the memory already initialized.
- * Because this function is called at the early stage, the implementation
- * must not use the stack. Its implementation must probably done in
- * assembly to ensure this requirement.
- *
- * @return Return the condition value into the 'Z' flag
- */
-ASM_PFX(ArmPlatformIsMemoryInitialized):
- /*
- * Check if the memory has been already mapped,
- * if so skipped the memory initialization
- */
- LoadConstantToReg (Exynos4210_DMC_0_BASE, r0)
- ldr r0, [r0, #0]
- and r0, r0, #0x20
- cmp r0, #0x00
- bx lr
-
-/*
- * Initialize the memory where the initial stacks will reside
- *
- * This memory can contain the initial stacks (Secure and Secure Monitor
- * stacks). In some platform, this region is already initialized and the
- * implementation of this function can do nothing. This memory can also
- * represent the Secure RAM.
- * This function is called before the satck has been set up. Its
- * implementation must ensure the stack pointer is not used (probably
- * required to use assembly language)
- */
-ASM_PFX(ArmPlatformInitializeBootMemory):
-/*
- * Check if the Memory is already Initialized.
- * If Initialized goto Stack setup
- */
- mov r10, lr
- bl ASM_PFX(ArmPlatformIsMemoryInitialized)
- bne skip_initmem
-
- ldr r0, =0x10010350
- mov r1, #1
- str r1, [r0]
-
-/* CLK_DIV_DMC0 on iROM DMC=50MHz for Init DMC */
- ldr r0, =Exynos4210_CMU_BASE
- ldr r1, =0x13113113
- ldr r2, =Exynos4210_CMU_DIV_DMC0
- str r1, [r0, r2]
-
-/* MIU Setting */
- ldr r0, =Exynos4210_MIU_BASE
-
- ldr r1, =0x20001507
- str r1, [r0, #0x400]
- ldr r1, =0x00000001
- str r1, [r0, #0xc00]
-
-/*****************************************************************/
-/*DREX0***********************************************************/
-/*****************************************************************/
-
- ldr r0, =Exynos4210_DMC_0_BASE
-
- ldr r1, =0xE3855503
- str r1, [r0, #DMC_PHYZQCONTROL]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x7110100A
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000000
- str r1, [r0, #DMC_PHYCONTROL2]
-
- ldr r1, =0x0FFF30da
- str r1, [r0, #DMC_CONCONTROL]
-
- ldr r1, =0x00202500
- str r1, [r0, #DMC_MEMCONTROL]
-
- ldr r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0xff000000
- str r1, [r0, #DMC_PRECHCONFIG]
-
- ldr r1, =0x0000005D
- str r1, [r0, #DMC_TIMINGAREF]
-
- ldr r1, =0x34498691
- str r1, [r0, #DMC_TIMINGROW]
-
- ldr r1, =0x36330306
- str r1, [r0, #DMC_TIMINGDATA]
-
- ldr r1, =0x50380365
- str r1, [r0, #DMC_TIMINGPOWER]
-
- mov r2, #Exynos4210_DMC_DELAY
-
-loop_2:
- subs r2, r2, #1
- bne loop_2
- ldr r1, =0x07000000
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_3:
- subs r2, r2, #1
- bne loop_3
- ldr r1, =0x00071C00
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_4:
- subs r2, r2, #1
- bne loop_4
-
- ldr r1, =0x00010BFC
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_5:
- subs r2, r2, #1
- bne loop_5
- ldr r1, =0x00000488
- str r1, [r0, #DMC_DIRECTCMD]
- ldr r1, =0x00000810
- str r1, [r0, #DMC_DIRECTCMD]
- ldr r1, =0x00000C08
- str r1, [r0, #DMC_DIRECTCMD]
-
-/* get DMC density information */
- ldr r1, =0x09010000
- mov r3, #10
-loop_6:
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_7:
- subs r2, r2, #1
- bne loop_7
- ldr r6, [r0, #DMC_MRSTATUS]
- subs r3, r3, #1
- bne loop_6
- and r6, r6, #0x3c
- lsr r6, r6, #2
- cmp r6, #6
- ldreq r1, =0x20e01323
- ldrne r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
-/*****************************************************************/
-/*DREX1***********************************************************/
-/*****************************************************************/
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0xE3855503
- str r1, [r0, #DMC_PHYZQCONTROL]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x7110100A
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000000
- str r1, [r0, #DMC_PHYCONTROL2]
-
- ldr r1, =0x0FFF30da
- str r1, [r0, #DMC_CONCONTROL]
-
- ldr r1, =0x00202500
- str r1, [r0, #DMC_MEMCONTROL]
-
- ldr r1, =0x40f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0xff000000
- str r1, [r0, #DMC_PRECHCONFIG]
-
- ldr r1, =0x0000005D
- str r1, [r0, #DMC_TIMINGAREF]
-
- ldr r1, =0x34498691
- str r1, [r0, #DMC_TIMINGROW]
-
- ldr r1, =0x36330306
- str r1, [r0, #DMC_TIMINGDATA]
-
- ldr r1, =0x50380365
- str r1, [r0, #DMC_TIMINGPOWER]
-
- mov r2, #Exynos4210_DMC_DELAY
-loop_8:
- subs r2, r2, #1
- bne loop_8
- ldr r1, =0x07000000
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_9:
- subs r2, r2, #1
- bne loop_9
- ldr r1, =0x00071C00
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_10:
- subs r2, r2, #1
- bne loop_10
-
- ldr r1, =0x00010BFC
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_11:
- subs r2, r2, #1
- bne loop_11
- ldr r1, =0x00000488
- str r1, [r0, #DMC_DIRECTCMD]
-
- ldr r1, =0x00000810
- str r1, [r0, #DMC_DIRECTCMD]
-
- ldr r1, =0x00000C08
- str r1, [r0, #DMC_DIRECTCMD]
-
-/* get DMC density information */
- ldr r1, =0x09010000
- mov r3, #10
-loop_12:
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_13:
- subs r2, r2, #1
- bne loop_13
- ldr r7, [r0, #DMC_MRSTATUS]
- subs r3, r3, #1
- bne loop_12
- and r7, r7, #0x3c
- lsr r7, r7, #2
- cmp r7, #6
- ldreq r1, =0x20e01323
- ldrne r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-skip_initmem:
- mov lr, r10
- bx lr
-
-.end
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.asm b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.asm
deleted file mode 100644
index 7960f22ee..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardHelper.asm
+++ /dev/null
@@ -1,609 +0,0 @@
-//
-// Copyright (c) 2011, Samsung Electronics Co. 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 <AsmMacroIoLib.h>
-#include <Base.h>
-#include <Library/PcdLib.h>
-#include <Platform/ArmPlatform.h>
-#include <AutoGen.h>
-
- INCLUDE AsmMacroIoLib.inc
-
- EXPORT ArmPlatformTZPCInitialized
- EXPORT ArmPlatformUARTInitialized
- EXPORT ArmPlatformIsClockInitialized
- EXPORT ArmPlatformIsMemoryInitialized
- EXPORT ArmPlatformInitializeBootMemory
-
- PRESERVE8
- AREA ArmRealViewEbHelper, CODE, READONLY
-
-ArmPlatformTZPCInitialized
- ldr r0, =Exynos4210_TZPC0_BASE
- mov r1, #0x0
- str r1, [r0]
- mov r1, #0xff
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC1_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC2_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC3_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC4_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- ldr r0, =Exynos4210_TZPC5_BASE
- str r1, [r0, #TZPC_DECPROT0SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT1SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT2SET_OFFSET]
- str r1, [r0, #TZPC_DECPROT3SET_OFFSET]
-
- bx lr
-
-ArmPlatformUARTInitialized
- ldr r0, =0x11400000
- ldr r1, =0x22222222
- str r1, [r0]
- ldr r0, =0x11400020
- ldr r1, =0x222222
- str r1, [r0]
-
- ldr r0, =Exynos4210_CMU_BASE
- ldr r1, =CLK_SRC_PERIL0_VAL
- ldr r2, =CLK_SRC_PERIL0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_PERIL0_VAL
- ldr r2, =CLK_DIV_PERIL0_OFFSET
- str r1, [r0, r2]
-
- ldr r0, =Exynos4210_UART_BASE
- ldr r1, =0x111
- str r1, [r0, #UFCON_OFFSET]
-
- mov r1, #0x3
- str r1, [r0, #ULCON_OFFSET]
-
- ldr r1, =0x3c5
- str r1, [r0, #UCON_OFFSET]
-
- ldr r1, =UART_UBRDIV_VAL
- str r1, [r0, #UBRDIV_OFFSET]
-
- ldr r1, =UART_UDIVSLOT_VAL
- str r1, [r0, #UDIVSLOT_OFFSET]
-
- ldr r1, =0x4c4c4c4c
- str r1, [r0, #UTXH_OFFSET] // 'L'
-
- ldr r1, =0x4a4a4a4a
- str r1, [r0, #UTXH_OFFSET] // 'J'
-
- ldr r1, =0x50505050
- str r1, [r0, #UTXH_OFFSET] // 'P'
-
- bx lr
-
-ArmPlatformIsClockInitialized
- ldr r0, =Exynos4210_CMU_BASE
-
- ldr r1, =0x0
- ldr r2, =CLK_SRC_CPU_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_1
- subs r1, r1, #1
- bne cmu_1
-
- ldr r1, =CLK_DIV_CPU0_VAL
- ldr r2, =CLK_DIV_CPU0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_CPU1_VAL
- ldr r2, =CLK_DIV_CPU1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =0x10000
- ldr r2, =CLK_SRC_DMC_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_2
- subs r1, r1, #1
- bne cmu_2
-
- ldr r1, =CLK_DIV_DMC0_VAL
- ldr r2, =CLK_DIV_DMC0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_DIV_DMC1_VAL
- ldr r2, =CLK_DIV_DMC1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_TOP0_VAL
- ldr r2, =CLK_SRC_TOP0_OFFSET
- str r1, [r0, r2]
- ldr r1, =CLK_SRC_TOP1_VAL
- ldr r2, =CLK_SRC_TOP1_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_3
- subs r1, r1, #1
- bne cmu_3
-
- ldr r1, =CLK_DIV_TOP_VAL
- ldr r2, =CLK_DIV_TOP_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_LEFTBUS_VAL
- ldr r2, =CLK_SRC_LEFTBUS_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_4
- subs r1, r1, #1
- bne cmu_4
-
- ldr r1, =CLK_DIV_LEFRBUS_VAL
- ldr r2, =CLK_DIV_LEFTBUS_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =CLK_SRC_RIGHTBUS_VAL
- ldr r2, =CLK_SRC_RIGHTBUS_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_5
- subs r1, r1, #1
- bne cmu_5
-
- ldr r1, =CLK_DIV_RIGHTBUS_VAL
- ldr r2, =CLK_DIV_RIGHTBUS_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_LOCK_VAL
- ldr r2, =APLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =MPLL_LOCK_VAL
- ldr r2, =MPLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =EPLL_LOCK_VAL
- ldr r2, =EPLL_LOCK_OFFSET
- str r1, [r0, r2]
- ldr r1, =VPLL_LOCK_VAL
- ldr r2, =VPLL_LOCK_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_CON1_VAL
- ldr r2, =APLL_CON1_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =APLL_CON0_VAL
- ldr r2, =APLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =MPLL_CON1_VAL
- ldr r2, =MPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =MPLL_CON0_VAL
- ldr r2, =MPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =EPLL_CON1_VAL
- ldr r2, =EPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =EPLL_CON0_VAL
- ldr r2, =EPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- ldr r1, =VPLL_CON1_VAL
- ldr r2, =VPLL_CON1_OFFSET
- str r1, [r0, r2]
- ldr r1, =VPLL_CON0_VAL
- ldr r2, =VPLL_CON0_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_6
- subs r1, r1, #1
- bne cmu_6
-
- ldr r1, =CLK_SRC_CPU_VAL_MOUTMPLLFOUT
- ldr r2, =CLK_SRC_CPU_OFFSET
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_7
- subs r1, r1, #1
- bne cmu_7
-
- ldr r0, =Exynos4210_DMC_0_BASE
-
- ldr r1, =0x6910100A
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- ldr r1, =0x6910100B
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_8
- subs r1, r1, #1
- bne cmu_8
-
- ldr r1, =0x0000008C
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_9
- subs r1, r1, #1
- bne cmu_9
-
- ldr r0, =Exynos4210_DMC_1_BASE
-
- ldr r1, =0xe910100A
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- ldr r1, =0xe910100B
-
- ldr r2, =DMC_PHYCONTROL0
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_10
- subs r1, r1, #1
- bne cmu_10
-
- ldr r1, =0x0000008C
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
- ldr r1, =0x00000084
- ldr r2, =DMC_PHYCONTROL1
- str r1, [r0, r2]
-
- mov r1, #Exynos4210_CMU_DELAY
-cmu_11
- subs r1, r1, #1
- bne cmu_11
-
- ldr r0, =Exynos4210_DMC_0_BASE
- ldr r1, =0x0FFF30fa
- ldr r2, =DMC_CONCONTROL
- str r1, [r0, r2]
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0x0FFF30fa
- ldr r2, =DMC_CONCONTROL
- str r1, [r0, r2]
-
- ldr r0, =Exynos4210_DMC_0_BASE
- ldr r1, =0x00202537
- ldr r2, =DMC_MEMCONTROL
- str r1, [r0, r2]
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0x00202537
- ldr r2, =DMC_MEMCONTROL
- str r1, [r0, r2]
-
- bx lr
-
-/**
- Called at the early stage of the Boot phase to know if the memory has already been initialized
-
- Running the code from the reset vector does not mean we start from cold boot. In some case, we
- can go through this code with the memory already initialized.
- Because this function is called at the early stage, the implementation must not use the stack.
- Its implementation must probably done in assembly to ensure this requirement.
-
- @return Return the condition value into the 'Z' flag
-
-**/
-ArmPlatformIsMemoryInitialized
- // Check if the memory has been already mapped, if so skipped the memory initialization
- LoadConstantToReg (Exynos4210_DMC_0_BASE, r0)
- ldr r0, [r0, #0]
- // Check Controller register is initialized or not by Auto-refresh bit
- and r0, r0, #0x20
- cmp r0, #0x20
- bx lr
-/**
- Initialize the memory where the initial stacks will reside
-
- This memory can contain the initial stacks (Secure and Secure Monitor stacks).
- In some platform, this region is already initialized and the implementation of this function can
- do nothing. This memory can also represent the Secure RAM.
- This function is called before the satck has been set up. Its implementation must ensure the stack
- pointer is not used (probably required to use assembly language)
-
-**/
-ArmPlatformInitializeBootMemory
-
-//Async bridge configuration at CPU_core(1: half_sync 0: full_sync)
- ldr r0, =0x10010350
- mov r1, #1
- str r1, [r0]
-
-//CLK_DIV_DMC0 on iROM DMC=50MHz for Init DMC
- ldr r0, =Exynos4210_CMU_BASE
- ldr r1, =0x13113113
- ldr r2, =Exynos4210_CMU_DIV_DMC0
- str r1, [r0, r2]
-
-//MIU Setting
- ldr r0, =Exynos4210_MIU_BASE
-
- ldr r1, =0x20001507
- str r1, [r0, #0x400]
- ldr r1, =0x00000001
- str r1, [r0, #0xc00]
-
-/*****************************************************************/
-/*DREX0***********************************************************/
-/*****************************************************************/
-
- ldr r0, =Exynos4210_DMC_0_BASE
-
- ldr r1, =0xE3855503
- str r1, [r0, #DMC_PHYZQCONTROL]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x7110100A
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000000
- str r1, [r0, #DMC_PHYCONTROL2]
-
- ldr r1, =0x0FFF30da
- str r1, [r0, #DMC_CONCONTROL]
-
- ldr r1, =0x00202500
- str r1, [r0, #DMC_MEMCONTROL]
-
- ldr r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0xff000000
- str r1, [r0, #DMC_PRECHCONFIG]
-
- ldr r1, =0x0000005D
- str r1, [r0, #DMC_TIMINGAREF]
-
- ldr r1, =0x34498691
- str r1, [r0, #DMC_TIMINGROW]
-
- ldr r1, =0x36330306
- str r1, [r0, #DMC_TIMINGDATA]
-
- ldr r1, =0x50380365
- str r1, [r0, #DMC_TIMINGPOWER]
-
- mov r2, #Exynos4210_DMC_DELAY
-
-loop_2
- subs r2, r2, #1
- bne loop_2
- ldr r1, =0x07000000
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_3
- subs r2, r2, #1
- bne loop_3
- ldr r1, =0x00071C00
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_4
- subs r2, r2, #1
- bne loop_4
-
- ldr r1, =0x00010BFC
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_5
- subs r2, r2, #1
- bne loop_5
- ldr r1, =0x00000488
- str r1, [r0, #DMC_DIRECTCMD]
- ldr r1, =0x00000810
- str r1, [r0, #DMC_DIRECTCMD]
- ldr r1, =0x00000C08
- str r1, [r0, #DMC_DIRECTCMD]
-#if 1
-//get DMC density information
- ldr r1, =0x09010000
- mov r3, #10
-loop_6
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_7
- subs r2, r2, #1
- bne loop_7
- ldr r6, [r0, #DMC_MRSTATUS]
- subs r3, r3, #1
- bne loop_6
- and r6, r6, #0x3c
- lsr r6, r6, #2
- cmp r6, #6
- ldreq r1, =0x20e01323
- ldrne r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-#endif
-
-/*****************************************************************/
-/*DREX1***********************************************************/
-/*****************************************************************/
- ldr r0, =Exynos4210_DMC_1_BASE
- ldr r1, =0xE3855503
- str r1, [r0, #DMC_PHYZQCONTROL]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x7110100A
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x71101008
- str r1, [r0, #DMC_PHYCONTROL0]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x0000008C
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000084
- str r1, [r0, #DMC_PHYCONTROL1]
-
- ldr r1, =0x00000000
- str r1, [r0, #DMC_PHYCONTROL2]
-
- ldr r1, =0x0FFF30da
- str r1, [r0, #DMC_CONCONTROL]
-
- ldr r1, =0x00202500
- str r1, [r0, #DMC_MEMCONTROL]
-
- ldr r1, =0x40f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-
- ldr r1, =0xff000000
- str r1, [r0, #DMC_PRECHCONFIG]
-
- ldr r1, =0x0000005D
- str r1, [r0, #DMC_TIMINGAREF]
-
- ldr r1, =0x34498691
- str r1, [r0, #DMC_TIMINGROW]
-
- ldr r1, =0x36330306
- str r1, [r0, #DMC_TIMINGDATA]
-
- ldr r1, =0x50380365
- str r1, [r0, #DMC_TIMINGPOWER]
-
- mov r2, #Exynos4210_DMC_DELAY
-loop_8
- subs r2, r2, #1
- bne loop_8
- ldr r1, =0x07000000
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_9
- subs r2, r2, #1
- bne loop_9
- ldr r1, =0x00071C00
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_10
- subs r2, r2, #1
- bne loop_10
-
- ldr r1, =0x00010BFC
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_11
- subs r2, r2, #1
- bne loop_11
- ldr r1, =0x00000488
- str r1, [r0, #DMC_DIRECTCMD]
-
- ldr r1, =0x00000810
- str r1, [r0, #DMC_DIRECTCMD]
-
- ldr r1, =0x00000C08
- str r1, [r0, #DMC_DIRECTCMD]
-
-#if 1
-// get DMC density information
- ldr r1, =0x09010000
- mov r3, #10
-loop_12
- str r1, [r0, #DMC_DIRECTCMD]
- mov r2, #Exynos4210_DMC_DELAY
-loop_13
- subs r2, r2, #1
- bne loop_13
- ldr r7, [r0, #DMC_MRSTATUS]
- subs r3, r3, #1
- bne loop_12
- and r7, r7, #0x3c
- lsr r7, r7, #2
- cmp r7, #6
- ldreq r1, =0x20e01323
- ldrne r1, =0x20f01223
- str r1, [r0, #DMC_MEMCONFIG0]
-#endif
-
- bx lr
-
- END
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
deleted file mode 100644
index 847f8ae27..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
+++ /dev/null
@@ -1,49 +0,0 @@
-#/* @file
-# Copyright (c) 2011, Samsung Electronics Co. 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]
- INF_VERSION = 0x00010005
- BASE_NAME = SmdkBoardLib
- FILE_GUID = 736343a0-1d96-11e0-aaaa-0002a5d5c51b
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformLib
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-
-[LibraryClasses]
- IoLib
- ArmLib
-
-
-[Sources.common]
- SmdkBoard.c
- SmdkBoardMem.c
-
-[Protocols]
-
-[FeaturePcd]
- gEmbeddedTokenSpaceGuid.PcdCacheEnable
- gArmPlatformTokenSpaceGuid.PcdStandalone
-[FixedPcd]
- gArmTokenSpaceGuid.PcdFvBaseAddress
- gArmTokenSpaceGuid.PcdSystemMemoryBase
- gArmTokenSpaceGuid.PcdSystemMemorySize
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize
- gExynosPkgTokenSpaceGuid.PcdTZPCBase
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardMem.c b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardMem.c
deleted file mode 100644
index db1a163c8..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardMem.c
+++ /dev/null
@@ -1,210 +0,0 @@
-/** @file
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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 <Library/ArmPlatformLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Library/MemoryAllocationLib.h>
-
-// DDR attributes
-#define DDR_ATTRIBUTES_CACHED ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK
-#define DDR_ATTRIBUTES_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED
-#define DDR_ATTRIBUTES_SECURE_CACHED ARM_MEMORY_REGION_ATTRIBUTE_SECURE_WRITE_BACK
-#define DDR_ATTRIBUTES_SECURE_UNCACHED ARM_MEMORY_REGION_ATTRIBUTE_SECURE_UNCACHED_UNBUFFERED
-
-#if 0
-/**
- Return the information about the memory region in permanent memory used by PEI
-
- One of the PEI Module must install the permament memory used by PEI. This function returns the
- information about this region for your platform to this PEIM module.
-
- @param[out] PeiMemoryBase Base of the memory region used by PEI core and modules
- @param[out] PeiMemorySize Size of the memory region used by PEI core and modules
-
-**/
-VOID ArmPlatformGetPeiMemory (
- OUT UINTN* PeiMemoryBase,
- OUT UINTN* PeiMemorySize
- ) {
- ASSERT((PeiMemoryBase != NULL) && (PeiMemorySize != NULL));
-
- // *PeiMemoryBase = ARM_EB_DRAM_BASE + ARM_EB_EFI_FIX_ADDRESS_REGION_SZ;
- // *PeiMemorySize = ARM_EB_EFI_MEMORY_REGION_SZ;
- *PeiMemoryBase = PcdGet32(PcdSystemMemoryBase) + PcdGet32(PcdSystemMemoryFixRegionSize);
- *PeiMemorySize = PcdGet32(PcdSystemMemoryUefiRegionSize);
-}
-#endif
-/**
- Return the Virtual Memory Map of your platform
-
- This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
-
- @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
- Virtual Memory mapping. This array must be ended by a zero-filled
- entry
-
-**/
-VOID ArmPlatformGetVirtualMemoryMap(ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap) {
-// UINT32 val32;
- UINT32 CacheAttributes;
- ARM_MEMORY_REGION_DESCRIPTOR *VirtualMemoryTable;
-
- ASSERT(VirtualMemoryMap != NULL);
-
- VirtualMemoryTable = (ARM_MEMORY_REGION_DESCRIPTOR*)AllocatePages(sizeof(ARM_MEMORY_REGION_DESCRIPTOR) * 5);
- if (VirtualMemoryTable == NULL) {
- return;
- }
-
- if (FeaturePcdGet(PcdCacheEnable) == TRUE) {
- CacheAttributes = DDR_ATTRIBUTES_CACHED;
- } else {
- CacheAttributes = DDR_ATTRIBUTES_UNCACHED;
- }
-
- // SFR
- VirtualMemoryTable[0].PhysicalBase = 0x00000000;
- VirtualMemoryTable[0].VirtualBase = 0x00000000;
- VirtualMemoryTable[0].Length = 0x20000000;
- VirtualMemoryTable[0].Attributes = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
-
- // DDR
- VirtualMemoryTable[1].PhysicalBase = 0x40000000;
- VirtualMemoryTable[1].VirtualBase = 0x40000000;
- VirtualMemoryTable[1].Length = 0x0e000000;
- VirtualMemoryTable[1].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes;
-
- // framebuffer
- VirtualMemoryTable[2].PhysicalBase = 0x4e000000;
- VirtualMemoryTable[2].VirtualBase = 0x4e000000;
- VirtualMemoryTable[2].Length = 0x02000000;
- VirtualMemoryTable[2].Attributes = DDR_ATTRIBUTES_UNCACHED;
-
- VirtualMemoryTable[3].PhysicalBase = 0x50000000;
- VirtualMemoryTable[3].VirtualBase = 0x50000000;
- VirtualMemoryTable[3].Length = 0xb0000000;
- VirtualMemoryTable[3].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)CacheAttributes;
-
- // End of Table
- VirtualMemoryTable[4].PhysicalBase = 0;
- VirtualMemoryTable[4].VirtualBase = 0;
- VirtualMemoryTable[4].Length = 0;
- VirtualMemoryTable[4].Attributes = (ARM_MEMORY_REGION_ATTRIBUTES)0;
-
- *VirtualMemoryMap = VirtualMemoryTable;
-}
-
-
-
-#if 0
-/**
- Return the EFI Memory Map of your platform
-
- This EFI Memory Map of the System Memory is used by MemoryInitPei module to create the Resource
- Descriptor HOBs used by DXE core.
-
- @param[out] EfiMemoryMap Array of ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR describing an
- EFI Memory region. This array must be ended by a zero-filled entry
-
-**/
-VOID ArmPlatformGetEfiMemoryMap (
- OUT ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR** EfiMemoryMap
-) {
- EFI_RESOURCE_ATTRIBUTE_TYPE Attributes;
- UINT64 MemoryBase;
- UINTN Index = 0;
- ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR *EfiMemoryTable;
-
- ASSERT(EfiMemoryMap != NULL);
-
- EfiMemoryTable = (ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR*)AllocatePages(sizeof(ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR) * 6);
-
- Attributes =
- (
- EFI_RESOURCE_ATTRIBUTE_PRESENT |
- EFI_RESOURCE_ATTRIBUTE_INITIALIZED |
- EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
- EFI_RESOURCE_ATTRIBUTE_TESTED
- );
- MemoryBase = PcdGet32(PcdSystemMemoryBase);//ARM_EB_DRAM_BASE;
-
- // Memory Reserved for fixed address allocations (such as Exception Vector Table)
- EfiMemoryTable[Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdSystemMemoryFixRegionSize);//ARM_EB_EFI_FIX_ADDRESS_REGION_SZ;
-
- MemoryBase += PcdGet32(PcdSystemMemoryFixRegionSize);//ARM_EB_EFI_FIX_ADDRESS_REGION_SZ;
-
- // Memory declared to PEI as permanent memory for PEI and DXE
- EfiMemoryTable[++Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdSystemMemoryUefiRegionSize);//ARM_EB_EFI_MEMORY_REGION_SZ;
-
- MemoryBase += PcdGet32(PcdSystemMemoryUefiRegionSize);//ARM_EB_EFI_MEMORY_REGION_SZ;
-
- // We must reserve the memory used by the Firmware Volume copied in DRAM at 0x80000000
- if (!PcdGet32(PcdStandalone)) {
- // Chunk between the EFI Memory region and the firmware
- EfiMemoryTable[++Index].ResourceAttribute = Attributes;
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- //EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdEmbeddedFdBaseAddress) - MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdNormalFdBaseAddress) - MemoryBase;
-
- // Chunk reserved by the firmware in DRAM
- EfiMemoryTable[++Index].ResourceAttribute = Attributes & (~EFI_RESOURCE_ATTRIBUTE_PRESENT);
- //EfiMemoryTable[Index].PhysicalStart = PcdGet32(PcdEmbeddedFdBaseAddress);
- EfiMemoryTable[Index].PhysicalStart = PcdGet32(PcdNormalFdBaseAddress);
- //EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdEmbeddedFdSize);
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdNormalFdSize);
-
- //MemoryBase = PcdGet32(PcdEmbeddedFdBaseAddress) + PcdGet32(PcdEmbeddedFdSize);
- MemoryBase = PcdGet32(PcdNormalFdBaseAddress) + PcdGet32(PcdNormalFdSize);
- }
-
- // We allocate all the remain memory as untested system memory
- EfiMemoryTable[++Index].ResourceAttribute = Attributes & (~EFI_RESOURCE_ATTRIBUTE_TESTED);
- EfiMemoryTable[Index].PhysicalStart = MemoryBase;
- EfiMemoryTable[Index].NumberOfBytes = PcdGet32(PcdSystemMemorySize) - (MemoryBase-PcdGet32(PcdSystemMemoryBase));
-
- EfiMemoryTable[++Index].ResourceAttribute = 0;
- EfiMemoryTable[Index].PhysicalStart = 0;
- EfiMemoryTable[Index].NumberOfBytes = 0;
-
- *EfiMemoryMap = EfiMemoryTable;
-}
-#endif
-
-/**
- Return the EFI Memory Map of your platform
-
- This EFI Memory Map of the System Memory is used by MemoryInitPei module to create the Resource
- Descriptor HOBs used by DXE core.
-
- @param[out] EfiMemoryMap Array of ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR describing an
- EFI Memory region. This array must be ended by a zero-filled entry
-
-**/
-EFI_STATUS
-ArmPlatformGetAdditionalSystemMemory (
- OUT ARM_SYSTEM_MEMORY_REGION_DESCRIPTOR** EfiMemoryMap
-) {
-
-// ArmPlatformGetEfiMemoryMap(EfiMemoryMap);
- //return EFI_SUCCESS;
- return EFI_UNSUPPORTED;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
deleted file mode 100644
index 9471df2fb..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSec.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/** @file
-*
-* Copyright (c) 2011, Samsung Electronics Co. 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 <Library/IoLib.h>
-#include <Library/ArmPlatformLib.h>
-#include <Library/DebugLib.h>
-#include <Library/PcdLib.h>
-#include <Drivers/PL310L2Cache.h>
-#include <Drivers/PL341Dmc.h>
-
-
-/**
- Initialize controllers that must setup at the early stage
-
- Some peripherals must be initialized in Secure World.
- For example, some L2x0 requires to be initialized in Secure World
- ============ added by girish to resolve compile error=================
-**/
-
-VOID
-ArmPlatformSecInitialize (
- VOID
- ) {
- // The L2x0 controller must be intialize in Secure World
- L2x0CacheInit(PcdGet32(PcdL2x0ControllerBase),
- PL310_TAG_LATENCIES(L2x0_LATENCY_8_CYCLES,L2x0_LATENCY_8_CYCLES,L2x0_LATENCY_8_CYCLES),
- PL310_DATA_LATENCIES(L2x0_LATENCY_8_CYCLES,L2x0_LATENCY_8_CYCLES,L2x0_LATENCY_8_CYCLES),
- 0,~0, // Use default setting for the Auxiliary Control Register
- FALSE);
-
-}
-
-/**
- Initialize the Secure peripherals and memory regions
-
- If Trustzone is supported by your platform then this function makes the required initialization
- of the secure peripherals and memory regions.
-
-**/
-VOID
-ArmPlatformSecTrustzoneInit (
- IN UINTN MpId
- )
-{
-return;
-}
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
deleted file mode 100644
index ba6611939..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
+++ /dev/null
@@ -1,50 +0,0 @@
-#/* @file
-# Copyright (c) 2011, Samsung Electronics Co. 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]
- INF_VERSION = 0x00010005
- BASE_NAME = SmdkBoardSecLib
- FILE_GUID = 6e02ebe0-1d96-11e0-b9cb-0002a5d5c51b
- MODULE_TYPE = BASE
- VERSION_STRING = 1.0
- LIBRARY_CLASS = ArmPlatformLib
-
-[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
- EmbeddedPkg/EmbeddedPkg.dec
- ArmPkg/ArmPkg.dec
- ArmPlatformPkg/ArmPlatformPkg.dec
- SamsungPlatformPkgOrigen/ExynosPkg/ExynosPkg.dec
-
-[LibraryClasses]
- IoLib
- ArmLib
- L2X0CacheLib
-
-[Sources.common]
- SmdkBoard.c
- SmdkBoardSec.c
- SmdkBoardHelper.asm | RVCT
- SmdkBoardHelper.S | GCC
-
-[Protocols]
-
-[FeaturePcd]
- gEmbeddedTokenSpaceGuid.PcdCacheEnable
- gArmPlatformTokenSpaceGuid.PcdStandalone
-
-[FixedPcd]
- gArmTokenSpaceGuid.PcdFvBaseAddress
- gArmTokenSpaceGuid.PcdL2x0ControllerBase
- gExynosPkgTokenSpaceGuid.PcdTZPCBase
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.dsc b/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.dsc
deleted file mode 100644
index 74d2b41b2..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.dsc
+++ /dev/null
@@ -1,474 +0,0 @@
-#
-# Copyright (c) 2011, Samsung Electronics Co. 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 = SmdkBoard-Exynos
- PLATFORM_GUID = 66a5a01d-be0a-4398-9b74-5af4a261381f
- PLATFORM_VERSION = 0.1
- DSC_SPECIFICATION = 0x00010005
- OUTPUT_DIRECTORY = Build/SmdkBoard-Exynos
- SUPPORTED_ARCHITECTURES = ARM
- BUILD_TARGETS = DEBUG|RELEASE
- SKUID_IDENTIFIER = DEFAULT
- FLASH_DEFINITION = SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.fdf
-
-[LibraryClasses.common]
-!if $(TARGET) == RELEASE
- DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
- UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
-!else
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocationLib/UncachedMemoryAllocationLib.inf
-!endif
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
- ArmPlatformLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
- ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA9Lib/ArmCortexA9Lib.inf
- BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
- BaseMemoryLib|ArmPkg/Library/BaseMemoryLibStm/BaseMemoryLibStm.inf
- DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
- EfiResetSystemLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/ResetSystemLib/ResetSystemLib.inf
- EblCmdLib|ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf
- EfiFileLib|EmbeddedPkg/Library/EfiFileLib/EfiFileLib.inf
- PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
- PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
-
- #
- # Uncomment (and comment out the next line) For RealView Debugger. The Standard IO window
- # in the debugger will show load and unload commands for symbols. You can cut and paste this
- # into the command window to load symbols. We should be able to use a script to do this, but
- # the version of RVD I have does not support scripts accessing system memory.
- #
- CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
- DefaultExceptionHandlerLib|ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerLib.inf
- DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
- DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
- PeCoffExtraActionLib|ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- RealTimeClockLib|EmbeddedPkg/Library/TemplateRealTimeClockLib/TemplateRealTimeClockLib.inf
- SemihostLib|ArmPkg/Library/SemihostLib/SemihostLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
- UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
- UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
- UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
- UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
- UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
-
-#
-# Assume everything is fixed at build
-#
- ArmDisassemblerLib|ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
- CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
- DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
- DebugAgentTimerLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/DebugAgentTimerLib/DebugAgentTimerLib.inf
- EblAddExternalCommandLib|EmbeddedPkg/Library/EblAddExternalCommandLib/EblAddExternalCommandLib.inf
- EblNetworkLib|EmbeddedPkg/Library/EblNetworkLib/EblNetworkLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- SerialPortLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/SerialPortLib/SerialPortLib.inf
- TimerLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/TimerLib/TimerLib.inf
- UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf
-
- # Samsung specific
- BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf
- DmaLib|ArmPkg/Library/ArmDmaLib/ArmDmaLib.inf
- GdbSerialLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/GdbSerialLib/GdbSerialLib.inf
-
- # iky for usb host
- HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
- UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf
- UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
-
-[LibraryClasses.common.SEC]
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicSecLib.inf
- ArmGicLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- ArmPlatformLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardSecLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- # L2 Cache Driver
- L2X0CacheLib|ArmPlatformPkg/Drivers/PL310L2Cache/PL310L2CacheSec.inf
-
-!if $(EDK2_SKIP_PEICORE)==1
- PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
- ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
- LzmaDecompressLib|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
- MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf
- HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
- PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
- PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
- MemoryInitPeiLib|ArmPlatformPkg/MemoryInitPei/MemoryInitPeiLib.inf
-!endif
-
-[LibraryClasses.common.PEI_CORE]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- # note: this won't actually work since globals in PEI are not writeable
- # need to generate an ARM PEI services table pointer implementation
- PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf
- PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.PEIM]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
- DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf
- ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
- MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
- OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
- # note: this won't actually work since globals in PEI are not writeable
- # need to generate an ARM PEI services table pointer implementation
- PeiServicesTablePointerLib|ArmPlatformPkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
- PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
- PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
- PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf
- PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
- PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf
- ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.DXE_CORE]
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf
- ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
- HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
- MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxeCorePerformanceLib/DxeCorePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/Sec/SecArmPlatformGlobalVariableLib.inf
- DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf
-
-[LibraryClasses.common.UEFI_APPLICATION]
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
-
-[LibraryClasses.common.UEFI_DRIVER]
- ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
- UefiDecompressLib|IntelFrameworkModulePkg/Library/BaseUefiTianoCustomDecompressLib/BaseUefiTianoCustomDecompressLib.inf
-
-[LibraryClasses.common.DXE_RUNTIME_DRIVER]
- CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
- HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
- ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
-
-[LibraryClasses.ARM]
- #
- # It is not possible to prevent the ARM compiler for generic intrinsic functions.
- # This library provides the instrinsic functions generate by a given compiler.
- # [LibraryClasses.ARM] and NULL mean link this library into all ARM images.
- #
- NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
-
-[BuildOptions]
- RVCT:*_*_ARM_ARCHCC_FLAGS == --cpu Cortex-A9 --thumb --fpu=softvfp -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- RVCT:*_*_ARM_ARCHASM_FLAGS == --cpu Cortex-A9 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- RVCT:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- GCC:*_*_ARM_ARCHCC_FLAGS == -march=armv7-a -mthumb -mthumb-interwork -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- GCC:*_*_ARM_ARCHASM_FLAGS == -march=armv7-a -mthumb-interwork -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- GCC:*_*_ARM_CC_FLAGS = -Os -mword-relocations -mfpu=vfp -ffixed-r8
- GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
- XCODE:*_*_ARM_ARCHCC_FLAGS == -arch armv7 -march=armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:*_*_ARM_ARCHASM_FLAGS == -arch armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:*_*_ARM_ARCHDLINK_FLAGS == -arch armv7 -I$(WORKSPACE)/SamsungPlatformPkgOrigen/ExynosPkg/Include/Platform
- XCODE:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG
-
-
-################################################################################
-#
-# Pcd Section - list of all EDK II PCD Entries defined by this Platform
-#
-################################################################################
-
-[PcdsFeatureFlag.common]
- gArmTokenSpaceGuid.PcdRelocateVectorTable|FALSE
- gArmTokenSpaceGuid.PcdCpuDxeProduceDebugSupport|FALSE
- gArmPlatformTokenSpaceGuid.PcdStandalone|TRUE
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE
- gEmbeddedTokenSpaceGuid.PcdCacheEnable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdComponentNameDisable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnosticsDisable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE
- gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport|FALSE
- gEfiMdeModulePkgTokenSpaceGuid.PcdTurnOffUsbLegacySupport|TRUE
-
-!if $(EDK2_SKIP_PEICORE) == 1
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryInitializeInSec|TRUE
- gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores|TRUE
-!endif
- gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
-
-[PcdsFixedAtBuild.common]
- gEmbeddedTokenSpaceGuid.PcdEmbeddedPrompt|"SMDK4210"
- gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|32
- gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|0
- gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000
- gEfiMdePkgTokenSpaceGuid.PcdSpinLockTimeout|10000000
- gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0xAF
- gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|1
- gEfiMdePkgTokenSpaceGuid.PcdPostCodePropertyMask|0
- gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|320
-
-# DEBUG_ASSERT_ENABLED 0x01
-# DEBUG_PRINT_ENABLED 0x02
-# DEBUG_CODE_ENABLED 0x04
-# CLEAR_MEMORY_ENABLED 0x08
-# ASSERT_BREAKPOINT_ENABLED 0x10
-# ASSERT_DEADLOOP_ENABLED 0x20
- gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f
-
-# DEBUG_INIT 0x00000001 // Initialization
-# DEBUG_WARN 0x00000002 // Warnings
-# DEBUG_LOAD 0x00000004 // Load events
-# DEBUG_FS 0x00000008 // EFI File system
-# DEBUG_POOL 0x00000010 // Alloc & Free's
-# DEBUG_PAGE 0x00000020 // Alloc & Free's
-# DEBUG_INFO 0x00000040 // Verbose
-# DEBUG_DISPATCH 0x00000080 // PEI/DXE Dispatchers
-# DEBUG_VARIABLE 0x00000100 // Variable
-# DEBUG_BM 0x00000400 // Boot Manager
-# DEBUG_BLKIO 0x00001000 // BlkIo Driver
-# DEBUG_NET 0x00004000 // SNI Driver
-# DEBUG_UNDI 0x00010000 // UNDI Driver
-# DEBUG_LOADFILE 0x00020000 // UNDI Driver
-# DEBUG_EVENT 0x00080000 // Event messages
-# DEBUG_ERROR 0x80000000 // Error
- gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
- gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
- gEmbeddedTokenSpaceGuid.PcdEmbeddedAutomaticBootCommand|""
- gEmbeddedTokenSpaceGuid.PcdEmbeddedDefaultTextColor|0x07
- gEmbeddedTokenSpaceGuid.PcdEmbeddedMemVariableStoreSize|0x10000
-
-#
-# Optional feature to help prevent EFI memory map fragments
-# Turned on and off via: PcdPrePiProduceMemoryTypeInformationHob
-# Values are in EFI Pages (4K). DXE Core will make sure that
-# at least this much of each type of memory can be allocated
-# from a single memory range. This way you only end up with
-# maximum of two fragements for each type in the memory map
-# (the memory used, and the free memory that was prereserved
-# but not used).
-#
- gArmTokenSpaceGuid.PcdCpuVectorBaseAddress|0x00000000
- gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x01000000
- # Stacks for MPCores in Secure World
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecStackBase|0x4B000000 # Top of SEC Stack for Secure World
-
- # Stacks for MPCores in Monitor Mode
- gArmPlatformTokenSpaceGuid.PcdCPUCoresSecMonStackBase|0x4A000000 # Top of SEC Stack for Monitor World
- gArmPlatformTokenSpaceGuid.PcdCPUCoreSecMonStackSize|0x2000 # Stack for each of the 4 CPU cores
- gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x48000000
- gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
-
- # Stacks for MPCores in Normal World
- gEmbeddedTokenSpaceGuid.PcdTimerPeriod|100000 # expressed in 100ns units, 100,000 x 100 ns = 10,000,000 ns = 10 ms
- gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000
- gArmTokenSpaceGuid.PcdSystemMemorySize|0x10000000
- gArmTokenSpaceGuid.PcdArmPrimaryCoreMask|0x0f
- gArmTokenSpaceGuid.PcdArmPrimaryCore|0x00
- gArmTokenSpaceGuid.PcdTrustzoneSupport|TRUE
- #
- # ARM Pcds
- #
- gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000
- #
- # ARM EB PCDS
- #
- gExynosPkgTokenSpaceGuid.PcdGdbUartBase|0x1000a000
- gExynosPkgTokenSpaceGuid.PcdConsoleUartBase|0x13810000
- gExynosPkgTokenSpaceGuid.PcdCmuBase|0x10030000
- gExynosPkgTokenSpaceGuid.PcdPWMTimerBase|0x139d0000
- gExynosPkgTokenSpaceGuid.PcdPmuBase|0x10020000
- gExynosPkgTokenSpaceGuid.PcdGpioPart1Base|0x11400000
- gExynosPkgTokenSpaceGuid.PcdGpioPart2Base|0x11000000
- gExynosPkgTokenSpaceGuid.PcdSdMmcBase|0x12530000
- gExynosPkgTokenSpaceGuid.PcdSysBase|0x10010000
- gExynosPkgTokenSpaceGuid.PcdFIMD0Base|0x11C00000
- gExynosPkgTokenSpaceGuid.PcdGICBase|0x10500000
- gExynosPkgTokenSpaceGuid.PcdTZPCBase|0x10100000
- #
- # ARM PL390 General Interrupt Controller
- #
- gArmTokenSpaceGuid.PcdGicDistributorBase|0x10490000
- gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x10480000
-
- #
- # ARM OS Loader
- #
- #gArmTokenSpaceGuid.PcdArmMachineType|2925
- gArmTokenSpaceGuid.PcdArmMachineType|2456
- gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SD-MMC Booting"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x6F20736B,0x1D6E74,0x58A400)/zImage"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/mmcblk0p2 rw rootwait console=ttySAC1,115200 init=/linuxrc"
- gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1
- gArmPlatformTokenSpaceGuid.PcdFirmwareVendor|L"Samsung Exynos4210-SMDK Board"
-
-# Use the Serial console (ConIn & ConOut) and the Graphic driver (ConOut)
- gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(c5deae31-fad2-4030-841b-cfc9644d2c5b)"
- gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
- gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|10
-
- #
- # ARM L2x0 PCDs
- #
- gArmTokenSpaceGuid.PcdL2x0ControllerBase|0x10502000
-
-################################################################################
-#
-# Components Section - list of all EDK II Modules needed by this Platform
-#
-################################################################################
-[Components.common]
-
-#
-# SEC
-#
- ArmPlatformPkg/Sec/Sec.inf
-
-#
-# PEI Phase modules
-#
-!if $(EDK2_SKIP_PEICORE) == 1
- ArmPlatformPkg/PrePi/PeiMPCore.inf {
- <LibraryClasses>
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
- ArmPlatformLib|SamsungPlatformPkgOrigen/SmdkBoardPkg/Library/SmdkBoardLib/SmdkBoardLib.inf
- ArmPlatformGlobalVariableLib|ArmPlatformPkg/Library/ArmPlatformGlobalVariableLib/PrePi/PrePiArmPlatformGlobalVariableLib.inf
- }
-!else
- ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf {
- <LibraryClasses>
- ArmGicSecLib|ArmPkg/Drivers/PL390Gic/PL390GicLib.inf
- }
- MdeModulePkg/Core/Pei/PeiMain.inf
- MdeModulePkg/Universal/PCD/Pei/Pcd.inf {
- <LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- }
- ArmPlatformPkg/PlatformPei/PlatformPeim.inf
- ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
- ArmPkg/Drivers/CpuPei/CpuPei.inf
- IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
- Nt32Pkg/BootModePei/BootModePei.inf
- MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {
- <LibraryClasses>
- NULL|IntelFrameworkModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
- }
-!endif
-
-#
-# DXE
-#
- MdeModulePkg/Core/Dxe/DxeMain.inf {
- <LibraryClasses>
- PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
- NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
- }
-
- #
- # Architectural Protocols
- #
- ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
- EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
- EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
- EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
-
- MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
- MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
- MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
- EmbeddedPkg/SerialDxe/SerialDxe.inf
-
- MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
- MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
- MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
- MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
- MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
- SamsungPlatformPkgOrigen/SmdkBoardPkg/FvbDxe/FvbDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
-
- #
- # Samsung specific Driver
- #
- ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
- SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf{
- <LibraryClasses>
- ExynosLib|SamsungPlatformPkgOrigen/ExynosPkg/Library/ExynosLib/ExynosLib.inf
- }
-
- #
- # Semi-hosting filesystem
- #
- ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
-
- #
- # FAT filesystem + GPT/MBR partitioning
- #
- MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
- MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
- MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-
- #
- # Application
- #
- EmbeddedPkg/Ebl/Ebl.inf
-
- #
- # Bds
- #
- MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
- ArmPlatformPkg/Bds/Bds.inf
-
- MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.fdf b/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.fdf
deleted file mode 100644
index 72574416a..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg-Exynos.fdf
+++ /dev/null
@@ -1,316 +0,0 @@
-# FLASH layout file for ARM VE.
-#
-# Copyright (c) 2011, Samsung Electronics Co. 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.
-#
-
-################################################################################
-#
-# FD Section
-# The [FD] Section is made up of the definition statements and a
-# description of what goes into the Flash Device Image. Each FD section
-# defines one flash "device" image. A flash device image may be one of
-# the following: Removable media bootable image (like a boot floppy
-# image,) an Option ROM image (that would be "flashed" into an add-in
-# card,) a System "Flash" image (that would be burned into a system's
-# flash) or an Update ("Capsule") image that will be used to update and
-# existing system flash.
-#
-################################################################################
-
-
-[FD.SmdkBoard_EFI]
-BaseAddress = 0x43E00000|gArmTokenSpaceGuid.PcdFdBaseAddress
-Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize
-ErasePolarity = 1
-BlockSize = 0x00010000
-NumBlocks = 0x20
-
-################################################################################
-#
-# Following are lists of FD Region layout which correspond to the locations of different
-# images within the flash device.
-#
-# Regions must be defined in ascending order and may not overlap.
-#
-# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
-# the pipe "|" character, followed by the size of the region, also in hex with the leading
-# "0x" characters. Like:
-# Offset|Size
-# PcdOffsetCName|PcdSizeCName
-# RegionType <FV, DATA, or FILE>
-#
-################################################################################
-
-0x00000000|0x00100000
-gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
-FV = FVMAIN_COMPACT
-
-0x00110000|0x00010000
-gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
-#NV_VARIABLE_STORE
-DATA = {
- ## This is the EFI_FIRMWARE_VOLUME_HEADER
- # ZeroVector []
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- # FileSystemGuid: gEfiSystemNvDataFvGuid =
- # { 0xFFF12B8D, 0x7696, 0x4C8B, { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }}
- 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,
- 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,
- # FvLength: 0x20000
- 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
- #Signature "_FVH" #Attributes
- 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00,
- #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision
- 0x48, 0x00, 0x36, 0x09, 0x00, 0x00, 0x00, 0x02,
- #Blockmap[0]: 2 Blocks * 0x10000 Bytes / Block
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
- #Blockmap[1]: End
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- ## This is the VARIABLE_STORE_HEADER
- #Signature: gEfiVariableGuid =
- # { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
- 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,
- 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,
- #Size: 0x10000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0xFFB8
- # This can speed up the Variable Dispatch a bit.
- 0xB8, 0xFF, 0x00, 0x00,
- #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32
- 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-}
-
-################################################################################
-#
-# FV Section
-#
-# [FV] section is used to define what components or modules are placed within a flash
-# device file. This section also defines order the components and modules are positioned
-# within the image. The [FV] section consists of define statements, set statements and
-# module statements.
-#
-################################################################################
-
-[FV.FVMAIN]
-BlockSize = 0x40
-NumBlocks = 0 # This FV gets compressed so make it just big enough
-FvAlignment = 8 # FV alignment and FV attributes setting.
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-
- INF MdeModulePkg/Core/Dxe/DxeMain.inf
-
- #
- # PI DXE Drivers producing Architectural Protocols (EFI Services)
- #
- INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
- INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
- INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
- INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
- INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
- INF MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf
-
- INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
- INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
- INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
- INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
- INF EmbeddedPkg/SerialDxe/SerialDxe.inf
-
-
- INF EmbeddedPkg/EmbeddedMonotonicCounter/EmbeddedMonotonicCounter.inf
- INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
- INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
- INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
-
- INF ArmPkg/Drivers/PL390Gic/PL390GicDxe.inf
- INF SamsungPlatformPkgOrigen/ExynosPkg/TimerDxe/TimerDxe.inf
-
- #
- # ACPI Support
- #
-
- #
- # Samsung specific Driver
- #
- INF SamsungPlatformPkgOrigen/ExynosPkg/SDHCDxe/SDHCDxe.inf
- INF SamsungPlatformPkgOrigen/ExynosPkg/Gpio/Gpio.inf
- #
- # PCI EMULATION
- #
- #
- # Semi-hosting filesystem
- #
- INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
-
- #
- # FAT filesystem + GPT/MBR partitioning
- #
- INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
- INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
- INF FatBinPkg/EnhancedFatDxe/Fat.inf
- INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
-
- #
- # USB HOST STACK
- #
- INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
-
- #
- # UEFI application (Shell Embedded Boot Loader)
- #
- INF EmbeddedPkg/Ebl/Ebl.inf
-
-
- #
- # Bds
- #
- INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
- INF ArmPlatformPkg/Bds/Bds.inf
-
-[FV.FVMAIN_COMPACT]
-FvAlignment = 8
-ERASE_POLARITY = 1
-MEMORY_MAPPED = TRUE
-STICKY_WRITE = TRUE
-LOCK_CAP = TRUE
-LOCK_STATUS = TRUE
-WRITE_DISABLED_CAP = TRUE
-WRITE_ENABLED_CAP = TRUE
-WRITE_STATUS = TRUE
-WRITE_LOCK_CAP = TRUE
-WRITE_LOCK_STATUS = TRUE
-READ_DISABLED_CAP = TRUE
-READ_ENABLED_CAP = TRUE
-READ_STATUS = TRUE
-READ_LOCK_CAP = TRUE
-READ_LOCK_STATUS = TRUE
-
- INF ArmPlatformPkg/PrePi/PeiMPCore.inf
- FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
- SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
- SECTION FV_IMAGE = FVMAIN
- }
- }
-
-
-################################################################################
-#
-# Rules are use with the [FV] section's module INF type to define
-# how an FFS file is created for a given INF file. The following Rule are the default
-# rules for the different module type. User can add the customized rules to define the
-# content of the FFS file.
-#
-################################################################################
-
-
-############################################################################
-# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #
-############################################################################
-#
-#[Rule.Common.DXE_DRIVER]
-# FILE DRIVER = $(NAMED_GUID) {
-# DXE_DEPEX DXE_DEPEX Optional |.depex
-# COMPRESS PI_STD {
-# GUIDED {
-# PE32 PE32 |.efi
-# UI STRING="$(MODULE_NAME)" Optional
-# VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
-# }
-# }
-# }
-#
-############################################################################
-
-[Rule.Common.SEC]
- FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
- TE TE Align = 32 |.efi
- }
-
-[Rule.Common.PEI_CORE]
- FILE PEI_CORE = $(NAMED_GUID) {
- TE TE |.efi
- UI STRING ="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.PEIM]
- FILE PEIM = $(NAMED_GUID) {
- PEI_DEPEX PEI_DEPEX Optional |.depex
- TE TE |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.PEIM.TIANOCOMPRESSED]
- FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
- PEI_DEPEX PEI_DEPEX Optional |.depex
- GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
- }
-
-[Rule.Common.DXE_CORE]
- FILE DXE_CORE = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.DXE_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.DXE_RUNTIME_DRIVER]
- FILE DRIVER = $(NAMED_GUID) {
- DXE_DEPEX DXE_DEPEX Optional |.depex
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.USER_DEFINED.ACPITABLE]
- FILE FREEFORM = $(NAMED_GUID) {
- RAW ACPI |.acpi
- RAW ASL |.aml
- UI STRING="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_APPLICATION]
- FILE APPLICATION = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING ="$(MODULE_NAME)" Optional
- }
-
-[Rule.Common.UEFI_APPLICATION.BINARY]
- FILE APPLICATION = $(NAMED_GUID) {
- PE32 PE32 |.efi
- UI STRING="$(MODULE_NAME)" Optional
- VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
- }
diff --git a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec b/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec
deleted file mode 100644
index f4afba182..000000000
--- a/SamsungPlatformPkgOrigen/SmdkBoardPkg/SmdkBoardPkg.dec
+++ /dev/null
@@ -1,43 +0,0 @@
-#/** @file
-# Arm RealView EB package.
-#
-# Copyright (c) 2011, Samsung Electronics Co. All rights reserved.<BR>
-#
-# 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 = SmdkBoardPkg
- PACKAGE_GUID = 4c9e432c-b84e-44fd-a796-f4545deec144
- PACKAGE_VERSION = 0.1
-
-################################################################################
-#
-# Include Section - list of Include Paths that are provided by this package.
-# Comments are used for Keywords and Module Types.
-#
-# Supported Module Types:
-# BASE SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER
-# DXE_SMM_DRIVER DXE_SAL_DRIVER UEFI_DRIVER UEFI_APPLICATION
-#
-################################################################################
-[Includes.common]
-# Include # Root include for the package
-
-[Guids.common] #bc92b024-79f8-11e0-a039-0026b9733e2c
- gSmdkBoardPkgTokenSpaceGuid = { 0xbc92b024, 0x79f8, 0x11e0, { 0xa0, 0x39, 0x00, 0x26, 0xb9, 0x73, 0x3e, 0x2c} }
-
-[PcdsFeatureFlag.common]
-
-[PcdsFixedAtBuild.common]
-
-[Protocols.common]
diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
index 12cb2fc3e..0ea5949a0 100644
--- a/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
+++ b/SecurityPkg/RandomNumberGenerator/RngDxe/RngDxe.inf
@@ -42,12 +42,12 @@
[Sources.IA32]
IA32/RdRandWord.c
- IA32/AsmRdRand.asm | MSFT
+ IA32/AsmRdRand.asm
IA32/GccRdRand.c | GCC
[Sources.X64]
X64/RdRandWord.c
- X64/AsmRdRand.asm | MSFT
+ X64/AsmRdRand.asm
X64/GccRdRand.c | GCC
[Packages]
diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec
index 8cf9b39f7..c321d7b4c 100644
--- a/SecurityPkg/SecurityPkg.dec
+++ b/SecurityPkg/SecurityPkg.dec
@@ -2,7 +2,7 @@
# This package includes the security drivers, defintions(including PPIs/PROTOCOLs/GUIDs
# and library classes) and libraries instances.
#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -17,7 +17,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = SecurityPkg
PACKAGE_GUID = 24369CAC-6AA6-4fb8-88DB-90BF061668AD
- PACKAGE_VERSION = 0.92
+ PACKAGE_VERSION = 0.93
[Includes]
Include
@@ -199,13 +199,13 @@
## This PCD indicates if debugger exists.
gEfiSecurityPkgTokenSpaceGuid.PcdFirmwareDebuggerInitialized|FALSE|BOOLEAN|0x00010009
- ## This PCD indicates the TPM2 initializatin policy.
- ## 0: No initialization needed - most likely used for chipset SRTM sloution, in which TPM is already initialized.
+ ## This PCD indicates the TPM2 initialization policy.
+ ## 0: No initialization needed - most likely used for chipset SRTM solution, in which TPM is already initialized.
## 1: Initialization needed.
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2InitializationPolicy|1|UINT8|0x0001000A
- ## This PCD indicates the TPM initializatin policy.
- ## 0: No initialization needed - most likely used for chipset SRTM sloution, in which TPM is already initialized.
+ ## This PCD indicates the TPM initialization policy.
+ ## 0: No initialization needed - most likely used for chipset SRTM solution, in which TPM is already initialized.
## 1: Initialization needed.
gEfiSecurityPkgTokenSpaceGuid.PcdTpmInitializationPolicy|1|UINT8|0x0001000B
diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc
index 0dba0f121..591062c04 100644
--- a/SecurityPkg/SecurityPkg.dsc
+++ b/SecurityPkg/SecurityPkg.dsc
@@ -1,7 +1,7 @@
## @file
# Security Module Package for All Architectures.
#
-# Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -15,7 +15,7 @@
[Defines]
PLATFORM_NAME = SecurityPkg
PLATFORM_GUID = B2C4614D-AE76-47ba-B876-5988BFED064F
- PLATFORM_VERSION = 0.92
+ PLATFORM_VERSION = 0.93
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/SecurityPkg
SUPPORTED_ARCHITECTURES = IA32|IPF|X64|EBC
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
index 548d95df5..310b1ecd4 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
@@ -1,7 +1,7 @@
/** @file
Internal file explorer functions for SecureBoot configuration module.
-Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1069,7 +1069,7 @@ UpdateFileExplorePage (
NewMenuEntry->DisplayStringToken,
STRING_TOKEN (STR_NULL),
EFI_IFR_FLAG_CALLBACK,
- (UINT16) (FILE_OPTION_OFFSET + Index)
+ (UINT16) (FILE_OPTION_GOTO_OFFSET + Index)
);
}
}
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
index 091163094..8b9a8e26a 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c
@@ -1,7 +1,7 @@
/** @file
HII Config Access protocol implementation of SecureBoot configuration module.
-Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -2714,7 +2714,7 @@ SecureBootCallback (
break;
default:
- if (QuestionId >= FILE_OPTION_OFFSET) {
+ if (QuestionId >= FILE_OPTION_GOTO_OFFSET) {
UpdateFileExplorer (Private, QuestionId);
} else if ((QuestionId >= OPTION_DEL_KEK_QUESTION_ID) &&
(QuestionId < (OPTION_DEL_KEK_QUESTION_ID + OPTION_CONFIG_RANGE))) {
@@ -2821,7 +2821,14 @@ SecureBootCallback (
if (SetupMode != NULL) {
FreePool (SetupMode);
}
- break;
+ break;
+ default:
+ if (QuestionId >= FILE_OPTION_OFFSET && QuestionId < FILE_OPTION_GOTO_OFFSET) {
+ if (UpdateFileExplorer (Private, QuestionId)) {
+ *ActionRequest = EFI_BROWSER_ACTION_REQUEST_EXIT;
+ }
+ }
+ break;
}
} else if (Action == EFI_BROWSER_ACTION_DEFAULT_STANDARD) {
if (QuestionId == KEY_HIDE_SECURE_BOOT) {
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h
index c15869a62..7d68b3981 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigNvData.h
@@ -1,7 +1,7 @@
/** @file
Header file for NV data structure definition.
-Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -95,9 +95,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
#define OPTION_DEL_DBX_QUESTION_ID 0x4000
-
+#define FILE_OPTION_GOTO_OFFSET 0xC000
#define FILE_OPTION_OFFSET 0x8000
-#define FILE_OPTION_MASK 0x7FFF
+#define FILE_OPTION_MASK 0x3FFF
#define SECURE_BOOT_GUID_SIZE 36
#define SECURE_BOOT_GUID_STORAGE_SIZE 37
diff --git a/ShellPkg/Application/Shell/ConsoleLogger.c b/ShellPkg/Application/Shell/ConsoleLogger.c
index c3729f16c..6f7ed95a6 100644
--- a/ShellPkg/Application/Shell/ConsoleLogger.c
+++ b/ShellPkg/Application/Shell/ConsoleLogger.c
@@ -2,7 +2,7 @@
Provides interface to shell console logger.
Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -819,22 +819,41 @@ ConsoleLoggerOutputString (
IN CHAR16 *WString
)
{
- EFI_INPUT_KEY Key;
- UINTN EventIndex;
- CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
+ EFI_STATUS Status;
+ EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *TxtInEx;
+ EFI_KEY_DATA KeyData;
+ UINTN EventIndex;
+ CONSOLE_LOGGER_PRIVATE_DATA *ConsoleInfo;
+
ConsoleInfo = CONSOLE_LOGGER_PRIVATE_DATA_FROM_THIS(This);
if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
return (EFI_UNSUPPORTED);
}
ASSERT(ShellInfoObject.ConsoleInfo == ConsoleInfo);
- if (ShellInfoObject.HaltOutput) {
- //
- // just get some key
- //
- gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
- gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
- ShellInfoObject.HaltOutput = FALSE;
+
+ Status = gBS->HandleProtocol (gST->ConsoleInHandle, &gEfiSimpleTextInputExProtocolGuid, (VOID **) &TxtInEx);
+ if (!EFI_ERROR (Status)) {
+ while (ShellInfoObject.HaltOutput) {
+
+ ShellInfoObject.HaltOutput = FALSE;
+ //
+ // just get some key
+ //
+ Status = gBS->WaitForEvent (1, &TxtInEx->WaitForKeyEx, &EventIndex);
+ ASSERT_EFI_ERROR (Status);
+ Status = TxtInEx->ReadKeyStrokeEx (TxtInEx, &KeyData);
+ ASSERT_EFI_ERROR (Status);
+
+ if ((KeyData.Key.UnicodeChar == L's') && (KeyData.Key.ScanCode == SCAN_NULL) &&
+ ((KeyData.KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID | EFI_LEFT_CONTROL_PRESSED)) ||
+ (KeyData.KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID | EFI_RIGHT_CONTROL_PRESSED))
+ )
+ ) {
+ ShellInfoObject.HaltOutput = TRUE;
+ }
+ }
}
+
if (!ShellInfoObject.ConsoleInfo->Enabled) {
return (EFI_DEVICE_ERROR);
} else if (ShellInfoObject.PageBreakEnabled) {
diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.c b/ShellPkg/Application/Shell/ConsoleWrappers.c
index 38491216f..49ba6e90e 100644
--- a/ShellPkg/Application/Shell/ConsoleWrappers.c
+++ b/ShellPkg/Application/Shell/ConsoleWrappers.c
@@ -255,7 +255,9 @@ FileBasedSimpleTextOutQueryMode (
OUT UINTN *Rows
)
{
- EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut;
+ EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *PassThruProtocol;
+
+ PassThruProtocol = ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *)This)->OriginalSimpleTextOut;
// Pass the QueryMode call thru to the original SimpleTextOutProtocol
return (PassThruProtocol->QueryMode(
diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c
index ef8293c1d..c67ddfc26 100644
--- a/ShellPkg/Application/Shell/FileHandleWrappers.c
+++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
@@ -2,7 +2,7 @@
EFI_FILE_PROTOCOL wrappers for other items (Like Environment Variables,
StdIn, StdOut, StdErr, etc...).
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -973,7 +973,7 @@ FileInterfaceEnvClose(
Status = SHELL_GET_ENVIRONMENT_VARIABLE(((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name, &NewSize, NewBuffer);
}
- if (!EFI_ERROR(Status)) {
+ if (!EFI_ERROR(Status) && NewBuffer != NULL) {
if (StrSize(NewBuffer) > 6)
{
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 1b52692ec..134ec587d 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1,7 +1,7 @@
/** @file
This is THE shell (application)
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2013, Hewlett-Packard Development Company, L.P.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -71,6 +71,82 @@ STATIC CONST CHAR16 mExecutableExtensions[] = L".NSH;.EFI";
STATIC CONST CHAR16 mStartupScript[] = L"startup.nsh";
/**
+ Cleans off leading and trailing spaces and tabs.
+
+ @param[in] String pointer to the string to trim them off.
+**/
+EFI_STATUS
+EFIAPI
+TrimSpaces(
+ IN CHAR16 **String
+ )
+{
+ ASSERT(String != NULL);
+ ASSERT(*String!= NULL);
+ //
+ // Remove any spaces and tabs at the beginning of the (*String).
+ //
+ while (((*String)[0] == L' ') || ((*String)[0] == L'\t')) {
+ CopyMem((*String), (*String)+1, StrSize((*String)) - sizeof((*String)[0]));
+ }
+
+ //
+ // Remove any spaces and tabs at the end of the (*String).
+ //
+ while ((StrLen (*String) > 0) && (((*String)[StrLen((*String))-1] == L' ') || ((*String)[StrLen((*String))-1] == L'\t'))) {
+ (*String)[StrLen((*String))-1] = CHAR_NULL;
+ }
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Find a command line contains a split operation
+
+ @param[in] CmdLine The command line to parse.
+
+ @retval A pointer to the | character in CmdLine or NULL if not present.
+**/
+CONST CHAR16*
+EFIAPI
+FindSplit(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ CONST CHAR16 *TempSpot;
+ TempSpot = NULL;
+ if (StrStr(CmdLine, L"|") != NULL) {
+ for (TempSpot = CmdLine ; TempSpot != NULL && *TempSpot != CHAR_NULL ; TempSpot++) {
+ if (*TempSpot == L'^' && *(TempSpot+1) == L'|') {
+ TempSpot++;
+ } else if (*TempSpot == L'|') {
+ break;
+ }
+ }
+ }
+ return (TempSpot);
+}
+
+/**
+ Determine if a command line contains a split operation
+
+ @param[in] CmdLine The command line to parse.
+
+ @retval TRUE CmdLine has a valid split.
+ @retval FALSE CmdLine does not have a valid split.
+**/
+BOOLEAN
+EFIAPI
+ContainsSplit(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ CONST CHAR16 *TempSpot;
+ TempSpot = FindSplit(CmdLine);
+ return (BOOLEAN) ((TempSpot != NULL) && (*TempSpot != CHAR_NULL));
+}
+
+/**
Function to start monitoring for CTRL-S using SimpleTextInputEx. This
feature's enabled state was not known when the shell initially launched.
@@ -131,7 +207,7 @@ InternalEfiShellStartCtrlSMonitor(
SimpleEx,
&KeyData,
NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle2);
+ &ShellInfoObject.CtrlSNotifyHandle3);
}
KeyData.KeyState.KeyShiftState = EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED;
if (!EFI_ERROR(Status)) {
@@ -139,7 +215,7 @@ InternalEfiShellStartCtrlSMonitor(
SimpleEx,
&KeyData,
NotificationFunction,
- &ShellInfoObject.CtrlSNotifyHandle2);
+ &ShellInfoObject.CtrlSNotifyHandle4);
}
return (Status);
}
@@ -914,7 +990,7 @@ DoStartupScript(
// If we got a file, run it
//
if (!EFI_ERROR(Status) && FileHandle != NULL) {
- Status = RunScriptFileHandle (FileHandle, mStartupScript);
+ Status = RunScriptFile (mStartupScript, FileHandle, L"", ShellInfoObject.NewShellParametersProtocol);
ShellInfoObject.NewEfiShellProtocol->CloseFile(FileHandle);
} else {
FileStringPath = ShellFindFilePath(mStartupScript);
@@ -925,7 +1001,7 @@ DoStartupScript(
Status = EFI_SUCCESS;
ASSERT(FileHandle == NULL);
} else {
- Status = RunScriptFile(FileStringPath);
+ Status = RunScriptFile(FileStringPath, NULL, L"", ShellInfoObject.NewShellParametersProtocol);
FreePool(FileStringPath);
}
}
@@ -991,7 +1067,7 @@ DoShellPrompt (
if (!EFI_ERROR (Status)) {
CmdLine[BufferSize / sizeof (CHAR16)] = CHAR_NULL;
Status = RunCommand(CmdLine);
- }
+ }
//
// Done with this command
@@ -1354,347 +1430,822 @@ RunSplitCommand(
}
/**
- Function will process and run a command line.
+ Take the original command line, substitute any variables, free
+ the original string, return the modified copy.
- This will determine if the command line represents an internal shell
- command or dispatch an external application.
+ @param[in] CmdLine pointer to the command line to update.
- @param[in] CmdLine The command line to parse.
-
- @retval EFI_SUCCESS The command was completed.
- @retval EFI_ABORTED The command's operation was aborted.
+ @retval EFI_SUCCESS the function was successful.
+ @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
**/
EFI_STATUS
EFIAPI
-RunCommand(
- IN CONST CHAR16 *CmdLine
+ShellSubstituteVariables(
+ IN CHAR16 **CmdLine
)
{
- EFI_STATUS Status;
- EFI_STATUS StatusCode;
- CHAR16 *CommandName;
- SHELL_STATUS ShellStatus;
- UINTN Argc;
- CHAR16 **Argv;
- BOOLEAN LastError;
- CHAR16 LeString[19];
- CHAR16 *PostAliasCmdLine;
- UINTN PostAliasSize;
- CHAR16 *PostVariableCmdLine;
- CHAR16 *CommandWithPath;
- CONST EFI_DEVICE_PATH_PROTOCOL *DevPath;
- CONST CHAR16 *TempLocation;
- CONST CHAR16 *TempLocation2;
- SHELL_FILE_HANDLE OriginalStdIn;
- SHELL_FILE_HANDLE OriginalStdOut;
- SHELL_FILE_HANDLE OriginalStdErr;
- SYSTEM_TABLE_INFO OriginalSystemTableInfo;
- CHAR16 *TempLocation3;
- UINTN Count;
- UINTN Count2;
- CHAR16 *CleanOriginal;
- SPLIT_LIST *Split;
+ CHAR16 *NewCmdLine;
+ NewCmdLine = ShellConvertVariables(*CmdLine);
+ SHELL_FREE_NON_NULL(*CmdLine);
+ if (NewCmdLine == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
+ *CmdLine = NewCmdLine;
+ return (EFI_SUCCESS);
+}
+
+/**
+ Take the original command line, substitute any alias in the first group of space delimited characters, free
+ the original string, return the modified copy.
+
+ @param[in] CmdLine pointer to the command line to update.
+ @retval EFI_SUCCESS the function was successful.
+ @retval EFI_OUT_OF_RESOURCES a memory allocation failed.
+**/
+EFI_STATUS
+EFIAPI
+ShellSubstituteAliases(
+ IN CHAR16 **CmdLine
+ )
+{
+ CHAR16 *NewCmdLine;
+ CHAR16 *CommandName;
+ EFI_STATUS Status;
+ UINTN PostAliasSize;
ASSERT(CmdLine != NULL);
- if (StrLen(CmdLine) == 0) {
- return (EFI_SUCCESS);
- }
+ ASSERT(*CmdLine!= NULL);
- CommandName = NULL;
- PostVariableCmdLine = NULL;
- PostAliasCmdLine = NULL;
- CommandWithPath = NULL;
- DevPath = NULL;
- Status = EFI_SUCCESS;
- CleanOriginal = NULL;
- Split = NULL;
- CleanOriginal = StrnCatGrow(&CleanOriginal, NULL, CmdLine, 0);
- if (CleanOriginal == NULL) {
- return (EFI_OUT_OF_RESOURCES);
+ CommandName = NULL;
+ if (StrStr((*CmdLine), L" ") == NULL){
+ StrnCatGrow(&CommandName, NULL, (*CmdLine), 0);
+ } else {
+ StrnCatGrow(&CommandName, NULL, (*CmdLine), StrStr((*CmdLine), L" ") - (*CmdLine));
}
//
- // Remove any spaces and tabs at the beginning of the string.
+ // This cannot happen 'inline' since the CmdLine can need extra space.
//
- while ((CleanOriginal[0] == L' ') || (CleanOriginal[0] == L'\t')) {
- CopyMem(CleanOriginal, CleanOriginal+1, StrSize(CleanOriginal) - sizeof(CleanOriginal[0]));
+ NewCmdLine = NULL;
+ if (!ShellCommandIsCommandOnList(CommandName)) {
+ //
+ // Convert via alias
+ //
+ Status = ShellConvertAlias(&CommandName);
+ if (EFI_ERROR(Status)){
+ return (Status);
+ }
+ PostAliasSize = 0;
+ NewCmdLine = StrnCatGrow(&NewCmdLine, &PostAliasSize, CommandName, 0);
+ if (NewCmdLine == NULL) {
+ SHELL_FREE_NON_NULL(CommandName);
+ SHELL_FREE_NON_NULL(*CmdLine);
+ return (EFI_OUT_OF_RESOURCES);
+ }
+ NewCmdLine = StrnCatGrow(&NewCmdLine, &PostAliasSize, StrStr((*CmdLine), L" "), 0);
+ if (NewCmdLine == NULL) {
+ SHELL_FREE_NON_NULL(CommandName);
+ SHELL_FREE_NON_NULL(*CmdLine);
+ return (EFI_OUT_OF_RESOURCES);
+ }
+ } else {
+ NewCmdLine = StrnCatGrow(&NewCmdLine, NULL, (*CmdLine), 0);
}
+ SHELL_FREE_NON_NULL(*CmdLine);
+ SHELL_FREE_NON_NULL(CommandName);
+
//
- // Handle case that passed in command line is just 1 or more " " characters.
+ // re-assign the passed in double pointer to point to our newly allocated buffer
//
- if (StrLen (CleanOriginal) == 0) {
- if (CleanOriginal != NULL) {
- FreePool(CleanOriginal);
- CleanOriginal = NULL;
- }
- return (EFI_SUCCESS);
- }
+ *CmdLine = NewCmdLine;
+
+ return (EFI_SUCCESS);
+}
+/**
+ Takes the Argv[0] part of the command line and determine the meaning of it.
+
+ @param[in] CmdName pointer to the command line to update.
+
+ @retval Internal_Command The name is an internal command.
+ @retval File_Sys_Change the name is a file system change.
+ @retval Script_File_Name the name is a NSH script file.
+ @retval Unknown_Invalid the name is unknown.
+ @retval Efi_Application the name is an application (.EFI).
+**/
+SHELL_OPERATION_TYPES
+EFIAPI
+GetOperationType(
+ IN CONST CHAR16 *CmdName
+ )
+{
+ CHAR16* FileWithPath;
+ CONST CHAR16* TempLocation;
+ CONST CHAR16* TempLocation2;
+
+ FileWithPath = NULL;
//
- // Remove any spaces at the end of the string.
+ // test for an internal command.
//
- while (CleanOriginal[StrLen(CleanOriginal)-1] == L' ') {
- CleanOriginal[StrLen(CleanOriginal)-1] = CHAR_NULL;
+ if (ShellCommandIsCommandOnList(CmdName)) {
+ return (Internal_Command);
}
- CommandName = NULL;
- if (StrStr(CleanOriginal, L" ") == NULL){
- StrnCatGrow(&CommandName, NULL, CleanOriginal, 0);
- } else {
- StrnCatGrow(&CommandName, NULL, CleanOriginal, StrStr(CleanOriginal, L" ") - CleanOriginal);
+ //
+ // Test for file system change request. anything ending with : and cant have spaces.
+ //
+ if (CmdName[(StrLen(CmdName)-1)] == L':') {
+ if (StrStr(CmdName, L" ") != NULL) {
+ return (Unknown_Invalid);
+ }
+ return (File_Sys_Change);
}
- ASSERT(PostAliasCmdLine == NULL);
- if (!ShellCommandIsCommandOnList(CommandName)) {
+ //
+ // Test for a file
+ //
+ if ((FileWithPath = ShellFindFilePathEx(CmdName, mExecutableExtensions)) != NULL) {
//
- // Convert via alias
+ // See if that file has a script file extension
//
- Status = ShellConvertAlias(&CommandName);
- PostAliasSize = 0;
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, &PostAliasSize, CommandName, 0);
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, &PostAliasSize, StrStr(CleanOriginal, L" "), 0);
- ASSERT_EFI_ERROR(Status);
- } else {
- PostAliasCmdLine = StrnCatGrow(&PostAliasCmdLine, NULL, CleanOriginal, 0);
+ if (StrLen(FileWithPath) > 4) {
+ TempLocation = FileWithPath+StrLen(FileWithPath)-4;
+ TempLocation2 = mScriptExtension;
+ if (StringNoCaseCompare((VOID*)(&TempLocation), (VOID*)(&TempLocation2)) == 0) {
+ SHELL_FREE_NON_NULL(FileWithPath);
+ return (Script_File_Name);
+ }
+ }
+
+ //
+ // Was a file, but not a script. we treat this as an application.
+ //
+ SHELL_FREE_NON_NULL(FileWithPath);
+ return (Efi_Application);
}
+
+ SHELL_FREE_NON_NULL(FileWithPath);
+ //
+ // No clue what this is... return invalid flag...
+ //
+ return (Unknown_Invalid);
+}
+
+/**
+ Determine if the first item in a command line is valid.
+
+ @param[in] CmdLine The command line to parse.
- if (CleanOriginal != NULL) {
- FreePool(CleanOriginal);
- CleanOriginal = NULL;
+ @retval EFI_SUCCESS The item is valid.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_NOT_FOUND The operation type is unknown or invalid.
+**/
+EFI_STATUS
+EFIAPI
+IsValidSplit(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ CHAR16 *Temp;
+ CHAR16 *FirstParameter;
+ CHAR16 *TempWalker;
+ EFI_STATUS Status;
+
+ Temp = NULL;
+
+ Temp = StrnCatGrow(&Temp, NULL, CmdLine, 0);
+ if (Temp == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
}
- if (CommandName != NULL) {
- FreePool(CommandName);
- CommandName = NULL;
+ FirstParameter = StrStr(Temp, L"|");
+ if (FirstParameter != NULL) {
+ *FirstParameter = CHAR_NULL;
}
- PostVariableCmdLine = ShellConvertVariables(PostAliasCmdLine);
+ FirstParameter = NULL;
//
- // we can now free the modified by alias command line
+ // Process the command line
//
- if (PostAliasCmdLine != NULL) {
- FreePool(PostAliasCmdLine);
- PostAliasCmdLine = NULL;
+ Status = ProcessCommandLineToFinal(&Temp);
+
+ if (!EFI_ERROR(Status)) {
+ FirstParameter = AllocateZeroPool(StrSize(CmdLine));
+ if (FirstParameter == NULL) {
+ SHELL_FREE_NON_NULL(Temp);
+ return (EFI_OUT_OF_RESOURCES);
+ }
+ TempWalker = (CHAR16*)Temp;
+ GetNextParameter(&TempWalker, &FirstParameter);
+
+ if (GetOperationType(FirstParameter) == Unknown_Invalid) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);
+ SetLastError(SHELL_NOT_FOUND);
+ Status = EFI_NOT_FOUND;
+ }
}
- if (PostVariableCmdLine == NULL) {
- return (EFI_OUT_OF_RESOURCES);
+ SHELL_FREE_NON_NULL(Temp);
+ SHELL_FREE_NON_NULL(FirstParameter);
+ return Status;
+}
+
+/**
+ Determine if a command line contains with a split contains only valid commands.
+
+ @param[in] CmdLine The command line to parse.
+
+ @retval EFI_SUCCESS CmdLine has only valid commands, application, or has no split.
+ @retval EFI_ABORTED CmdLine has at least one invalid command or application.
+**/
+EFI_STATUS
+EFIAPI
+VerifySplit(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ CONST CHAR16 *TempSpot;
+ EFI_STATUS Status;
+
+ //
+ // Verify up to the pipe or end character
+ //
+ Status = IsValidSplit(CmdLine);
+ if (EFI_ERROR(Status)) {
+ return (Status);
+ }
+
+ //
+ // If this was the only item, then get out
+ //
+ if (!ContainsSplit(CmdLine)) {
+ return (EFI_SUCCESS);
+ }
+
+ //
+ // recurse to verify the next item
+ //
+ TempSpot = FindSplit(CmdLine)+1;
+ return (VerifySplit(TempSpot));
+}
+
+/**
+ Process a split based operation.
+
+ @param[in] CmdLine pointer to the command line to process
+
+ @retval EFI_SUCCESS The operation was successful
+ @return an error occured.
+**/
+EFI_STATUS
+EFIAPI
+ProcessNewSplitCommandLine(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ SPLIT_LIST *Split;
+ EFI_STATUS Status;
+
+ Status = VerifySplit(CmdLine);
+ if (EFI_ERROR(Status)) {
+ return (Status);
}
- while (PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] == L' ') {
- PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] = CHAR_NULL;
+ Split = NULL;
+
+ //
+ // are we in an existing split???
+ //
+ if (!IsListEmpty(&ShellInfoObject.SplitList.Link)) {
+ Split = (SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link);
}
- while (PostVariableCmdLine[0] == L' ') {
- CopyMem(PostVariableCmdLine, PostVariableCmdLine+1, StrSize(PostVariableCmdLine) - sizeof(PostVariableCmdLine[0]));
+
+ if (Split == NULL) {
+ Status = RunSplitCommand(CmdLine, NULL, NULL);
+ } else {
+ Status = RunSplitCommand(CmdLine, Split->SplitStdIn, Split->SplitStdOut);
}
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_SPLIT), ShellInfoObject.HiiHandle, CmdLine);
+ }
+ return (Status);
+}
+
+/**
+ Handle a request to change the current file system.
+
+ @param[in] CmdLine The passed in command line.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
+EFI_STATUS
+EFIAPI
+ChangeMappedDrive(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ EFI_STATUS Status;
+ Status = EFI_SUCCESS;
//
- // We dont do normal processing with a split command line (output from one command input to another)
+ // make sure we are the right operation
+ //
+ ASSERT(CmdLine[(StrLen(CmdLine)-1)] == L':' && StrStr(CmdLine, L" ") == NULL);
+
//
- TempLocation3 = NULL;
- if (StrStr(PostVariableCmdLine, L"|") != NULL) {
- for (TempLocation3 = PostVariableCmdLine ; TempLocation3 != NULL && *TempLocation3 != CHAR_NULL ; TempLocation3++) {
- if (*TempLocation3 == L'^' && *(TempLocation3+1) == L'|') {
- TempLocation3++;
- } else if (*TempLocation3 == L'|') {
+ // Call the protocol API to do the work
+ //
+ Status = ShellInfoObject.NewEfiShellProtocol->SetCurDir(NULL, CmdLine);
+
+ //
+ // Report any errors
+ //
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_MAPPING), ShellInfoObject.HiiHandle, CmdLine);
+ }
+
+ return (Status);
+}
+
+/**
+ Reprocess the command line to direct all -? to the help command.
+
+ if found, will add "help" as argv[0], and move the rest later.
+
+ @param[in,out] CmdLine pointer to the command line to update
+**/
+EFI_STATUS
+EFIAPI
+DoHelpUpdate(
+ IN OUT CHAR16 **CmdLine
+ )
+{
+ CHAR16 *CurrentParameter;
+ CHAR16 *Walker;
+ CHAR16 *LastWalker;
+ CHAR16 *NewCommandLine;
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ CurrentParameter = AllocateZeroPool(StrSize(*CmdLine));
+ if (CurrentParameter == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
+
+ Walker = *CmdLine;
+ while(Walker != NULL && *Walker != CHAR_NULL) {
+ LastWalker = Walker;
+ GetNextParameter(&Walker, &CurrentParameter);
+ if (StrStr(CurrentParameter, L"-?") == CurrentParameter) {
+ LastWalker[0] = L' ';
+ LastWalker[1] = L' ';
+ NewCommandLine = AllocateZeroPool(StrSize(L"help ") + StrSize(*CmdLine));
+ if (NewCommandLine == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
break;
}
+ StrCpy(NewCommandLine, L"help ");
+ StrCat(NewCommandLine, *CmdLine);
+ SHELL_FREE_NON_NULL(*CmdLine);
+ *CmdLine = NewCommandLine;
+ break;
}
}
- if (TempLocation3 != NULL && *TempLocation3 != CHAR_NULL) {
+
+ SHELL_FREE_NON_NULL(CurrentParameter);
+
+ return (Status);
+}
+
+/**
+ Function to update the shell variable "lasterror".
+
+ @param[in] ErrorCode the error code to put into lasterror.
+**/
+EFI_STATUS
+EFIAPI
+SetLastError(
+ IN CONST SHELL_STATUS ErrorCode
+ )
+{
+ CHAR16 LeString[19];
+ if (sizeof(EFI_STATUS) == sizeof(UINT64)) {
+ UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", ErrorCode);
+ } else {
+ UnicodeSPrint(LeString, sizeof(LeString), L"0x%x", ErrorCode);
+ }
+ DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
+ InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Converts the command line to it's post-processed form. this replaces variables and alias' per UEFI Shell spec.
+
+ @param[in,out] CmdLine pointer to the command line to update
+
+ @retval EFI_SUCCESS The operation was successful
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @return some other error occured
+**/
+EFI_STATUS
+EFIAPI
+ProcessCommandLineToFinal(
+ IN OUT CHAR16 **CmdLine
+ )
+{
+ EFI_STATUS Status;
+ TrimSpaces(CmdLine);
+
+ Status = ShellSubstituteAliases(CmdLine);
+ if (EFI_ERROR(Status)) {
+ return (Status);
+ }
+
+ TrimSpaces(CmdLine);
+
+ Status = ShellSubstituteVariables(CmdLine);
+ if (EFI_ERROR(Status)) {
+ return (Status);
+ }
+
+ TrimSpaces(CmdLine);
+
+ //
+ // update for help parsing
+ //
+ if (StrStr(*CmdLine, L"?") != NULL) {
//
- // are we in an existing split???
+ // This may do nothing if the ? does not indicate help.
+ // Save all the details for in the API below.
//
- if (!IsListEmpty(&ShellInfoObject.SplitList.Link)) {
- Split = (SPLIT_LIST*)GetFirstNode(&ShellInfoObject.SplitList.Link);
- }
+ Status = DoHelpUpdate(CmdLine);
+ }
- if (Split == NULL) {
- Status = RunSplitCommand(PostVariableCmdLine, NULL, NULL);
- } else {
- Status = RunSplitCommand(PostVariableCmdLine, Split->SplitStdIn, Split->SplitStdOut);
- }
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_SPLIT), ShellInfoObject.HiiHandle, PostVariableCmdLine);
- }
- } else {
+ TrimSpaces(CmdLine);
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Run an internal shell command.
+
+ This API will upadate the shell's environment since these commands are libraries.
+
+ @param[in] CmdLine the command line to run.
+ @param[in] FirstParameter the first parameter on the command line
+ @param[in] ParamProtocol the shell parameters protocol pointer
+ @retval EFI_SUCCESS The command was completed.
+ @retval EFI_ABORTED The command's operation was aborted.
+**/
+EFI_STATUS
+EFIAPI
+RunInternalCommand(
+ IN CONST CHAR16 *CmdLine,
+ IN CHAR16 *FirstParameter,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
+)
+{
+ EFI_STATUS Status;
+ UINTN Argc;
+ CHAR16 **Argv;
+ SHELL_STATUS CommandReturnedStatus;
+ BOOLEAN LastError;
+
+ //
+ // get the argc and argv updated for internal commands
+ //
+ Status = UpdateArgcArgv(ParamProtocol, CmdLine, &Argv, &Argc);
+ if (!EFI_ERROR(Status)) {
//
- // If this is a mapped drive change handle that...
+ // Run the internal command.
//
- if (PostVariableCmdLine[(StrLen(PostVariableCmdLine)-1)] == L':' && StrStr(PostVariableCmdLine, L" ") == NULL) {
- Status = ShellInfoObject.NewEfiShellProtocol->SetCurDir(NULL, PostVariableCmdLine);
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_MAPPING), ShellInfoObject.HiiHandle, PostVariableCmdLine);
+ Status = ShellCommandRunCommandHandler(FirstParameter, &CommandReturnedStatus, &LastError);
+
+ if (!EFI_ERROR(Status)) {
+ //
+ // Update last error status.
+ // some commands do not update last error.
+ //
+ if (LastError) {
+ SetLastError(CommandReturnedStatus);
+ }
+
+ //
+ // Pass thru the exitcode from the app.
+ //
+ if (ShellCommandGetExit()) {
+ //
+ // An Exit was requested ("exit" command), pass its value up.
+ //
+ Status = CommandReturnedStatus;
+ } else if (CommandReturnedStatus != SHELL_SUCCESS && IsScriptOnlyCommand(FirstParameter)) {
+ //
+ // Always abort when a script only command fails for any reason
+ //
+ Status = EFI_ABORTED;
+ } else if (ShellCommandGetCurrentScriptFile() != NULL && CommandReturnedStatus == SHELL_ABORTED) {
+ //
+ // Abort when in a script and a command aborted
+ //
+ Status = EFI_ABORTED;
}
- FreePool(PostVariableCmdLine);
- return (Status);
}
+ }
- ///@todo update this section to divide into 3 ways - run internal command, run split (above), and run an external file...
- /// We waste a lot of time doing processing like StdIn,StdOut,Argv,Argc for things that are external files...
+ //
+ // This is guarenteed to be called after UpdateArgcArgv no matter what else happened.
+ // This is safe even if the update API failed. In this case, it may be a no-op.
+ //
+ RestoreArgcArgv(ParamProtocol, &Argv, &Argc);
+ //
+ // If a script is running and the command is not a scipt only command, then
+ // change return value to success so the script won't halt (unless aborted).
+ //
+ // Script only commands have to be able halt the script since the script will
+ // not operate if they are failing.
+ //
+ if ( ShellCommandGetCurrentScriptFile() != NULL
+ && !IsScriptOnlyCommand(FirstParameter)
+ && Status != EFI_ABORTED
+ ) {
+ Status = EFI_SUCCESS;
+ }
+ return (Status);
+}
- Status = UpdateStdInStdOutStdErr(ShellInfoObject.NewShellParametersProtocol, PostVariableCmdLine, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
- if (EFI_ERROR(Status)) {
- if (Status == EFI_NOT_FOUND) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_REDUNDA_REDIR), ShellInfoObject.HiiHandle);
- } else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_REDIR), ShellInfoObject.HiiHandle);
- }
- } else {
- while (PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] == L' ') {
- PostVariableCmdLine[StrLen(PostVariableCmdLine)-1] = CHAR_NULL;
- }
- while (PostVariableCmdLine[0] == L' ') {
- CopyMem(PostVariableCmdLine, PostVariableCmdLine+1, StrSize(PostVariableCmdLine) - sizeof(PostVariableCmdLine[0]));
- }
+/**
+ Function to run the command or file.
+ @param[in] Type the type of operation being run.
+ @param[in] CmdLine the command line to run.
+ @param[in] FirstParameter the first parameter on the command line
+ @param[in] ParamProtocol the shell parameters protocol pointer
+
+ @retval EFI_SUCCESS The command was completed.
+ @retval EFI_ABORTED The command's operation was aborted.
+**/
+EFI_STATUS
+EFIAPI
+RunCommandOrFile(
+ IN SHELL_OPERATION_TYPES Type,
+ IN CONST CHAR16 *CmdLine,
+ IN CHAR16 *FirstParameter,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
+)
+{
+ EFI_STATUS Status;
+ EFI_STATUS StatusCode;
+ CHAR16 *CommandWithPath;
+ EFI_DEVICE_PATH_PROTOCOL *DevPath;
+
+ Status = EFI_SUCCESS;
+ CommandWithPath = NULL;
+ DevPath = NULL;
+
+ switch (Type) {
+ case Internal_Command:
+ Status = RunInternalCommand(CmdLine, FirstParameter, ParamProtocol);
+ break;
+ case Script_File_Name:
+ case Efi_Application:
//
- // get the argc and argv updated for internal commands
+ // Process a fully qualified path
//
- Status = UpdateArgcArgv(ShellInfoObject.NewShellParametersProtocol, PostVariableCmdLine, &Argv, &Argc);
- ASSERT_EFI_ERROR(Status);
-
- for (Count = 0 ; Count < ShellInfoObject.NewShellParametersProtocol->Argc ; Count++) {
- if (StrStr(ShellInfoObject.NewShellParametersProtocol->Argv[Count], L"-?") == ShellInfoObject.NewShellParametersProtocol->Argv[Count]
- || (ShellInfoObject.NewShellParametersProtocol->Argv[0][0] == L'?' && ShellInfoObject.NewShellParametersProtocol->Argv[0][1] == CHAR_NULL)
- ) {
- //
- // We need to redo the arguments since a parameter was -?
- // move them all down 1 to the end, then up one then replace the first with help
- //
- FreePool(ShellInfoObject.NewShellParametersProtocol->Argv[Count]);
- ShellInfoObject.NewShellParametersProtocol->Argv[Count] = NULL;
- for (Count2 = Count ; (Count2 + 1) < ShellInfoObject.NewShellParametersProtocol->Argc ; Count2++) {
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = ShellInfoObject.NewShellParametersProtocol->Argv[Count2+1];
- }
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = NULL;
- for (Count2 = ShellInfoObject.NewShellParametersProtocol->Argc -1 ; Count2 > 0 ; Count2--) {
- ShellInfoObject.NewShellParametersProtocol->Argv[Count2] = ShellInfoObject.NewShellParametersProtocol->Argv[Count2-1];
- }
- ShellInfoObject.NewShellParametersProtocol->Argv[0] = NULL;
- ShellInfoObject.NewShellParametersProtocol->Argv[0] = StrnCatGrow(&ShellInfoObject.NewShellParametersProtocol->Argv[0], NULL, L"help", 0);
- break;
+ if (StrStr(FirstParameter, L":") != NULL) {
+ ASSERT (CommandWithPath == NULL);
+ if (ShellIsFile(FirstParameter) == EFI_SUCCESS) {
+ CommandWithPath = StrnCatGrow(&CommandWithPath, NULL, FirstParameter, 0);
}
}
//
- // command or file?
+ // Process a relative path and also check in the path environment variable
//
- if (ShellCommandIsCommandOnList(ShellInfoObject.NewShellParametersProtocol->Argv[0])) {
- //
- // Run the command (which was converted if it was an alias)
- //
- if (!EFI_ERROR(Status)) {
- Status = ShellCommandRunCommandHandler(ShellInfoObject.NewShellParametersProtocol->Argv[0], &ShellStatus, &LastError);
- ASSERT_EFI_ERROR(Status);
+ if (CommandWithPath == NULL) {
+ CommandWithPath = ShellFindFilePathEx(FirstParameter, mExecutableExtensions);
+ }
- if (sizeof(EFI_STATUS) == sizeof(UINT64)) {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", ShellStatus);
- } else {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%x", ShellStatus);
- }
- DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
- if (LastError) {
- InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
- }
+ //
+ // This should be impossible now.
+ //
+ ASSERT(CommandWithPath != NULL);
+
+ //
+ // Make sure that path is not just a directory (or not found)
+ //
+ if (!EFI_ERROR(ShellIsDirectory(CommandWithPath))) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);
+ SetLastError(SHELL_NOT_FOUND);
+ }
+ switch (Type) {
+ case Script_File_Name:
+ Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol);
+ break;
+ case Efi_Application:
//
- // Pass thru the exitcode from the app.
+ // Get the device path of the application image
//
- if (ShellCommandGetExit()) {
- Status = ShellStatus;
- } else if (ShellStatus != 0 && IsScriptOnlyCommand(ShellInfoObject.NewShellParametersProtocol->Argv[0])) {
- Status = EFI_ABORTED;
- }
- }
- } else {
- //
- // run an external file (or script)
- //
- if (StrStr(ShellInfoObject.NewShellParametersProtocol->Argv[0], L":") != NULL) {
- ASSERT (CommandWithPath == NULL);
- if (ShellIsFile(ShellInfoObject.NewShellParametersProtocol->Argv[0]) == EFI_SUCCESS) {
- CommandWithPath = StrnCatGrow(&CommandWithPath, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
+ DevPath = ShellInfoObject.NewEfiShellProtocol->GetDevicePathFromFilePath(CommandWithPath);
+ if (DevPath == NULL){
+ Status = EFI_OUT_OF_RESOURCES;
+ break;
}
- }
- if (CommandWithPath == NULL) {
- CommandWithPath = ShellFindFilePathEx(ShellInfoObject.NewShellParametersProtocol->Argv[0], mExecutableExtensions);
- }
- if (CommandWithPath == NULL || ShellIsDirectory(CommandWithPath) == EFI_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, ShellInfoObject.NewShellParametersProtocol->Argv[0]);
- if (sizeof(EFI_STATUS) == sizeof(UINT64)) {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", EFI_NOT_FOUND);
- } else {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%x", EFI_NOT_FOUND);
- }
- DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
- InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
- } else {
//
- // Check if it's a NSH (script) file.
+ // Execute the device path
//
- TempLocation = CommandWithPath+StrLen(CommandWithPath)-4;
- TempLocation2 = mScriptExtension;
- if ((StrLen(CommandWithPath) > 4) && (StringNoCaseCompare((VOID*)(&TempLocation), (VOID*)(&TempLocation2)) == 0)) {
- Status = RunScriptFile (CommandWithPath);
- } else {
- DevPath = ShellInfoObject.NewEfiShellProtocol->GetDevicePathFromFilePath(CommandWithPath);
- ASSERT(DevPath != NULL);
- Status = InternalShellExecuteDevicePath(
- &gImageHandle,
- DevPath,
- PostVariableCmdLine,
- NULL,
- &StatusCode
- );
+ Status = InternalShellExecuteDevicePath(
+ &gImageHandle,
+ DevPath,
+ CmdLine,
+ NULL,
+ &StatusCode
+ );
- //
- // Update last error status.
- //
- if (sizeof(EFI_STATUS) == sizeof(UINT64)) {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%Lx", StatusCode);
- } else {
- UnicodeSPrint(LeString, sizeof(LeString), L"0x%x", StatusCode);
- }
- DEBUG_CODE(InternalEfiShellSetEnv(L"debuglasterror", LeString, TRUE););
- InternalEfiShellSetEnv(L"lasterror", LeString, TRUE);
- }
- }
- }
+ SHELL_FREE_NON_NULL(DevPath);
+ //
+ // Update last error status.
+ //
+ SetLastError((SHELL_STATUS) StatusCode);
+ break;
+ default:
+ //
+ // Do nothing.
+ //
+ break;
+ }
+ break;
+ default:
//
- // Print some error info.
+ // Do nothing.
//
- if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
- }
+ break;
+ }
- CommandName = StrnCatGrow(&CommandName, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
+ SHELL_FREE_NON_NULL(CommandWithPath);
- RestoreArgcArgv(ShellInfoObject.NewShellParametersProtocol, &Argv, &Argc);
+ return (Status);
+}
- RestoreStdInStdOutStdErr(ShellInfoObject.NewShellParametersProtocol, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
- }
- if (CommandName != NULL) {
- if (ShellCommandGetCurrentScriptFile() != NULL && !IsScriptOnlyCommand(CommandName)) {
- //
- // if this is NOT a scipt only command return success so the script won't quit.
- // prevent killing the script - this is the only place where we know the actual command name (after alias and variable replacement...)
- //
- Status = EFI_SUCCESS;
- }
- }
+/**
+ Function to setup StdIn, StdErr, StdOut, and then run the command or file.
+
+ @param[in] Type the type of operation being run.
+ @param[in] CmdLine the command line to run.
+ @param[in] FirstParameter the first parameter on the command line.
+ @param[in] ParamProtocol the shell parameters protocol pointer
+
+ @retval EFI_SUCCESS The command was completed.
+ @retval EFI_ABORTED The command's operation was aborted.
+**/
+EFI_STATUS
+EFIAPI
+SetupAndRunCommandOrFile(
+ IN SHELL_OPERATION_TYPES Type,
+ IN CHAR16 *CmdLine,
+ IN CHAR16 *FirstParameter,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
+)
+{
+ EFI_STATUS Status;
+ SHELL_FILE_HANDLE OriginalStdIn;
+ SHELL_FILE_HANDLE OriginalStdOut;
+ SHELL_FILE_HANDLE OriginalStdErr;
+ SYSTEM_TABLE_INFO OriginalSystemTableInfo;
+
+ //
+ // Update the StdIn, StdOut, and StdErr for redirection to environment variables, files, etc... unicode and ASCII
+ //
+ Status = UpdateStdInStdOutStdErr(ParamProtocol, CmdLine, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
+
+ //
+ // The StdIn, StdOut, and StdErr are set up.
+ // Now run the command, script, or application
+ //
+ if (!EFI_ERROR(Status)) {
+ Status = RunCommandOrFile(Type, CmdLine, FirstParameter, ParamProtocol);
}
- SHELL_FREE_NON_NULL(CommandName);
- SHELL_FREE_NON_NULL(CommandWithPath);
- SHELL_FREE_NON_NULL(PostVariableCmdLine);
+ //
+ // Now print errors
+ //
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
+ }
+
+ //
+ // put back the original StdIn, StdOut, and StdErr
+ //
+ RestoreStdInStdOutStdErr(ParamProtocol, &OriginalStdIn, &OriginalStdOut, &OriginalStdErr, &OriginalSystemTableInfo);
+
+ return (Status);
+}
+
+/**
+ Function will process and run a command line.
+
+ This will determine if the command line represents an internal shell
+ command or dispatch an external application.
+
+ @param[in] CmdLine The command line to parse.
+
+ @retval EFI_SUCCESS The command was completed.
+ @retval EFI_ABORTED The command's operation was aborted.
+**/
+EFI_STATUS
+EFIAPI
+RunCommand(
+ IN CONST CHAR16 *CmdLine
+ )
+{
+ EFI_STATUS Status;
+ CHAR16 *CleanOriginal;
+ CHAR16 *FirstParameter;
+ CHAR16 *TempWalker;
+ SHELL_OPERATION_TYPES Type;
+
+ ASSERT(CmdLine != NULL);
+ if (StrLen(CmdLine) == 0) {
+ return (EFI_SUCCESS);
+ }
+
+ Status = EFI_SUCCESS;
+ CleanOriginal = NULL;
+
+ CleanOriginal = StrnCatGrow(&CleanOriginal, NULL, CmdLine, 0);
+ if (CleanOriginal == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
+
+ TrimSpaces(&CleanOriginal);
+
+ //
+ // Handle case that passed in command line is just 1 or more " " characters.
+ //
+ if (StrLen (CleanOriginal) == 0) {
+ SHELL_FREE_NON_NULL(CleanOriginal);
+ return (EFI_SUCCESS);
+ }
+
+ Status = ProcessCommandLineToFinal(&CleanOriginal);
+ if (EFI_ERROR(Status)) {
+ SHELL_FREE_NON_NULL(CleanOriginal);
+ return (Status);
+ }
+
+ //
+ // We dont do normal processing with a split command line (output from one command input to another)
+ //
+ if (ContainsSplit(CleanOriginal)) {
+ Status = ProcessNewSplitCommandLine(CleanOriginal);
+ SHELL_FREE_NON_NULL(CleanOriginal);
+ return (Status);
+ }
+
+ //
+ // We need the first parameter information so we can determine the operation type
+ //
+ FirstParameter = AllocateZeroPool(StrSize(CleanOriginal));
+ if (FirstParameter == NULL) {
+ SHELL_FREE_NON_NULL(CleanOriginal);
+ return (EFI_OUT_OF_RESOURCES);
+ }
+ TempWalker = CleanOriginal;
+ GetNextParameter(&TempWalker, &FirstParameter);
+
+ //
+ // Depending on the first parameter we change the behavior
+ //
+ switch (Type = GetOperationType(FirstParameter)) {
+ case File_Sys_Change:
+ Status = ChangeMappedDrive(CleanOriginal);
+ break;
+ case Internal_Command:
+ case Script_File_Name:
+ case Efi_Application:
+ Status = SetupAndRunCommandOrFile(Type, CleanOriginal, FirstParameter, ShellInfoObject.NewShellParametersProtocol);
+ break;
+ default:
+ //
+ // Whatever was typed, it was invalid.
+ //
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND), ShellInfoObject.HiiHandle, FirstParameter);
+ SetLastError(SHELL_NOT_FOUND);
+ break;
+ }
+
+ SHELL_FREE_NON_NULL(CleanOriginal);
+ SHELL_FREE_NON_NULL(FirstParameter);
return (Status);
}
@@ -1811,11 +2362,13 @@ RunScriptFileHandle (
while(!ShellFileHandleEof(Handle)) {
CommandLine = ShellFileHandleReturnLine(Handle, &Ascii);
LineCount++;
- if (CommandLine == NULL || StrLen(CommandLine) == 0) {
+ if (CommandLine == NULL || StrLen(CommandLine) == 0 || CommandLine[0] == '#') {
+ SHELL_FREE_NON_NULL(CommandLine);
continue;
}
NewScriptFile->CurrentCommand = AllocateZeroPool(sizeof(SCRIPT_COMMAND_LIST));
if (NewScriptFile->CurrentCommand == NULL) {
+ SHELL_FREE_NON_NULL(CommandLine);
DeleteScriptFileStruct(NewScriptFile);
return (EFI_OUT_OF_RESOURCES);
}
@@ -2025,30 +2578,62 @@ RunScriptFileHandle (
Function to process a NSH script file.
@param[in] ScriptPath Pointer to the script file name (including file system path).
+ @param[in] Handle the handle of the script file already opened.
+ @param[in] CmdLine the command line to run.
+ @param[in] ParamProtocol the shell parameters protocol pointer
@retval EFI_SUCCESS the script completed sucessfully
**/
EFI_STATUS
EFIAPI
RunScriptFile (
- IN CONST CHAR16 *ScriptPath
+ IN CONST CHAR16 *ScriptPath,
+ IN SHELL_FILE_HANDLE Handle OPTIONAL,
+ IN CONST CHAR16 *CmdLine,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
)
{
EFI_STATUS Status;
SHELL_FILE_HANDLE FileHandle;
+ UINTN Argc;
+ CHAR16 **Argv;
if (ShellIsFile(ScriptPath) != EFI_SUCCESS) {
return (EFI_INVALID_PARAMETER);
}
- Status = ShellOpenFileByName(ScriptPath, &FileHandle, EFI_FILE_MODE_READ, 0);
- if (EFI_ERROR(Status)) {
- return (Status);
- }
+ //
+ // get the argc and argv updated for scripts
+ //
+ Status = UpdateArgcArgv(ParamProtocol, CmdLine, &Argv, &Argc);
+ if (!EFI_ERROR(Status)) {
+
+ if (Handle == NULL) {
+ //
+ // open the file
+ //
+ Status = ShellOpenFileByName(ScriptPath, &FileHandle, EFI_FILE_MODE_READ, 0);
+ if (!EFI_ERROR(Status)) {
+ //
+ // run it
+ //
+ Status = RunScriptFileHandle(FileHandle, ScriptPath);
- Status = RunScriptFileHandle(FileHandle, ScriptPath);
+ //
+ // now close the file
+ //
+ ShellCloseFile(&FileHandle);
+ }
+ } else {
+ Status = RunScriptFileHandle(Handle, ScriptPath);
+ }
+ }
- ShellCloseFile(&FileHandle);
+ //
+ // This is guarenteed to be called after UpdateArgcArgv no matter what else happened.
+ // This is safe even if the update API failed. In this case, it may be a no-op.
+ //
+ RestoreArgcArgv(ParamProtocol, &Argv, &Argc);
return (Status);
}
diff --git a/ShellPkg/Application/Shell/Shell.h b/ShellPkg/Application/Shell/Shell.h
index 2ed05b8a1..1962dd639 100644
--- a/ShellPkg/Application/Shell/Shell.h
+++ b/ShellPkg/Application/Shell/Shell.h
@@ -1,7 +1,7 @@
/** @file
function definitions for internal to shell functions.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -124,6 +124,40 @@ typedef struct {
extern SHELL_INFO ShellInfoObject;
+typedef enum {
+ Internal_Command,
+ Script_File_Name,
+ Efi_Application,
+ File_Sys_Change,
+ Unknown_Invalid
+} SHELL_OPERATION_TYPES;
+
+/**
+ Converts the command line to it's post-processed form. this replaces variables and alias' per UEFI Shell spec.
+
+ @param[in,out] CmdLine pointer to the command line to update
+
+ @retval EFI_SUCCESS The operation was successful
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @return some other error occured
+**/
+EFI_STATUS
+EFIAPI
+ProcessCommandLineToFinal(
+ IN OUT CHAR16 **CmdLine
+ );
+
+/**
+ Function to update the shell variable "lasterror".
+
+ @param[in] ErrorCode the error code to put into lasterror
+**/
+EFI_STATUS
+EFIAPI
+SetLastError(
+ IN CONST SHELL_STATUS ErrorCode
+ );
+
/**
Sets all the alias' that were registered with the ShellCommandLib library.
@@ -293,13 +327,19 @@ RunScriptFileHandle (
Function to process a NSH script file.
@param[in] ScriptPath Pointer to the script file name (including file system path).
+ @param[in] Handle the handle of the script file already opened.
+ @param[in] CmdLine the command line to run.
+ @param[in] ParamProtocol the shell parameters protocol pointer
@retval EFI_SUCCESS the script completed sucessfully
**/
EFI_STATUS
EFIAPI
RunScriptFile (
- IN CONST CHAR16 *ScriptPath
+ IN CONST CHAR16 *ScriptPath,
+ IN SHELL_FILE_HANDLE Handle OPTIONAL,
+ IN CONST CHAR16 *CmdLine,
+ IN EFI_SHELL_PARAMETERS_PROTOCOL *ParamProtocol
);
diff --git a/ShellPkg/Application/Shell/ShellManParser.c b/ShellPkg/Application/Shell/ShellManParser.c
index 8196a6ac9..525c9343b 100644
--- a/ShellPkg/Application/Shell/ShellManParser.c
+++ b/ShellPkg/Application/Shell/ShellManParser.c
@@ -492,19 +492,6 @@ ManFileFindTitleSection(
StrCpy(TitleString, L".TH ");
StrCat(TitleString, Command);
- //
- // If the "name" ends with .efi we can safely chop that off since "help foo.efi" and "help foo"
- // should produce the same results.
- //
- if ((StrLen(Command)> 4)
- && (TitleString[StrLen(TitleString)-1] == L'i' || TitleString[StrLen(TitleString)-1] == L'I')
- && (TitleString[StrLen(TitleString)-2] == L'f' || TitleString[StrLen(TitleString)-2] == L'F')
- && (TitleString[StrLen(TitleString)-3] == L'e' || TitleString[StrLen(TitleString)-2] == L'E')
- && (TitleString[StrLen(TitleString)-4] == L'.')
- ) {
- TitleString[StrLen(TitleString)-4] = CHAR_NULL;
- }
-
TitleLen = StrLen(TitleString);
for (;!ShellFileHandleEof(Handle);Size = 1024) {
Status = ShellFileHandleReadLine(Handle, ReadLine, &Size, TRUE, Ascii);
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
index b6598c0cf..ab435a126 100644
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c
@@ -3,7 +3,7 @@
manipulation, and initialization of EFI_SHELL_PARAMETERS_PROTOCOL.
Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -568,6 +568,28 @@ FixVarName (
}
/**
+ Remove the unicode file tag from the begining of the file buffer since that will not be
+ used by StdIn.
+**/
+EFI_STATUS
+EFIAPI
+RemoveFileTag(
+ IN SHELL_FILE_HANDLE *Handle
+ )
+{
+ UINTN CharSize;
+ CHAR16 CharBuffer;
+
+ CharSize = sizeof(CHAR16);
+ CharBuffer = 0;
+ gEfiShellProtocol->ReadFile(*Handle, &CharSize, &CharBuffer);
+ if (CharBuffer != gUnicodeFileTag) {
+ gEfiShellProtocol->SetFilePosition(*Handle, 0);
+ }
+ return (EFI_SUCCESS);
+}
+
+/**
Funcion will replace the current StdIn and StdOut in the ShellParameters protocol
structure by parsing NewCommandLine. The current values are returned to the
user.
@@ -1148,7 +1170,15 @@ UpdateStdInStdOutStdErr(
&TempHandle,
EFI_FILE_MODE_READ,
0);
- if (!InUnicode && !EFI_ERROR(Status)) {
+ if (InUnicode) {
+ //
+ // Chop off the 0xFEFF if it's there...
+ //
+ RemoveFileTag(&TempHandle);
+ } else if (!EFI_ERROR(Status)) {
+ //
+ // Create the ASCII->Unicode conversion layer
+ //
TempHandle = CreateFileInterfaceFile(TempHandle, FALSE);
}
if (!EFI_ERROR(Status)) {
@@ -1163,8 +1193,15 @@ UpdateStdInStdOutStdErr(
CalculateEfiHdrCrc(&gST->Hdr);
if (gST->ConIn == NULL ||gST->ConOut == NULL) {
- return (EFI_OUT_OF_RESOURCES);
+ Status = EFI_OUT_OF_RESOURCES;
}
+
+ if (Status == EFI_NOT_FOUND) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_REDUNDA_REDIR), ShellInfoObject.HiiHandle);
+ } else if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_INVALID_REDIR), ShellInfoObject.HiiHandle);
+ }
+
return (Status);
}
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index 89132969b..c619ba15a 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -2,7 +2,7 @@
Member functions of EFI_SHELL_PROTOCOL and functions for creation,
manipulation, and initialization of EFI_SHELL_PROTOCOL.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1619,6 +1619,8 @@ EfiShellFreeFileList(
RemoveEntryList(&ShellFileListItem->Link);
InternalFreeShellFileInfoNode(ShellFileListItem);
}
+ InternalFreeShellFileInfoNode(*FileList);
+ *FileList = NULL;
return(EFI_SUCCESS);
}
@@ -1714,7 +1716,6 @@ InternalDuplicateShellFileInfo(
@param[in] BasePath the Path to prepend onto filename for FullPath
@param[in] Status Status member initial value.
- @param[in] FullName FullName member initial value.
@param[in] FileName FileName member initial value.
@param[in] Handle Handle member initial value.
@param[in] Info Info struct to copy.
@@ -1727,7 +1728,6 @@ EFIAPI
CreateAndPopulateShellFileInfo(
IN CONST CHAR16 *BasePath,
IN CONST EFI_STATUS Status,
- IN CONST CHAR16 *FullName,
IN CONST CHAR16 *FileName,
IN CONST SHELL_FILE_HANDLE Handle,
IN CONST EFI_FILE_INFO *Info
@@ -1836,6 +1836,7 @@ EfiShellFindFilesInDir(
Size = 0;
TempString = StrnCatGrow(&TempString, &Size, ShellFileHandleGetPath(FileDirHandle), 0);
if (TempString == NULL) {
+ SHELL_FREE_NON_NULL(BasePath);
return (EFI_OUT_OF_RESOURCES);
}
TempSpot = StrStr(TempString, L";");
@@ -1846,8 +1847,10 @@ EfiShellFindFilesInDir(
TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
if (TempString == NULL) {
+ SHELL_FREE_NON_NULL(BasePath);
return (EFI_OUT_OF_RESOURCES);
}
+ SHELL_FREE_NON_NULL(BasePath);
BasePath = TempString;
}
@@ -1862,20 +1865,14 @@ EfiShellFindFilesInDir(
; !EFI_ERROR(Status) && !NoFile
; Status = FileHandleFindNextFile(FileDirHandle, FileInfo, &NoFile)
){
- TempString = NULL;
- Size = 0;
//
// allocate a new EFI_SHELL_FILE_INFO and populate it...
//
- ASSERT((TempString == NULL && Size == 0) || (TempString != NULL));
- TempString = StrnCatGrow(&TempString, &Size, BasePath, 0);
- TempString = StrnCatGrow(&TempString, &Size, FileInfo->FileName, 0);
ShellFileListItem = CreateAndPopulateShellFileInfo(
BasePath,
- EFI_SUCCESS, // success since we didnt fail to open it...
- TempString,
+ EFI_SUCCESS, // success since we didnt fail to open it...
FileInfo->FileName,
- NULL, // no handle since not open
+ NULL, // no handle since not open
FileInfo);
if (ShellFileList == NULL) {
@@ -2769,15 +2766,33 @@ EfiShellGetHelpText(
)
{
CONST CHAR16 *ManFileName;
+ CHAR16 *FixCommand;
+ EFI_STATUS Status;
ASSERT(HelpText != NULL);
+ FixCommand = NULL;
ManFileName = ShellCommandGetManFileNameHandler(Command);
if (ManFileName != NULL) {
return (ProcessManFile(ManFileName, Command, Sections, NULL, HelpText));
} else {
- return (ProcessManFile(Command, Command, Sections, NULL, HelpText));
+ if ((StrLen(Command)> 4)
+ && (Command[StrLen(Command)-1] == L'i' || Command[StrLen(Command)-1] == L'I')
+ && (Command[StrLen(Command)-2] == L'f' || Command[StrLen(Command)-2] == L'F')
+ && (Command[StrLen(Command)-3] == L'e' || Command[StrLen(Command)-3] == L'E')
+ && (Command[StrLen(Command)-4] == L'.')
+ ) {
+ FixCommand = AllocateZeroPool(StrSize(Command) - 4 * sizeof (CHAR16));
+ ASSERT(FixCommand != NULL);
+
+ StrnCpy(FixCommand, Command, StrLen(Command)-4);
+ Status = ProcessManFile(FixCommand, FixCommand, Sections, NULL, HelpText);
+ FreePool(FixCommand);
+ return Status;
+ } else {
+ return (ProcessManFile(Command, Command, Sections, NULL, HelpText));
+ }
}
}
@@ -3279,7 +3294,6 @@ NotificationFunction(
IN EFI_KEY_DATA *KeyData
)
{
- EFI_INPUT_KEY Key;
if ( ((KeyData->Key.UnicodeChar == L'c') &&
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))) ||
(KeyData->Key.UnicodeChar == 3)
@@ -3292,12 +3306,6 @@ NotificationFunction(
(KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_LEFT_CONTROL_PRESSED) || KeyData->KeyState.KeyShiftState == (EFI_SHIFT_STATE_VALID|EFI_RIGHT_CONTROL_PRESSED))
){
ShellInfoObject.HaltOutput = TRUE;
-
- //
- // Make sure that there are no pending keystrokes to pervent the pause.
- //
- gST->ConIn->Reset(gST->ConIn, FALSE);
- while (gST->ConIn->ReadKeyStroke (gST->ConIn, &Key)==EFI_SUCCESS);
}
return (EFI_SUCCESS);
}
diff --git a/ShellPkg/Application/Shell/ShellProtocol.h b/ShellPkg/Application/Shell/ShellProtocol.h
index 456aa2aff..7493c9f49 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.h
+++ b/ShellPkg/Application/Shell/ShellProtocol.h
@@ -2,7 +2,7 @@
Member functions of EFI_SHELL_PROTOCOL and functions for creation,
manipulation, and initialization of EFI_SHELL_PROTOCOL.
- Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -555,7 +555,6 @@ EfiShellRemoveDupInFileList(
@param[in] BasePath the Path to prepend onto filename for FullPath
@param[in] Status Status member initial value.
- @param[in] FullName FullName member initial value.
@param[in] FileName FileName member initial value.
@param[in] Handle Handle member initial value.
@param[in] Info Info struct to copy.
@@ -566,7 +565,6 @@ EFIAPI
CreateAndPopulateShellFileInfo(
IN CONST CHAR16 *BasePath,
IN CONST EFI_STATUS Status,
- IN CONST CHAR16 *FullName,
IN CONST CHAR16 *FileName,
IN CONST SHELL_FILE_HANDLE Handle,
IN CONST EFI_FILE_INFO *Info
diff --git a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
index 935e8397f..48be39f83 100644
--- a/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
+++ b/ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
@@ -1,7 +1,7 @@
/** @file
Provides interface to shell internal functions for shell commands.
- Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -101,6 +101,37 @@ ShellCommandLibConstructor (
}
/**
+ Frees list of file handles.
+
+ @param[in] List The list to free.
+**/
+VOID
+EFIAPI
+FreeFileHandleList (
+ IN BUFFER_LIST *List
+ )
+{
+ BUFFER_LIST *BufferListEntry;
+
+ if (List == NULL){
+ return;
+ }
+ //
+ // enumerate through the buffer list and free all memory
+ //
+ for ( BufferListEntry = ( BUFFER_LIST *)GetFirstNode(&List->Link)
+ ; !IsListEmpty (&List->Link)
+ ; BufferListEntry = (BUFFER_LIST *)GetFirstNode(&List->Link)
+ ){
+ RemoveEntryList(&BufferListEntry->Link);
+ ASSERT(BufferListEntry->Buffer != NULL);
+ SHELL_FREE_NON_NULL(((SHELL_COMMAND_FILE_HANDLE*)(BufferListEntry->Buffer))->Path);
+ SHELL_FREE_NON_NULL(BufferListEntry->Buffer);
+ SHELL_FREE_NON_NULL(BufferListEntry);
+ }
+}
+
+/**
Destructor for the library. free any resources.
@param ImageHandle the image handle of the process
@@ -169,7 +200,7 @@ ShellCommandLibDestructor (
}
}
if (!IsListEmpty(&mFileHandleList.Link)){
- FreeBufferList(&mFileHandleList);
+ FreeFileHandleList(&mFileHandleList);
}
if (mProfileList != NULL) {
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
index 73831d267..b19d8d9fb 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Bcfg.c
@@ -48,16 +48,6 @@ typedef struct {
} BGFG_OPERATION;
/**
- Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Actual number of entries in EFI_KEY_OPTION.Keys.
-**/
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) \
- (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
-
-/**
Update the optional data for a boot or driver option.
If optional data exists it will be changed.
@@ -843,7 +833,7 @@ BcfgAddOptDebug1(
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Walker);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- NewKeyOption.KeyData = (UINT32)Intermediate;
+ NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate;
Temp = StrStr(Walker, L" ");
if (Temp != NULL) {
Walker = Temp;
@@ -858,13 +848,13 @@ BcfgAddOptDebug1(
// Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.
// Re-allocate with the added information.
//
- KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);
+ KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * NewKeyOption.KeyData.Options.InputKeyCount), &NewKeyOption);
if (KeyOptionBuffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellDebug1HiiHandle);
ShellStatus = SHELL_OUT_OF_RESOURCES;
}
}
- for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption); LoopCounter++) {
+ for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < NewKeyOption.KeyData.Options.InputKeyCount; LoopCounter++) {
//
// ScanCode
//
@@ -930,7 +920,7 @@ BcfgAddOptDebug1(
VariableName,
(EFI_GUID*)&gEfiGlobalVariableGuid,
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),
+ sizeof(EFI_KEY_OPTION) + (sizeof(EFI_KEY_DATA) * NewKeyOption.KeyData.Options.InputKeyCount),
KeyOptionBuffer);
if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellDebug1HiiHandle, VariableName, Status);
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
index 3445b7f7e..b41636c7e 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/DmpStore.c
@@ -1,7 +1,7 @@
/** @file
Main file for DmpStore shell Debug1 function.
- Copyright (c) 2005 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -14,9 +14,24 @@
#include "UefiShellDebug1CommandsLib.h"
-
-#define INIT_NAME_BUFFER_SIZE 128
-#define INIT_DATA_BUFFER_SIZE 1024
+typedef enum {
+ DmpStoreDisplay,
+ DmpStoreDelete,
+ DmpStoreSave,
+ DmpStoreLoad
+} DMP_STORE_TYPE;
+
+typedef struct {
+ UINT32 Signature;
+ CHAR16 *Name;
+ EFI_GUID Guid;
+ UINT32 Attributes;
+ UINT32 DataSize;
+ UINT8 *Data;
+ LIST_ENTRY Link;
+} DMP_STORE_VARIABLE;
+
+#define DMP_STORE_VARIABLE_SIGNATURE SIGNATURE_32 ('_', 'd', 's', 's')
/**
Base on the input attribute value to return the attribute string.
@@ -67,11 +82,282 @@ GetAttrType (
}
/**
- Function to display or delete variables.
+ Load the variable data from file and set to variable data base.
+
+ @param[in] FileHandle The file to be read.
+ @param[in] Name The name of the variables to be loaded.
+ @param[in] Guid The guid of the variables to be loaded.
+ @param[out] Found TRUE when at least one variable was loaded and set.
+
+ @retval SHELL_DEVICE_ERROR Cannot access the file.
+ @retval SHELL_VOLUME_CORRUPTED The file is in bad format.
+ @retval SHELL_OUT_OF_RESOURCES There is not enough memory to perform the operation.
+ @retval SHELL_SUCCESS Successfully load and set the variables.
+**/
+SHELL_STATUS
+LoadVariablesFromFile (
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST CHAR16 *Name,
+ IN CONST EFI_GUID *Guid,
+ OUT BOOLEAN *Found
+ )
+{
+ EFI_STATUS Status;
+ SHELL_STATUS ShellStatus;
+ UINT32 NameSize;
+ UINT32 DataSize;
+ UINTN BufferSize;
+ UINTN RemainingSize;
+ UINT64 Position;
+ UINT64 FileSize;
+ LIST_ENTRY List;
+ DMP_STORE_VARIABLE *Variable;
+ LIST_ENTRY *Link;
+ CHAR16 *Attributes;
+ UINT8 *Buffer;
+ UINT32 Crc32;
+
+ Status = ShellGetFileSize (FileHandle, &FileSize);
+ if (EFI_ERROR (Status)) {
+ return SHELL_DEVICE_ERROR;
+ }
+
+ ShellStatus = SHELL_SUCCESS;
+
+ InitializeListHead (&List);
+
+ Position = 0;
+ while (Position < FileSize) {
+ //
+ // NameSize
+ //
+ BufferSize = sizeof (NameSize);
+ Status = ShellReadFile (FileHandle, &BufferSize, &NameSize);
+ if (EFI_ERROR (Status) || (BufferSize != sizeof (NameSize))) {
+ ShellStatus = SHELL_VOLUME_CORRUPTED;
+ break;
+ }
+
+ //
+ // DataSize
+ //
+ BufferSize = sizeof (DataSize);
+ Status = ShellReadFile (FileHandle, &BufferSize, &DataSize);
+ if (EFI_ERROR (Status) || (BufferSize != sizeof (DataSize))) {
+ ShellStatus = SHELL_VOLUME_CORRUPTED;
+ break;
+ }
- @param[in] VariableName The variable name of the EFI variable (or NULL).
+ //
+ // Name, Guid, Attributes, Data, Crc32
+ //
+ RemainingSize = NameSize + sizeof (EFI_GUID) + sizeof (UINT32) + DataSize + sizeof (Crc32);
+ BufferSize = sizeof (NameSize) + sizeof (DataSize) + RemainingSize;
+ Buffer = AllocatePool (BufferSize);
+ if (Buffer == NULL) {
+ ShellStatus = SHELL_OUT_OF_RESOURCES;
+ break;
+ }
+ BufferSize = RemainingSize;
+ Status = ShellReadFile (FileHandle, &BufferSize, (UINT32 *) Buffer + 2);
+ if (EFI_ERROR (Status) || (BufferSize != RemainingSize)) {
+ ShellStatus = SHELL_VOLUME_CORRUPTED;
+ FreePool (Buffer);
+ break;
+ }
+
+ //
+ // Check Crc32
+ //
+ * (UINT32 *) Buffer = NameSize;
+ * ((UINT32 *) Buffer + 1) = DataSize;
+ BufferSize = RemainingSize + sizeof (NameSize) + sizeof (DataSize) - sizeof (Crc32);
+ gBS->CalculateCrc32 (
+ Buffer,
+ BufferSize,
+ &Crc32
+ );
+ if (Crc32 != * (UINT32 *) (Buffer + BufferSize)) {
+ FreePool (Buffer);
+ ShellStatus = SHELL_VOLUME_CORRUPTED;
+ break;
+ }
+
+ Position += BufferSize + sizeof (Crc32);
+
+ Variable = AllocateZeroPool (sizeof (*Variable) + NameSize + DataSize);
+ if (Variable == NULL) {
+ FreePool (Buffer);
+ ShellStatus = SHELL_OUT_OF_RESOURCES;
+ break;
+ }
+ Variable->Signature = DMP_STORE_VARIABLE_SIGNATURE;
+ Variable->Name = (CHAR16 *) (Variable + 1);
+ Variable->DataSize = DataSize;
+ Variable->Data = (UINT8 *) Variable->Name + NameSize;
+ CopyMem (Variable->Name, Buffer + sizeof (NameSize) + sizeof (DataSize), NameSize);
+ CopyMem (&Variable->Guid, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize, sizeof (EFI_GUID));
+ CopyMem (&Variable->Attributes, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID), sizeof (UINT32));
+ CopyMem (Variable->Data, Buffer + sizeof (NameSize) + sizeof (DataSize) + NameSize + sizeof (EFI_GUID) + sizeof (UINT32), DataSize);
+
+ InsertTailList (&List, &Variable->Link);
+ FreePool (Buffer);
+ }
+
+ if ((Position != FileSize) || (ShellStatus != SHELL_SUCCESS)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_BAD_FILE), gShellDebug1HiiHandle);
+ if (Position != FileSize) {
+ ShellStatus = SHELL_VOLUME_CORRUPTED;
+ }
+ }
+
+ for ( Link = GetFirstNode (&List)
+ ; !IsNull (&List, Link) && (ShellStatus == SHELL_SUCCESS)
+ ; Link = GetNextNode (&List, Link)
+ ) {
+ Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE);
+
+ if (((Name == NULL) || gUnicodeCollation->MetaiMatch (gUnicodeCollation, Variable->Name, (CHAR16 *) Name)) &&
+ ((Guid == NULL) || CompareGuid (&Variable->Guid, Guid))
+ ) {
+ Attributes = GetAttrType (Variable->Attributes);
+ ShellPrintHiiEx (
+ -1, -1, NULL, STRING_TOKEN(STR_DMPSTORE_HEADER_LINE), gShellDebug1HiiHandle,
+ Attributes, &Variable->Guid, Variable->Name, Variable->DataSize
+ );
+ SHELL_FREE_NON_NULL(Attributes);
+
+ *Found = TRUE;
+ Status = gRT->SetVariable (
+ Variable->Name,
+ &Variable->Guid,
+ Variable->Attributes,
+ Variable->DataSize,
+ Variable->Data
+ );
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD_GEN_FAIL), gShellDebug1HiiHandle, Variable->Name, Status);
+ }
+ }
+ }
+
+ for (Link = GetFirstNode (&List); !IsNull (&List, Link); ) {
+ Variable = CR (Link, DMP_STORE_VARIABLE, Link, DMP_STORE_VARIABLE_SIGNATURE);
+ Link = RemoveEntryList (&Variable->Link);
+ FreePool (Variable);
+ }
+
+ return ShellStatus;
+}
+
+/**
+ Append one variable to file.
+
+ @param[in] FileHandle The file to be appended.
+ @param[in] Name The variable name.
+ @param[in] Guid The variable GUID.
+ @param[in] Attributes The variable attributes.
+ @param[in] DataSize The variable data size.
+ @param[in] Data The variable data.
+
+ @retval EFI_OUT_OF_RESOURCES There is not enough memory to perform the operation.
+ @retval EFI_SUCCESS The variable is appended to file successfully.
+ @retval others Failed to append the variable to file.
+**/
+EFI_STATUS
+AppendSingleVariableToFile (
+ IN SHELL_FILE_HANDLE FileHandle,
+ IN CONST CHAR16 *Name,
+ IN CONST EFI_GUID *Guid,
+ IN UINT32 Attributes,
+ IN UINT32 DataSize,
+ IN CONST UINT8 *Data
+ )
+{
+ UINT32 NameSize;
+ UINT8 *Buffer;
+ UINT8 *Ptr;
+ UINTN BufferSize;
+ EFI_STATUS Status;
+
+ NameSize = (UINT32) StrSize (Name);
+ BufferSize = sizeof (NameSize) + sizeof (DataSize)
+ + sizeof (*Guid)
+ + sizeof (Attributes)
+ + NameSize + DataSize
+ + sizeof (UINT32);
+
+ Buffer = AllocatePool (BufferSize);
+ if (Buffer == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ Ptr = Buffer;
+ //
+ // NameSize and DataSize
+ //
+ * (UINT32 *) Ptr = NameSize;
+ Ptr += sizeof (NameSize);
+ *(UINT32 *) Ptr = DataSize;
+ Ptr += sizeof (DataSize);
+
+ //
+ // Name
+ //
+ CopyMem (Ptr, Name, NameSize);
+ Ptr += NameSize;
+
+ //
+ // Guid
+ //
+ CopyMem (Ptr, Guid, sizeof (*Guid));
+ Ptr += sizeof (*Guid);
+
+ //
+ // Attributes
+ //
+ * (UINT32 *) Ptr = Attributes;
+ Ptr += sizeof (Attributes);
+
+ //
+ // Data
+ //
+ CopyMem (Ptr, Data, DataSize);
+ Ptr += DataSize;
+
+ //
+ // Crc32
+ //
+ gBS->CalculateCrc32 (Buffer, (UINTN) (Ptr - Buffer), (UINT32 *) Ptr);
+
+ Status = ShellWriteFile (FileHandle, &BufferSize, Buffer);
+ FreePool (Buffer);
+
+ if (!EFI_ERROR (Status) &&
+ (BufferSize != sizeof (NameSize) + sizeof (DataSize) + sizeof (*Guid) + sizeof (Attributes) + NameSize + DataSize)
+ ) {
+ Status = EFI_DEVICE_ERROR;
+ }
+
+ return Status;
+}
+
+/**
+ Recursive function to display or delete variables.
+
+ This function will call itself to create a stack-based list of allt he variables to process,
+ then fromt he last to the first, they will do either printing or deleting.
+
+ This is necessary since once a delete happens GetNextVariableName() will work.
+
+ @param[in] Name The variable name of the EFI variable (or NULL).
@param[in] Guid The GUID of the variable set (or NULL).
- @param[in] Delete TRUE to delete, FALSE otherwise.
+ @param[in] Type The operation type.
+ @param[in] FileHandle The file to operate on (or NULL).
+ @param[in] PrevName The previous variable name from GetNextVariableName. L"" to start.
+ @param[in] FoundVarGuid The previous GUID from GetNextVariableName. ignored at start.
+ @param[in] FoundOne If a VariableName or Guid was specified and one was printed or
+ deleted, then set this to TRUE, otherwise ignored.
@retval SHELL_SUCCESS The operation was successful.
@retval SHELL_OUT_OF_RESOURCES A memorty allocation failed.
@@ -81,169 +367,203 @@ GetAttrType (
**/
SHELL_STATUS
EFIAPI
-ProcessVariables (
- IN CONST CHAR16 *VariableName OPTIONAL,
- IN CONST EFI_GUID *Guid OPTIONAL,
- IN BOOLEAN Delete
+CascadeProcessVariables (
+ IN CONST CHAR16 *Name OPTIONAL,
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN DMP_STORE_TYPE Type,
+ IN EFI_FILE_PROTOCOL *FileHandle OPTIONAL,
+ IN CONST CHAR16 * CONST PrevName,
+ IN EFI_GUID FoundVarGuid,
+ IN BOOLEAN *FoundOne
)
{
EFI_STATUS Status;
CHAR16 *FoundVarName;
- EFI_GUID FoundVarGuid;
UINT8 *DataBuffer;
UINTN DataSize;
UINT32 Atts;
SHELL_STATUS ShellStatus;
- BOOLEAN Found;
- UINTN NameBufferSize; // Allocated Name buffer size
UINTN NameSize;
- CHAR16 *OldName;
- UINTN OldNameBufferSize;
- UINTN DataBufferSize; // Allocated data buffer size
CHAR16 *RetString;
- Found = FALSE;
- ShellStatus = SHELL_SUCCESS;
- Status = EFI_SUCCESS;
-
- NameBufferSize = INIT_NAME_BUFFER_SIZE;
- DataBufferSize = INIT_DATA_BUFFER_SIZE;
- FoundVarName = AllocateZeroPool (NameBufferSize);
- if (FoundVarName == NULL) {
- return (SHELL_OUT_OF_RESOURCES);
- }
- DataBuffer = AllocatePool (DataBufferSize);
- if (DataBuffer == NULL) {
- FreePool (FoundVarName);
- return (SHELL_OUT_OF_RESOURCES);
+ if (ShellGetExecutionBreakFlag()) {
+ return (SHELL_ABORTED);
}
- for (;;){
- if (ShellGetExecutionBreakFlag()) {
- ShellStatus = SHELL_ABORTED;
- break;
- }
+ NameSize = 0;
+ FoundVarName = NULL;
- NameSize = NameBufferSize;
- Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
- if (Status == EFI_BUFFER_TOO_SMALL) {
- OldName = FoundVarName;
- OldNameBufferSize = NameBufferSize;
- //
- // Expand at least twice to avoid reallocate many times
- //
- NameBufferSize = NameSize > NameBufferSize * 2 ? NameSize : NameBufferSize * 2;
- FoundVarName = AllocateZeroPool (NameBufferSize);
- if (FoundVarName == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- FreePool (OldName);
- break;
+ if (PrevName!=NULL) {
+ StrnCatGrow(&FoundVarName, &NameSize, PrevName, 0);
+ } else {
+ FoundVarName = AllocateZeroPool(sizeof(CHAR16));
+ }
+
+ Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ SHELL_FREE_NON_NULL(FoundVarName);
+ FoundVarName = AllocateZeroPool (NameSize);
+ if (FoundVarName != NULL) {
+ if (PrevName != NULL) {
+ StrCpy(FoundVarName, PrevName);
}
- //
- // Preserve the original content to get correct iteration for GetNextVariableName() call
- //
- CopyMem (FoundVarName, OldName, OldNameBufferSize);
- FreePool (OldName);
- NameSize = NameBufferSize;
+
Status = gRT->GetNextVariableName (&NameSize, FoundVarName, &FoundVarGuid);
+ } else {
+ Status = EFI_OUT_OF_RESOURCES;
}
- if (Status == EFI_NOT_FOUND) {
- break;
- }
- ASSERT_EFI_ERROR(Status);
+ }
+ //
+ // No more is fine.
+ //
+ if (Status == EFI_NOT_FOUND) {
+ SHELL_FREE_NON_NULL(FoundVarName);
+ return (SHELL_SUCCESS);
+ } else if (EFI_ERROR(Status)) {
+ SHELL_FREE_NON_NULL(FoundVarName);
+ return (SHELL_DEVICE_ERROR);
+ }
+
+ //
+ // Recurse to the next iteration. We know "our" variable's name.
+ //
+ ShellStatus = CascadeProcessVariables(Name, Guid, Type, FileHandle, FoundVarName, FoundVarGuid, FoundOne);
+
+ //
+ // No matter what happened we process our own variable
+ // Only continue if Guid and VariableName are each either NULL or a match
+ //
+ if ( ( Name == NULL
+ || gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*) Name) )
+ && ( Guid == NULL
+ || CompareGuid(&FoundVarGuid, Guid) )
+ ) {
+ DataSize = 0;
+ DataBuffer = NULL;
//
- // Check if it matches
+ // do the print or delete
//
- if (VariableName != NULL) {
- if (!gUnicodeCollation->MetaiMatch(gUnicodeCollation, FoundVarName, (CHAR16*)VariableName)) {
- continue;
- }
- }
- if (Guid != NULL) {
- if (!CompareGuid(&FoundVarGuid, Guid)) {
- continue;
+ *FoundOne = TRUE;
+ Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
+ if (Status == EFI_BUFFER_TOO_SMALL) {
+ SHELL_FREE_NON_NULL (DataBuffer);
+ DataBuffer = AllocatePool (DataSize);
+ if (DataBuffer == NULL) {
+ Status = EFI_OUT_OF_RESOURCES;
+ } else {
+ Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
}
}
-
- DataSize = DataBufferSize;
- Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
- if (Status == EFI_BUFFER_TOO_SMALL) {
+ if ((Type == DmpStoreDisplay) || (Type == DmpStoreSave)) {
//
- // Expand at least twice to avoid reallocate many times
+ // Last error check then print this variable out.
//
- FreePool (DataBuffer);
- DataBufferSize = DataSize > DataBufferSize * 2 ? DataSize : DataBufferSize * 2;
- DataBuffer = AllocatePool (DataBufferSize);
- if (DataBuffer == NULL) {
- Status = EFI_OUT_OF_RESOURCES;
- break;
+ if (!EFI_ERROR(Status) && (DataBuffer != NULL) && (FoundVarName != NULL)) {
+ RetString = GetAttrType(Atts);
+ ShellPrintHiiEx(
+ -1,
+ -1,
+ NULL,
+ STRING_TOKEN(STR_DMPSTORE_HEADER_LINE),
+ gShellDebug1HiiHandle,
+ RetString,
+ &FoundVarGuid,
+ FoundVarName,
+ DataSize);
+ if (Type == DmpStoreDisplay) {
+ DumpHex(2, 0, DataSize, DataBuffer);
+ } else {
+ Status = AppendSingleVariableToFile (
+ FileHandle,
+ FoundVarName,
+ &FoundVarGuid,
+ Atts,
+ (UINT32) DataSize,
+ DataBuffer
+ );
+ }
+ SHELL_FREE_NON_NULL(RetString);
}
- DataSize = DataBufferSize;
- Status = gRT->GetVariable (FoundVarName, &FoundVarGuid, &Atts, &DataSize, DataBuffer);
- }
- ASSERT_EFI_ERROR(Status);
-
- //
- // do the print or delete
- //
- Found = TRUE;
- RetString = GetAttrType(Atts);
- if (!Delete) {
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DMPSTORE_HEADER_LINE),
- gShellDebug1HiiHandle,
- RetString,
- &FoundVarGuid,
- FoundVarName,
- DataSize);
- DumpHex(2, 0, DataSize, DataBuffer);
- } else {
- ShellPrintHiiEx(
+ } else if (Type == DmpStoreDelete) {
+ //
+ // We only need name to delete it...
+ //
+ ShellPrintHiiEx (
-1,
-1,
NULL,
STRING_TOKEN(STR_DMPSTORE_DELETE_LINE),
gShellDebug1HiiHandle,
&FoundVarGuid,
- FoundVarName);
- ShellPrintHiiEx(
- -1,
- -1,
- NULL,
- STRING_TOKEN(STR_DMPSTORE_DELETE_DONE),
- gShellDebug1HiiHandle,
- gRT->SetVariable(FoundVarName, &FoundVarGuid, Atts, 0, NULL));
- FoundVarName[0] = CHAR_NULL;
- }
-
- if (RetString != NULL) {
- FreePool (RetString);
+ FoundVarName,
+ gRT->SetVariable (FoundVarName, &FoundVarGuid, Atts, 0, NULL)
+ );
}
+ SHELL_FREE_NON_NULL(DataBuffer);
}
- if (FoundVarName != NULL) {
- FreePool(FoundVarName);
+ SHELL_FREE_NON_NULL(FoundVarName);
+
+ if (Status == EFI_DEVICE_ERROR) {
+ ShellStatus = SHELL_DEVICE_ERROR;
+ } else if (Status == EFI_SECURITY_VIOLATION) {
+ ShellStatus = SHELL_SECURITY_VIOLATION;
+ } else if (EFI_ERROR(Status)) {
+ ShellStatus = SHELL_NOT_READY;
}
- if (DataBuffer != NULL) {
- FreePool(DataBuffer);
+
+ return (ShellStatus);
+}
+
+/**
+ Function to display or delete variables. This will set up and call into the recursive function.
+
+ @param[in] Name The variable name of the EFI variable (or NULL).
+ @param[in] Guid The GUID of the variable set (or NULL).
+ @param[in] Type The operation type.
+ @param[in] FileHandle The file to save or load variables.
+
+ @retval SHELL_SUCCESS The operation was successful.
+ @retval SHELL_OUT_OF_RESOURCES A memorty allocation failed.
+ @retval SHELL_ABORTED The abort message was received.
+ @retval SHELL_DEVICE_ERROR UEFI Variable Services returned an error.
+ @retval SHELL_NOT_FOUND the Name/Guid pair could not be found.
+**/
+SHELL_STATUS
+EFIAPI
+ProcessVariables (
+ IN CONST CHAR16 *Name OPTIONAL,
+ IN CONST EFI_GUID *Guid OPTIONAL,
+ IN DMP_STORE_TYPE Type,
+ IN SHELL_FILE_HANDLE FileHandle OPTIONAL
+ )
+{
+ SHELL_STATUS ShellStatus;
+ BOOLEAN Found;
+ EFI_GUID FoundVarGuid;
+
+ Found = FALSE;
+ ShellStatus = SHELL_SUCCESS;
+ ZeroMem (&FoundVarGuid, sizeof(EFI_GUID));
+
+ if (Type == DmpStoreLoad) {
+ ShellStatus = LoadVariablesFromFile (FileHandle, Name, Guid, &Found);
+ } else {
+ ShellStatus = CascadeProcessVariables(Name, Guid, Type, FileHandle, NULL, FoundVarGuid, &Found);
}
+
if (!Found) {
- if (Status == EFI_OUT_OF_RESOURCES) {
+ if (ShellStatus == SHELL_OUT_OF_RESOURCES) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellDebug1HiiHandle);
- return SHELL_OUT_OF_RESOURCES;
- }
-
- if (VariableName != NULL && Guid == NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, VariableName);
- } else if (VariableName != NULL && Guid != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, Guid, VariableName);
- } else if (VariableName == NULL && Guid == NULL) {
+ return (ShellStatus);
+ } else if (Name != NULL && Guid == NULL) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_N), gShellDebug1HiiHandle, Name);
+ } else if (Name != NULL && Guid != NULL) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_GN), gShellDebug1HiiHandle, Guid, Name);
+ } else if (Name == NULL && Guid == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND), gShellDebug1HiiHandle);
- } else if (VariableName == NULL && Guid != NULL) {
+ } else if (Name == NULL && Guid != NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_NO_VAR_FOUND_G), gShellDebug1HiiHandle, Guid);
}
return (SHELL_NOT_FOUND);
@@ -253,8 +573,8 @@ ProcessVariables (
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{L"-d", TypeFlag},
- {L"-l", TypeFlag},
- {L"-s", TypeFlag},
+ {L"-l", TypeValue},
+ {L"-s", TypeValue},
{L"-all", TypeFlag},
{L"-guid", TypeValue},
{NULL, TypeMax}
@@ -273,17 +593,24 @@ ShellCommandRunDmpStore (
IN EFI_SYSTEM_TABLE *SystemTable
)
{
- EFI_STATUS Status;
- LIST_ENTRY *Package;
- CHAR16 *ProblemParam;
- SHELL_STATUS ShellStatus;
- CONST CHAR16 *Temp;
- EFI_GUID *Guid;
- EFI_GUID GuidData;
- CONST CHAR16 *VariableName;
+ EFI_STATUS Status;
+ LIST_ENTRY *Package;
+ CHAR16 *ProblemParam;
+ SHELL_STATUS ShellStatus;
+ CONST CHAR16 *GuidStr;
+ CONST CHAR16 *File;
+ EFI_GUID *Guid;
+ EFI_GUID GuidData;
+ CONST CHAR16 *Name;
+ DMP_STORE_TYPE Type;
+ SHELL_FILE_HANDLE FileHandle;
+ EFI_FILE_INFO *FileInfo;
ShellStatus = SHELL_SUCCESS;
Package = NULL;
+ FileHandle = NULL;
+ File = NULL;
+ Type = DmpStoreDisplay;
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) {
@@ -301,34 +628,121 @@ ShellCommandRunDmpStore (
} else if (ShellCommandLineGetFlag(Package, L"-all") && ShellCommandLineGetFlag(Package, L"-guid")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-all", L"-guid");
ShellStatus = SHELL_INVALID_PARAMETER;
+ } else if (ShellCommandLineGetFlag(Package, L"-s") && ShellCommandLineGetFlag(Package, L"-l")) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-l", L"-s");
+ ShellStatus = SHELL_INVALID_PARAMETER;
} else if ((ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) && ShellCommandLineGetFlag(Package, L"-d")) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_CONFLICT), gShellDebug1HiiHandle, L"-l or -s", L"-d");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
if (!ShellCommandLineGetFlag(Package, L"-all")) {
- Temp = ShellCommandLineGetValue(Package, L"-guid");
- if (Temp != NULL) {
- Status = ConvertStringToGuid(Temp, &GuidData);
+ GuidStr = ShellCommandLineGetValue(Package, L"-guid");
+ if (GuidStr != NULL) {
+ Status = ConvertStringToGuid(GuidStr, &GuidData);
if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, GuidStr);
ShellStatus = SHELL_INVALID_PARAMETER;
}
Guid = &GuidData;
} else {
Guid = &gEfiGlobalVariableGuid;
}
- VariableName = ShellCommandLineGetRawValue(Package, 1);
+ Name = ShellCommandLineGetRawValue(Package, 1);
} else {
- VariableName = NULL;
- Guid = NULL;
+ Name = NULL;
+ Guid = NULL;
}
if (ShellStatus == SHELL_SUCCESS) {
- if (ShellCommandLineGetFlag(Package, L"-s") || ShellCommandLineGetFlag(Package, L"-l")) {
- ///@todo fix this after lib ready...
- ShellPrintEx(-1, -1, L"Not implemeneted yet.\r\n");
- ShellStatus = SHELL_UNSUPPORTED;
- } else {
- ShellStatus = ProcessVariables (VariableName, Guid, ShellCommandLineGetFlag(Package, L"-d"));
+ if (ShellCommandLineGetFlag(Package, L"-s")) {
+ Type = DmpStoreSave;
+ File = ShellCommandLineGetValue(Package, L"-s");
+ if (File == NULL) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-s");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
+ if (!EFI_ERROR (Status)) {
+ //
+ // Delete existing file, but do not delete existing directory
+ //
+ FileInfo = ShellGetFileInfo (FileHandle);
+ if (FileInfo == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
+ Status = EFI_DEVICE_ERROR;
+ } else {
+ if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, File);
+ Status = EFI_INVALID_PARAMETER;
+ } else {
+ Status = ShellDeleteFile (&FileHandle);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_DELETE_FAIL), gShellDebug1HiiHandle, File);
+ }
+ }
+ FreePool (FileInfo);
+ }
+ } else if (Status == EFI_NOT_FOUND) {
+ //
+ // Good when file doesn't exist
+ //
+ Status = EFI_SUCCESS;
+ } else {
+ //
+ // Otherwise it's bad.
+ //
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
+ }
+
+ if (!EFI_ERROR (Status)) {
+ Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
+ }
+ }
+
+ if (EFI_ERROR (Status)) {
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ }
+ }
+ } else if (ShellCommandLineGetFlag(Package, L"-l")) {
+ Type = DmpStoreLoad;
+ File = ShellCommandLineGetValue(Package, L"-l");
+ if (File == NULL) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_VALUE), gShellDebug1HiiHandle, L"-l");
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ Status = ShellOpenFileByName (File, &FileHandle, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ } else {
+ FileInfo = ShellGetFileInfo (FileHandle);
+ if (FileInfo == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_OPEN_FAIL), gShellDebug1HiiHandle, File);
+ ShellStatus = SHELL_DEVICE_ERROR;
+ } else {
+ if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_IS_DIRECTORY), gShellDebug1HiiHandle, File);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ }
+ FreePool (FileInfo);
+ }
+ }
+ }
+ } else if (ShellCommandLineGetFlag(Package, L"-d")) {
+ Type = DmpStoreDelete;
+ }
+ }
+
+ if (ShellStatus == SHELL_SUCCESS) {
+ if (Type == DmpStoreSave) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_SAVE), gShellDebug1HiiHandle, File);
+ } else if (Type == DmpStoreLoad) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DMPSTORE_LOAD), gShellDebug1HiiHandle, File);
+ }
+ ShellStatus = ProcessVariables (Name, Guid, Type, FileHandle);
+ if ((Type == DmpStoreLoad) || (Type == DmpStoreSave)) {
+ ShellCloseFile (&FileHandle);
}
}
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
index e67c93f95..d07ae1721 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
@@ -2,7 +2,7 @@
Main file for Pci shell Debug1 function.
Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1499,7 +1499,8 @@ EFI_STATUS
PciExplainData (
IN PCI_CONFIG_SPACE *ConfigSpace,
IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
+ IN CONST UINT16 EnhancedDump
);
/**
@@ -1627,7 +1628,8 @@ EFI_STATUS
PciExplainCapabilityStruct (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
IN UINT64 Address,
- IN UINT8 CapPtr
+ IN UINT8 CapPtr,
+ IN CONST UINT16 EnhancedDump
);
/**
@@ -1641,7 +1643,8 @@ EFI_STATUS
PciExplainPciExpress (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
IN UINT64 Address,
- IN UINT8 CapabilityPtr
+ IN UINT8 CapabilityPtr,
+ IN CONST UINT16 EnhancedDump
);
/**
@@ -2049,6 +2052,8 @@ ShellCommandRunPci (
CHAR16 *ProblemParam;
SHELL_STATUS ShellStatus;
CONST CHAR16 *Temp;
+ UINT64 RetVal;
+ UINT16 EnhancedDump;
ShellStatus = SHELL_SUCCESS;
Status = EFI_SUCCESS;
@@ -2302,7 +2307,16 @@ ShellCommandRunPci (
Temp = ShellCommandLineGetValue(Package, L"-s");
if (Temp != NULL) {
- Segment = (UINT16) ShellStrToUintn (Temp);
+ //
+ // Input converted to hexadecimal number.
+ //
+ if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
+ Segment = (UINT16) RetVal;
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
}
//
@@ -2311,7 +2325,17 @@ ShellCommandRunPci (
//
Temp = ShellCommandLineGetRawValue(Package, 1);
if (Temp != NULL) {
- Bus = (UINT16)ShellStrToUintn(Temp);
+ //
+ // Input converted to hexadecimal number.
+ //
+ if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
+ Bus = (UINT16) RetVal;
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
if (Bus > MAX_BUS_NUMBER) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2320,7 +2344,17 @@ ShellCommandRunPci (
}
Temp = ShellCommandLineGetRawValue(Package, 2);
if (Temp != NULL) {
- Device = (UINT16) ShellStrToUintn(Temp);
+ //
+ // Input converted to hexadecimal number.
+ //
+ if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
+ Device = (UINT16) RetVal;
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
if (Device > MAX_DEVICE_NUMBER){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2330,7 +2364,17 @@ ShellCommandRunPci (
Temp = ShellCommandLineGetRawValue(Package, 3);
if (Temp != NULL) {
- Func = (UINT16) ShellStrToUintn(Temp);
+ //
+ // Input converted to hexadecimal number.
+ //
+ if (!EFI_ERROR (ShellConvertStringToUint64 (Temp, &RetVal, TRUE, TRUE))) {
+ Func = (UINT16) RetVal;
+ } else {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV_HEX), gShellDebug1HiiHandle);
+ ShellStatus = SHELL_INVALID_PARAMETER;
+ goto Done;
+ }
+
if (Func > MAX_FUNCTION_NUMBER){
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellDebug1HiiHandle, Temp);
ShellStatus = SHELL_INVALID_PARAMETER;
@@ -2414,7 +2458,15 @@ ShellCommandRunPci (
// If "-i" appears in command line, interpret data in configuration space
//
if (ExplainData) {
- Status = PciExplainData (&ConfigSpace, Address, IoDev);
+ EnhancedDump = 0;
+ if (ShellCommandLineGetFlag(Package, L"-_e")) {
+ EnhancedDump = 0xFFFF;
+ Temp = ShellCommandLineGetValue(Package, L"-_e");
+ if (Temp != NULL) {
+ EnhancedDump = (UINT16) ShellHexStrToUintn (Temp);
+ }
+ }
+ Status = PciExplainData (&ConfigSpace, Address, IoDev, EnhancedDump);
}
}
Done:
@@ -2615,7 +2667,8 @@ EFI_STATUS
PciExplainData (
IN PCI_CONFIG_SPACE *ConfigSpace,
IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
+ IN CONST UINT16 EnhancedDump
)
{
PCI_COMMON_HEADER *Common;
@@ -2773,7 +2826,7 @@ PciExplainData (
// If Status bit4 is 1, dump or explain capability structure
//
if ((Common->Status) & EFI_PCI_STATUS_CAPABILITY) {
- PciExplainCapabilityStruct (IoDev, Address, CapPtr);
+ PciExplainCapabilityStruct (IoDev, Address, CapPtr, EnhancedDump);
}
return Status;
@@ -3747,7 +3800,8 @@ EFI_STATUS
PciExplainCapabilityStruct (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
IN UINT64 Address,
- IN UINT8 CapPtr
+ IN UINT8 CapPtr,
+ IN CONST UINT16 EnhancedDump
)
{
UINT8 CapabilityPtr;
@@ -3770,7 +3824,7 @@ PciExplainCapabilityStruct (
// Explain PciExpress data
//
if (EFI_PCI_CAPABILITY_ID_PCIEXP == CapabilityID) {
- PciExplainPciExpress (IoDev, Address, CapabilityPtr);
+ PciExplainPciExpress (IoDev, Address, CapabilityPtr, EnhancedDump);
return EFI_SUCCESS;
}
//
@@ -4550,6 +4604,723 @@ ExplainPcieRootStatus (
}
/**
+ Function to interpret and print out the link control structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityLinkControl (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LINK_CONTROL),
+ gShellDebug1HiiHandle,
+ Header->RootComplexLinkCapabilities,
+ Header->RootComplexLinkControl,
+ Header->RootComplexLinkStatus
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_INTERNAL_LINK_CONTROL),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the power budgeting structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityPowerBudgeting (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_POWER),
+ gShellDebug1HiiHandle,
+ Header->DataSelect,
+ Header->Data,
+ Header->PowerBudgetCapability
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_POWER_BUDGETING),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the ACS structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityAcs (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED *Header;
+ UINT16 VectorSize;
+ UINT16 LoopCounter;
+
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED*)HeaderAddress;
+ VectorSize = 0;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ACS),
+ gShellDebug1HiiHandle,
+ Header->AcsCapability,
+ Header->AcsControl
+ );
+ if (PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_CONTROL(Header)) {
+ VectorSize = PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_GET_EGRES_VECTOR_SIZE(Header);
+ if (VectorSize == 0) {
+ VectorSize = 256;
+ }
+ for (LoopCounter = 0 ; LoopCounter * 8 < VectorSize ; LoopCounter++) {
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ACS2),
+ gShellDebug1HiiHandle,
+ LoopCounter + 1,
+ Header->EgressControlVectorArray[LoopCounter]
+ );
+ }
+ }
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ACS_EXTENDED) + (VectorSize / 8) - 1,
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the latency tolerance reporting structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityLatencyToleranceReporting (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LAT),
+ gShellDebug1HiiHandle,
+ Header->MaxSnoopLatency,
+ Header->MaxNoSnoopLatency
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_LATENCE_TOLERANCE_REPORTING),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the serial number structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilitySerialNumber (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_SN),
+ gShellDebug1HiiHandle,
+ Header->SerialNumber
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_SERIAL_NUMBER),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the RCRB structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityRcrb (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_RCRB),
+ gShellDebug1HiiHandle,
+ Header->VendorId,
+ Header->DeviceId,
+ Header->RcrbCapabilities,
+ Header->RcrbControl
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_RCRB_HEADER),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the vendor specific structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityVendorSpecific (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VENDOR_SPECIFIC*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VEN),
+ gShellDebug1HiiHandle,
+ Header->VendorSpecificHeader
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_GET_SIZE(Header),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Event Collector Endpoint Association structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityECEA (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ECEA),
+ gShellDebug1HiiHandle,
+ Header->AssociationBitmap
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the ARI structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityAri (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_ARI),
+ gShellDebug1HiiHandle,
+ Header->AriCapability,
+ Header->AriControl
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ARI_CAPABILITY),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the DPA structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityDynamicPowerAllocation (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION *Header;
+ UINT8 LinkCount;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DPA),
+ gShellDebug1HiiHandle,
+ Header->DpaCapability,
+ Header->DpaLatencyIndicator,
+ Header->DpaStatus,
+ Header->DpaControl
+ );
+ for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header) + 1 ; LinkCount++) {
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_DPA2),
+ gShellDebug1HiiHandle,
+ LinkCount+1,
+ Header->DpaPowerAllocationArray[LinkCount]
+ );
+ }
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_DYNAMIC_POWER_ALLOCATION) - 1 + PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_GET_SUBSTATE_MAX(Header),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the link declaration structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityLinkDeclaration (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION *Header;
+ UINT8 LinkCount;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR),
+ gShellDebug1HiiHandle,
+ Header->ElementSelfDescription
+ );
+
+ for (LinkCount = 0 ; LinkCount < PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header) ; LinkCount++) {
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_LINK_DECLAR2),
+ gShellDebug1HiiHandle,
+ LinkCount+1,
+ Header->LinkEntry[LinkCount]
+ );
+ }
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_LINK_DECLARATION) + (PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_GET_LINK_COUNT(Header)-1)*sizeof(UINT32),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the Advanced Error Reporting structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityAer (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_AER),
+ gShellDebug1HiiHandle,
+ Header->UncorrectableErrorStatus,
+ Header->UncorrectableErrorMask,
+ Header->UncorrectableErrorSeverity,
+ Header->CorrectableErrorStatus,
+ Header->CorrectableErrorMask,
+ Header->AdvancedErrorCapabilitiesAndControl,
+ Header->HeaderLog,
+ Header->RootErrorCommand,
+ Header->RootErrorStatus,
+ Header->ErrorSourceIdentification,
+ Header->CorrectableErrorSourceIdentification,
+ Header->TlpPrefixLog[0],
+ Header->TlpPrefixLog[1],
+ Header->TlpPrefixLog[2],
+ Header->TlpPrefixLog[3]
+ );
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_ADVANCED_ERROR_REPORTING),
+ (VOID *) (HeaderAddress)
+ );
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the multicast structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+ @param[in] PciExpressCapPtr The address of the PCIe capabilities structure.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityMulticast (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCIE_CAP_STURCTURE *PciExpressCapPtr
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_MULTICAST),
+ gShellDebug1HiiHandle,
+ Header->MultiCastCapability,
+ Header->MulticastControl,
+ Header->McBaseAddress,
+ Header->McReceiveAddress,
+ Header->McBlockAll,
+ Header->McBlockUntranslated,
+ Header->McOverlayBar
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_MULTICAST),
+ (VOID *) (HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the virtual channel and multi virtual channel structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityVirtualChannel (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY *Header;
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC *CapabilityItem;
+ UINT32 ItemCount;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VC_BASE),
+ gShellDebug1HiiHandle,
+ Header->ExtendedVcCount,
+ Header->PortVcCapability1,
+ Header->PortVcCapability2,
+ Header->VcArbTableOffset,
+ Header->PortVcControl,
+ Header->PortVcStatus
+ );
+ for (ItemCount = 0 ; ItemCount < Header->ExtendedVcCount ; ItemCount++) {
+ CapabilityItem = &Header->Capability[ItemCount];
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_VC_ITEM),
+ gShellDebug1HiiHandle,
+ ItemCount+1,
+ CapabilityItem->VcResourceCapability,
+ CapabilityItem->PortArbTableOffset,
+ CapabilityItem->VcResourceControl,
+ CapabilityItem->VcResourceStatus
+ );
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_VC) + (Header->ExtendedVcCount - 1) * sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_VIRTUAL_CHANNEL_CAPABILITY),
+ (VOID *) (HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the resizeable bar structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityResizeableBar (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR *Header;
+ UINT32 ItemCount;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR*)HeaderAddress;
+
+ for (ItemCount = 0 ; ItemCount < (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) ; ItemCount++) {
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_RESIZE_BAR),
+ gShellDebug1HiiHandle,
+ ItemCount+1,
+ Header->Capability[ItemCount].ResizableBarCapability,
+ Header->Capability[ItemCount].ResizableBarControl
+ );
+ }
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ (UINT32)GET_NUMBER_RESIZABLE_BARS(Header) * sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY),
+ (VOID *) (HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the TPH structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilityTph (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_TPH),
+ gShellDebug1HiiHandle,
+ Header->TphRequesterCapability,
+ Header->TphRequesterControl
+ );
+ DumpHex (
+ 8,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)Header->TphStTable - (UINT8*)HeadersBaseAddress),
+ GET_TPH_TABLE_SIZE(Header),
+ (VOID *)Header->TphStTable
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH) + GET_TPH_TABLE_SIZE(Header) - sizeof(UINT16),
+ (VOID *) (HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Function to interpret and print out the secondary PCIe capability structure
+
+ @param[in] HeaderAddress The Address of this capability header.
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+ @param[in] PciExpressCapPtr The address of the PCIe capabilities structure.
+**/
+EFI_STATUS
+EFIAPI
+PrintInterpretedExtendedCompatibilitySecondary (
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCIE_CAP_STURCTURE *PciExpressCapPtr
+ )
+{
+ CONST PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE *Header;
+ Header = (PCI_EXPRESS_EXTENDED_CAPABILITIES_SECONDARY_PCIE*)HeaderAddress;
+
+ ShellPrintHiiEx(
+ -1, -1, NULL,
+ STRING_TOKEN (STR_PCI_EXT_CAP_SECONDARY),
+ gShellDebug1HiiHandle,
+ Header->LinkControl3,
+ Header->LaneErrorStatus
+ );
+ DumpHex (
+ 8,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)Header->EqualizationControl - (UINT8*)HeadersBaseAddress),
+ PCIE_CAP_MAX_LINK_WIDTH(PciExpressCapPtr->LinkCap),
+ (VOID *)Header->EqualizationControl
+ );
+
+ DumpHex (
+ 4,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET + ((UINT8*)HeaderAddress - (UINT8*)HeadersBaseAddress),
+ sizeof(PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH) - sizeof(Header->EqualizationControl) + PCIE_CAP_MAX_LINK_WIDTH(PciExpressCapPtr->LinkCap),
+ (VOID *) (HeaderAddress)
+ );
+
+ return (EFI_SUCCESS);
+}
+
+/**
+ Display Pcie extended capability details
+
+ @param[in] HeadersBaseAddress The address of all the extended capability headers.
+ @param[in] HeaderAddress The address of this capability header.
+ @param[in] PciExpressCapPtr The address of the PCIe capabilities structure.
+**/
+EFI_STATUS
+EFIAPI
+PrintPciExtendedCapabilityDetails(
+ IN CONST PCI_EXP_EXT_HDR *HeadersBaseAddress,
+ IN CONST PCI_EXP_EXT_HDR *HeaderAddress,
+ IN CONST PCIE_CAP_STURCTURE *PciExpressCapPtr
+ )
+{
+ switch (HeaderAddress->CapabilityId){
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_ADVANCED_ERROR_REPORTING_ID:
+ return PrintInterpretedExtendedCompatibilityAer(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_CONTROL_ID:
+ return PrintInterpretedExtendedCompatibilityLinkControl(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_LINK_DECLARATION_ID:
+ return PrintInterpretedExtendedCompatibilityLinkDeclaration(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_SERIAL_NUMBER_ID:
+ return PrintInterpretedExtendedCompatibilitySerialNumber(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_POWER_BUDGETING_ID:
+ return PrintInterpretedExtendedCompatibilityPowerBudgeting(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_ACS_EXTENDED_ID:
+ return PrintInterpretedExtendedCompatibilityAcs(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_LATENCE_TOLERANCE_REPORTING_ID:
+ return PrintInterpretedExtendedCompatibilityLatencyToleranceReporting(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID:
+ return PrintInterpretedExtendedCompatibilityAri(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_RCRB_HEADER_ID:
+ return PrintInterpretedExtendedCompatibilityRcrb(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_VENDOR_SPECIFIC_ID:
+ return PrintInterpretedExtendedCompatibilityVendorSpecific(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_DYNAMIC_POWER_ALLOCATION_ID:
+ return PrintInterpretedExtendedCompatibilityDynamicPowerAllocation(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_ID:
+ return PrintInterpretedExtendedCompatibilityECEA(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_VIRTUAL_CHANNEL_ID:
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTI_FUNCTION_VIRTUAL_CHANNEL_ID:
+ return PrintInterpretedExtendedCompatibilityVirtualChannel(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_MULTICAST_ID:
+ //
+ // should only be present if PCIE_CAP_DEVICEPORT_TYPE(PciExpressCapPtr->PcieCapReg) == 0100b, 0101b, or 0110b
+ //
+ return PrintInterpretedExtendedCompatibilityMulticast(HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_ID:
+ return PrintInterpretedExtendedCompatibilityResizeableBar(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_TPH_ID:
+ return PrintInterpretedExtendedCompatibilityTph(HeaderAddress, HeadersBaseAddress);
+ case PCI_EXPRESS_EXTENDED_CAPABILITY_SECONDARY_PCIE_ID:
+ return PrintInterpretedExtendedCompatibilitySecondary(HeaderAddress, HeadersBaseAddress, PciExpressCapPtr);
+ default:
+ ShellPrintEx (-1, -1,
+ L"Unknown PCIe extended capability ID (%04xh). No interpretation available.\r\n",
+ HeaderAddress->CapabilityId
+ );
+ return EFI_SUCCESS;
+ };
+
+}
+
+/**
Display Pcie device structure.
@param[in] IoDev The pointer to the root pci protocol.
@@ -4560,7 +5331,8 @@ EFI_STATUS
PciExplainPciExpress (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
IN UINT64 Address,
- IN UINT8 CapabilityPtr
+ IN UINT8 CapabilityPtr,
+ IN CONST UINT16 EnhancedDump
)
{
@@ -4577,6 +5349,7 @@ PciExplainPciExpress (
UINTN Index;
UINT8 *RegAddr;
UINTN RegValue;
+ PCI_EXP_EXT_HDR *ExtHdr;
CapRegAddress = Address + CapabilityPtr;
IoDev->Pci.Read (
@@ -4663,15 +5436,15 @@ PciExplainPciExpress (
Dev = (UINT8) (RShiftU64 (Address, 16));
Func = (UINT8) (RShiftU64 (Address, 8));
- Pciex_Address = CALC_EFI_PCIEX_ADDRESS (Bus, Dev, Func, 0x100);
+ Pciex_Address = CALC_EFI_PCIEX_ADDRESS (Bus, Dev, Func, EFI_PCIE_CAPABILITY_BASE_OFFSET);
- ExtendRegSize = 0x1000 - 0x100;
+ ExtendRegSize = 0x1000 - EFI_PCIE_CAPABILITY_BASE_OFFSET;
ExRegBuffer = (UINT8 *) AllocateZeroPool (ExtendRegSize);
//
// PciRootBridgeIo protocol should support pci express extend space IO
- // (Begins at offset 0x100)
+ // (Begins at offset EFI_PCIE_CAPABILITY_BASE_OFFSET)
//
Status = IoDev->Pci.Read (
IoDev,
@@ -4680,25 +5453,47 @@ PciExplainPciExpress (
(ExtendRegSize) / sizeof (UINT32),
(VOID *) (ExRegBuffer)
);
- if (EFI_ERROR (Status)) {
- FreePool ((VOID *) ExRegBuffer);
+ if (EFI_ERROR (Status) || ExRegBuffer == NULL) {
+ SHELL_FREE_NON_NULL(ExRegBuffer);
return EFI_UNSUPPORTED;
}
- //
- // Start outputing PciEx extend space( 0xFF-0xFFF)
- //
- ShellPrintEx (-1, -1, L"\r\n%HStart dumping PCIex extended configuration space (0x100 - 0xFFF).%N\r\n\r\n");
- if (ExRegBuffer != NULL) {
+ if (EnhancedDump == 0) {
+ //
+ // Print the PciEx extend space in raw bytes ( 0xFF-0xFFF)
+ //
+ ShellPrintEx (-1, -1, L"\r\n%HStart dumping PCIex extended configuration space (0x100 - 0xFFF).%N\r\n\r\n");
+
DumpHex (
2,
- 0x100,
+ EFI_PCIE_CAPABILITY_BASE_OFFSET,
ExtendRegSize,
(VOID *) (ExRegBuffer)
- );
+ );
+ } else {
+ ExtHdr = (PCI_EXP_EXT_HDR*)ExRegBuffer;
+ while (ExtHdr->CapabilityId != 0 && ExtHdr->CapabilityVersion != 0) {
+ //
+ // Process this item
+ //
+ if (EnhancedDump == 0xFFFF || EnhancedDump == ExtHdr->CapabilityId) {
+ //
+ // Print this item
+ //
+ PrintPciExtendedCapabilityDetails((PCI_EXP_EXT_HDR*)ExRegBuffer, ExtHdr, &PciExpressCap);
+ }
- FreePool ((VOID *) ExRegBuffer);
+ //
+ // Advance to the next item if it exists
+ //
+ if (ExtHdr->NextCapabilityOffset != 0) {
+ ExtHdr = (PCI_EXP_EXT_HDR*)((UINT8*)ExRegBuffer + ExtHdr->NextCapabilityOffset);
+ } else {
+ break;
+ }
+ }
}
+ SHELL_FREE_NON_NULL(ExRegBuffer);
Done:
return EFI_SUCCESS;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
index 2dfb808c0..65d058fc4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.uni
Binary files differ
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
index 543ae376e..b91b34ffa 100644
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
+++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/Bcfg.c
@@ -48,16 +48,6 @@ typedef struct {
} BGFG_OPERATION;
/**
- Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.
-
- @param KeyOption Pointer to the EFI_KEY_OPTION structure.
-
- @return Actual number of entries in EFI_KEY_OPTION.Keys.
-**/
-#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) \
- (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))
-
-/**
Update the optional data for a boot or driver option.
If optional data exists it will be changed.
@@ -841,7 +831,7 @@ BcfgAddOptInstall1(
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellInstall1HiiHandle, Walker);
ShellStatus = SHELL_INVALID_PARAMETER;
}
- NewKeyOption.KeyData = (UINT32)Intermediate;
+ NewKeyOption.KeyData.PackedValue = (UINT32)Intermediate;
Temp = StrStr(Walker, L" ");
if (Temp != NULL) {
Walker = Temp;
@@ -856,13 +846,13 @@ BcfgAddOptInstall1(
// Now we know how many EFI_INPUT_KEY structs we need to attach to the end of the EFI_KEY_OPTION struct.
// Re-allocate with the added information.
//
- KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)), &NewKeyOption);
+ KeyOptionBuffer = AllocateCopyPool(sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount), &NewKeyOption);
if (KeyOptionBuffer == NULL) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_MEM), gShellInstall1HiiHandle);
ShellStatus = SHELL_OUT_OF_RESOURCES;
}
}
- for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption); LoopCounter++) {
+ for (LoopCounter = 0 ; ShellStatus == SHELL_SUCCESS && LoopCounter < NewKeyOption.KeyData.Options.InputKeyCount; LoopCounter++) {
//
// ScanCode
//
@@ -928,7 +918,7 @@ BcfgAddOptInstall1(
VariableName,
(EFI_GUID*)&gEfiGlobalVariableGuid,
EFI_VARIABLE_NON_VOLATILE|EFI_VARIABLE_BOOTSERVICE_ACCESS|EFI_VARIABLE_RUNTIME_ACCESS,
- sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * KEY_OPTION_INPUT_KEY_COUNT (&NewKeyOption)),
+ sizeof(EFI_KEY_OPTION) + (sizeof(EFI_INPUT_KEY) * NewKeyOption.KeyData.Options.InputKeyCount),
KeyOptionBuffer);
if (EFI_ERROR(Status)) {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_BCFG_SET_VAR_FAIL), gShellInstall1HiiHandle, VariableName, Status);
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
index f0c4a23b2..46182f714 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/For.c
@@ -270,7 +270,7 @@ ReturnUintn(
{
UINT64 RetVal;
- if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, FALSE, FALSE))) {
+ if (!EFI_ERROR(ShellConvertStringToUint64(String, &RetVal, FALSE, TRUE))) {
return ((UINTN)RetVal);
}
return ((UINTN)(-1));
@@ -370,11 +370,7 @@ ShellCommandRunFor (
gEfiShellParametersProtocol->Argv[2]) == 0) {
for (LoopVar = 0x3 ; LoopVar < gEfiShellParametersProtocol->Argc ; LoopVar++) {
ASSERT((ArgSet == NULL && ArgSize == 0) || (ArgSet != NULL));
- if (ArgSet == NULL) {
- // ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L"\"", 0);
- } else {
- ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
- }
+ ArgSet = StrnCatGrow(&ArgSet, &ArgSize, L" \"", 0);
if (StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"*") != NULL
||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"?") != NULL
||StrStr(gEfiShellParametersProtocol->Argv[LoopVar], L"[") != NULL
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
index 4d0a1563e..cc4a9d4cf 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Ls.c
@@ -393,7 +393,6 @@ PrintLsOutput(
FreePool(CorrectedPath);
ShellCloseFileMetaArg(&ListHead);
- FreePool(ListHead);
return (ShellStatus);
}
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
index 590dbf79e..9e33286c9 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
@@ -468,6 +468,9 @@ PerformSingleMappingDisplay(
}
} else {
Alias = StrnCatGrow(&Alias, 0, MapList, 0);
+ if (Alias == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
TempSpot = StrStr(Alias, CurrentName);
if (TempSpot != NULL) {
TempSpot2 = StrStr(TempSpot, L";");
@@ -484,6 +487,10 @@ PerformSingleMappingDisplay(
}
} else {
CurrentName = NULL;
+ CurrentName = StrnCatGrow(&CurrentName, 0, L"", 0);
+ if (CurrentName == NULL) {
+ return (EFI_OUT_OF_RESOURCES);
+ }
}
DevPathString = ConvertDevicePathToText(DevPath, TRUE, FALSE);
if (!SFO) {
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
index b85120b76..c1e01426f 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c
@@ -92,7 +92,6 @@ CascadeDelete(
if (!Quiet) {
Status = ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_RM_LOG_DELETE_CONF), gShellLevel2HiiHandle, Node->FullName);
Status = ShellPromptForResponse(ShellPromptResponseTypeYesNo, NULL, (VOID**)&Resp);
- ASSERT_EFI_ERROR(Status);
ASSERT(Resp != NULL);
if (EFI_ERROR(Status) || *Resp != ShellPromptResponseYes) {
SHELL_FREE_NON_NULL(Resp);
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 40b87fec3..9b5878675 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -1,7 +1,7 @@
/** @file
Provides interface to shell functionality for shell commands and applications.
- Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -1598,6 +1598,7 @@ ShellCloseFileMetaArg (
FreePool(((EFI_SHELL_FILE_INFO_NO_CONST*)Node)->Info);
FreePool((EFI_SHELL_FILE_INFO_NO_CONST*)Node);
}
+ SHELL_FREE_NON_NULL(*ListHead);
return EFI_SUCCESS;
}
@@ -3296,6 +3297,10 @@ ShellPromptForResponse (
//
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3324,6 +3329,10 @@ ShellPromptForResponse (
//
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3358,6 +3367,10 @@ ShellPromptForResponse (
//
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
if (Type == ShellPromptResponseTypeEnterContinue) {
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
@@ -3385,6 +3398,10 @@ ShellPromptForResponse (
//
*Resp = ShellPromptResponseMax;
while (*Resp == ShellPromptResponseMax) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3406,6 +3423,10 @@ ShellPromptForResponse (
ShellPrintEx(-1, -1, L"%s", Prompt);
}
while(1) {
+ if (ShellGetExecutionBreakFlag()) {
+ Status = EFI_ABORTED;
+ break;
+ }
gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &EventIndex);
Status = gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
ASSERT_EFI_ERROR(Status);
@@ -3419,6 +3440,7 @@ ShellPromptForResponse (
break;
//
// This is the location to add new prompt types.
+ // If your new type loops remember to add ExecutionBreak support.
//
default:
ASSERT(FALSE);
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
index 239cf63f6..95306e575 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugAgent.c
@@ -4,7 +4,7 @@
read/write debug packet to communication with HOST based on transfer
protocol.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -19,7 +19,7 @@
#include "Ia32/DebugException.h"
CHAR8 mErrorMsgVersionAlert[] = "\rThe SourceLevelDebugPkg you are using requires a newer version of the Intel(R) UDK Debugger Tool.\r\n";
-CHAR8 mErrorMsgSendInitPacket[] = "\rSend INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.3.1) ...\r\n";
+CHAR8 mErrorMsgSendInitPacket[] = "\rSend INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.4) ...\r\n";
CHAR8 mErrorMsgConnectOK[] = "HOST connection is successful!\r\n";
CHAR8 mErrorMsgConnectFail[] = "HOST connection is failed!\r\n";
CHAR8 mWarningMsgIngoreBreakpoint[] = "Ignore break point in SMM for SMI issued during DXE debugging!\r\n";
@@ -572,6 +572,7 @@ DebugAgentDataMsgPrint (
@retval EFI_SUCCESS Read the symbol in BreakSymbol.
@retval EFI_CRC_ERROR CRC check fail.
@retval EFI_TIMEOUT Timeout occurs when reading debug packet.
+ @retval EFI_DEVICE_ERROR Receive the old or responsed packet.
**/
EFI_STATUS
@@ -581,6 +582,8 @@ ReadRemainingBreakPacket (
)
{
UINT16 Crc;
+ DEBUG_AGENT_MAILBOX *Mailbox;
+
//
// Has received start symbol, try to read the rest part
//
@@ -599,9 +602,20 @@ ReadRemainingBreakPacket (
DebugAgentDataMsgPrint (DEBUG_AGENT_VERBOSE, FALSE, (UINT8 *)DebugHeader, DebugHeader->Length);
return EFI_CRC_ERROR;
}
-
- UpdateMailboxContent (GetMailboxPointer(), DEBUG_MAILBOX_HOST_SEQUENCE_NO_INDEX, DebugHeader->SequenceNo);
- return EFI_SUCCESS;
+ Mailbox = GetMailboxPointer();
+ if (((DebugHeader->Command & DEBUG_COMMAND_RESPONSE) == 0) &&
+ (DebugHeader->SequenceNo == (UINT8) (Mailbox->HostSequenceNo + 1))) {
+ //
+ // Only updagte HostSequenceNo for new command packet
+ //
+ UpdateMailboxContent (Mailbox, DEBUG_MAILBOX_HOST_SEQUENCE_NO_INDEX, DebugHeader->SequenceNo);
+ return EFI_SUCCESS;
+ } else {
+ //
+ // If one old command or response packet received, skip it
+ //
+ return EFI_DEVICE_ERROR;
+ }
}
/**
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
index e5a510d4b..0a3a51904 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
@@ -42,14 +42,14 @@
[Sources.Ia32]
DebugAgentCommon/Ia32/AsmFuncs.S | GCC
- DebugAgentCommon/Ia32/AsmFuncs.asm | MSFT
+ DebugAgentCommon/Ia32/AsmFuncs.asm
DebugAgentCommon/Ia32/ArchDebugSupport.h
DebugAgentCommon/Ia32/ArchDebugSupport.c
DebugAgentCommon/Ia32/DebugException.h
[Sources.X64]
DebugAgentCommon/X64/AsmFuncs.S | GCC
- DebugAgentCommon/X64/AsmFuncs.asm | MSFT
+ DebugAgentCommon/X64/AsmFuncs.asm
DebugAgentCommon/X64/ArchDebugSupport.h
DebugAgentCommon/X64/ArchDebugSupport.c
DebugAgentCommon/X64/DebugException.h
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
index 038880769..7a7ca423c 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.c
@@ -402,6 +402,7 @@ InitializeDebugAgent (
InitializeDebugTimer ();
+ Phase2Context.InitFlag = InitFlag;
Phase2Context.Context = Context;
Phase2Context.Function = Function;
DebugPortInitialize ((VOID *) &Phase2Context, InitializeDebugAgentPhase2);
@@ -487,14 +488,13 @@ InitializeDebugAgent (
// Update IDT entry to save the location saved mailbox pointer
//
SetLocationSavedMailboxPointerInIdtEntry (MailboxLocationPointer);
- //
- // Enable CPU interrupts so debug timer interrupts can be delivered
- //
- EnableInterrupts ();
-
break;
case DEBUG_AGENT_INIT_PEI:
+ if (Context == NULL) {
+ DEBUG ((EFI_D_ERROR, "DebugAgent: Input parameter Context cannot be NULL!\n"));
+ CpuDeadLoop ();
+ }
//
// Check if Debug Agent has initialized before
//
@@ -550,6 +550,7 @@ InitializeDebugAgent (
SetDebugFlag (DEBUG_AGENT_FLAG_CHECK_MAILBOX_IN_HOB, 1);
}
+ Phase2Context.InitFlag = InitFlag;
Phase2Context.Context = Context;
Phase2Context.Function = Function;
DebugPortInitialize ((VOID *) &Phase2Context, InitializeDebugAgentPhase2);
@@ -598,6 +599,9 @@ InitializeDebugAgent (
break;
}
+ //
+ // Enable CPU interrupts so debug timer interrupts can be delivered
+ //
EnableInterrupts ();
//
@@ -606,6 +610,12 @@ InitializeDebugAgent (
if (Function != NULL) {
Function (Context);
}
+ //
+ // Set return status for DEBUG_AGENT_INIT_PEI
+ //
+ if (InitFlag == DEBUG_AGENT_INIT_PEI && Context != NULL) {
+ *(EFI_STATUS *)Context = EFI_SUCCESS;
+ }
}
/**
@@ -635,7 +645,7 @@ InitializeDebugAgentPhase2 (
MailboxLocation = GetLocationSavedMailboxPointerInIdtEntry ();
Mailbox = (DEBUG_AGENT_MAILBOX *)(UINTN)(*MailboxLocation);
BufferSize = PcdGet16(PcdDebugPortHandleBufferSize);
- if (Phase2Context->Function == NULL && DebugPortHandle != NULL && BufferSize != 0) {
+ if (Phase2Context->InitFlag == DEBUG_AGENT_INIT_PEI) {
NewDebugPortHandle = (UINT64)(UINTN)AllocateCopyPool (BufferSize, DebugPortHandle);
} else {
NewDebugPortHandle = (UINT64)(UINTN)DebugPortHandle;
@@ -647,25 +657,23 @@ InitializeDebugAgentPhase2 (
//
TriggerSoftInterrupt (SYSTEM_RESET_SIGNATURE);
- //
- // If Temporary RAM region is below 128 MB, then send message to
- // host to disable low memory filtering.
- //
- SecCoreData = (EFI_SEC_PEI_HAND_OFF *)Phase2Context->Context;
- if ((UINTN)SecCoreData->TemporaryRamBase < BASE_128MB && IsHostAttached ()) {
- SetDebugFlag (DEBUG_AGENT_FLAG_MEMORY_READY, 1);
- TriggerSoftInterrupt (MEMORY_READY_SIGNATURE);
- }
-
- //
- // Enable CPU interrupts so debug timer interrupts can be delivered
- //
- EnableInterrupts ();
-
- //
- // Call continuation function if it is not NULL.
- //
- if (Phase2Context->Function != NULL) {
+ if (Phase2Context->InitFlag == DEBUG_AGENT_INIT_PREMEM_SEC) {
+ //
+ // If Temporary RAM region is below 128 MB, then send message to
+ // host to disable low memory filtering.
+ //
+ SecCoreData = (EFI_SEC_PEI_HAND_OFF *)Phase2Context->Context;
+ if ((UINTN)SecCoreData->TemporaryRamBase < BASE_128MB && IsHostAttached ()) {
+ SetDebugFlag (DEBUG_AGENT_FLAG_MEMORY_READY, 1);
+ TriggerSoftInterrupt (MEMORY_READY_SIGNATURE);
+ }
+ //
+ // Enable CPU interrupts so debug timer interrupts can be delivered
+ //
+ EnableInterrupts ();
+ //
+ // Call continuation function if it is not NULL.
+ //
Phase2Context->Function (Phase2Context->Context);
}
}
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.h b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.h
index 68bfbf7ca..a0687fa17 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.h
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgent/SecPeiDebugAgentLib.h
@@ -22,6 +22,7 @@
#include "DebugAgent.h"
typedef struct {
+ UINT32 InitFlag;
VOID *Context;
DEBUG_AGENT_CONTINUE Function;
} DEBUG_AGENT_PHASE2_CONTEXT;
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
index 5204abca5..8de4cbd9e 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
@@ -39,14 +39,14 @@
[Sources.Ia32]
DebugAgentCommon/Ia32/AsmFuncs.S | GCC
- DebugAgentCommon/Ia32/AsmFuncs.asm | MSFT
+ DebugAgentCommon/Ia32/AsmFuncs.asm
DebugAgentCommon/Ia32/ArchDebugSupport.h
DebugAgentCommon/Ia32/ArchDebugSupport.c
DebugAgentCommon/Ia32/DebugException.h
[Sources.X64]
DebugAgentCommon/X64/AsmFuncs.S | GCC
- DebugAgentCommon/X64/AsmFuncs.asm | MSFT
+ DebugAgentCommon/X64/AsmFuncs.asm
DebugAgentCommon/X64/ArchDebugSupport.h
DebugAgentCommon/X64/ArchDebugSupport.c
DebugAgentCommon/X64/DebugException.h
diff --git a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
index 2878c3189..048481eba 100644
--- a/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+++ b/SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
@@ -39,14 +39,14 @@
[Sources.Ia32]
DebugAgentCommon/Ia32/AsmFuncs.S | GCC
- DebugAgentCommon/Ia32/AsmFuncs.asm | MSFT
+ DebugAgentCommon/Ia32/AsmFuncs.asm
DebugAgentCommon/Ia32/ArchDebugSupport.h
DebugAgentCommon/Ia32/ArchDebugSupport.c
DebugAgentCommon/Ia32/DebugException.h
[Sources.X64]
DebugAgentCommon/X64/AsmFuncs.S | GCC
- DebugAgentCommon/X64/AsmFuncs.asm | MSFT
+ DebugAgentCommon/X64/AsmFuncs.asm
DebugAgentCommon/X64/ArchDebugSupport.h
DebugAgentCommon/X64/ArchDebugSupport.c
DebugAgentCommon/X64/DebugException.h
diff --git a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
index 54aaa71d7..b3dbc9367 100644
--- a/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
+++ b/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb/DebugCommunicationLibUsb.c
@@ -1,7 +1,7 @@
/** @file
Debug Port Library implementation based on usb debug port.
- Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -58,7 +58,7 @@ typedef struct _USB_DEBUG_PORT_DESCRIPTOR {
UINT8 DebugOutEndpoint;
}USB_DEBUG_PORT_DESCRIPTOR;
-USB_DEVICE_REQUEST mGetDebugDescriptor = {
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbGetDebugDescriptor = {
0x80,
USB_REQ_GET_DESCRIPTOR,
(UINT16)(0x0A << 8),
@@ -66,7 +66,7 @@ USB_DEVICE_REQUEST mGetDebugDescriptor = {
sizeof(USB_DEBUG_PORT_DESCRIPTOR)
};
-USB_DEVICE_REQUEST mSetDebugFeature = {
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbSetDebugFeature = {
0x0,
USB_REQ_SET_FEATURE,
(UINT16)(0x06),
@@ -74,7 +74,7 @@ USB_DEVICE_REQUEST mSetDebugFeature = {
0x0
};
-USB_DEVICE_REQUEST mSetDebugAddress = {
+USB_DEVICE_REQUEST mDebugCommunicationLibUsbSetDebugAddress = {
0x0,
USB_REQ_SET_ADDRESS,
(UINT16)(0x7F),
@@ -159,7 +159,7 @@ typedef struct _USB_DEBUG_PORT_HANDLE{
//
// The global variable which can be used after memory is ready.
//
-USB_DEBUG_PORT_HANDLE mUsbDebugPortHandle;
+USB_DEBUG_PORT_HANDLE mDebugCommunicationLibUsbDebugPortHandle;
/**
Check if the timer is timeout.
@@ -751,7 +751,7 @@ InitializeUsbDebugHardware (
//
// set usb debug device address as 0x7F.
//
- Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mSetDebugAddress, 0x0, 0x0, NULL, NULL);
+ Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbSetDebugAddress, 0x0, 0x0, NULL, NULL);
if (RETURN_ERROR(Status)) {
//
// The device can not work well.
@@ -768,7 +768,7 @@ InitializeUsbDebugHardware (
//
// Get debug descriptor.
//
- Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mGetDebugDescriptor, 0x7F, 0x0, (UINT8*)&UsbDebugPortDescriptor, &Length);
+ Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbGetDebugDescriptor, 0x7F, 0x0, (UINT8*)&UsbDebugPortDescriptor, &Length);
if (RETURN_ERROR(Status)) {
//
// The device is not a usb debug device.
@@ -785,7 +785,7 @@ InitializeUsbDebugHardware (
//
// enable the usb debug feature.
//
- Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mSetDebugFeature, 0x7F, 0x0, NULL, NULL);
+ Status = UsbDebugPortControlTransfer (UsbDebugPortRegister, &mDebugCommunicationLibUsbSetDebugFeature, 0x7F, 0x0, NULL, NULL);
if (RETURN_ERROR(Status)) {
//
// The device can not work well.
@@ -856,7 +856,7 @@ DebugPortReadBuffer (
// Use global variable to store handle value.
//
if (Handle == NULL) {
- UsbDebugPortHandle = &mUsbDebugPortHandle;
+ UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;
} else {
UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;
}
@@ -1028,7 +1028,7 @@ DebugPortWriteBuffer (
// Use global variable to store handle value.
//
if (Handle == NULL) {
- UsbDebugPortHandle = &mUsbDebugPortHandle;
+ UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;
} else {
UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;
}
@@ -1100,7 +1100,7 @@ DebugPortPollBuffer (
// Use global variable to store handle value.
//
if (Handle == NULL) {
- UsbDebugPortHandle = &mUsbDebugPortHandle;
+ UsbDebugPortHandle = &mDebugCommunicationLibUsbDebugPortHandle;
} else {
UsbDebugPortHandle = (USB_DEBUG_PORT_HANDLE *)Handle;
}
@@ -1210,7 +1210,8 @@ DebugPortInitialize (
USB_DEBUG_PORT_HANDLE *UsbDebugPortHandle;
UINT64 TimerStartValue;
UINT64 TimerEndValue;
- //
+
+ //
// Validate the PCD PcdDebugPortHandleBufferSize value
//
ASSERT (PcdGet16 (PcdDebugPortHandleBufferSize) == sizeof (USB_DEBUG_PORT_HANDLE));
@@ -1284,9 +1285,9 @@ Exit:
if (Function != NULL) {
Function (Context, &Handle);
} else {
- CopyMem(&mUsbDebugPortHandle, &Handle, sizeof (USB_DEBUG_PORT_HANDLE));
+ CopyMem(&mDebugCommunicationLibUsbDebugPortHandle, &Handle, sizeof (USB_DEBUG_PORT_HANDLE));
}
- return (DEBUG_PORT_HANDLE)(UINTN)&mUsbDebugPortHandle;
+ return (DEBUG_PORT_HANDLE)(UINTN)&mDebugCommunicationLibUsbDebugPortHandle;
}
diff --git a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
index fa485bcf1..9310ccfe8 100644
--- a/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
+++ b/SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
@@ -33,12 +33,12 @@
[Sources.IA32]
Ia32/IntHandlerFuncs.c
- Ia32/IntHandler.asm | MSFT
+ Ia32/IntHandler.asm
Ia32/IntHandler.S | GCC
[Sources.X64]
X64/IntHandlerFuncs.c
- X64/IntHandler.asm | MSFT
+ X64/IntHandler.asm
X64/IntHandler.S | GCC
[Packages]
diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dec b/SourceLevelDebugPkg/SourceLevelDebugPkg.dec
index 5146b9e22..2897a7146 100644
--- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dec
+++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dec
@@ -7,7 +7,7 @@
# and host, PeCoffExtraActionLib instance to report symbol path information,
# etc.
#
-# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -22,7 +22,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = SourceLevelDebugPkg
PACKAGE_GUID = DBF00C27-D8D7-443d-918B-4E85CDA1373B
- PACKAGE_VERSION = 0.85
+ PACKAGE_VERSION = 0.86
[Includes]
Include
diff --git a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
index c029c439f..a7be9ad51 100644
--- a/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
+++ b/SourceLevelDebugPkg/SourceLevelDebugPkg.dsc
@@ -2,7 +2,7 @@
#
# Source Level Debug Package.
#
-# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -22,7 +22,7 @@
[Defines]
PLATFORM_NAME = SourceLevelDebugPkg
PLATFORM_GUID = 38C85805-883F-4ee8-A854-95B966ED73AA
- PLATFORM_VERSION = 0.85
+ PLATFORM_VERSION = 0.86
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/SourceLevelDebugPkg
SUPPORTED_ARCHITECTURES = IA32|X64
diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c
index b8011951b..c7084a1a0 100644
--- a/StdLib/EfiSocketLib/Socket.c
+++ b/StdLib/EfiSocketLib/Socket.c
@@ -1825,15 +1825,7 @@ EslSocketConnect (
// Set the next state if connected
//
if ( EFI_NOT_READY != Status ) {
- if ( !EFI_ERROR ( Status )) {
- pSocket->State = SOCKET_STATE_CONNECTED;
-
- //
- // Start the receive operations
- //
- EslSocketRxStart ( pSocket->pPortList );
- }
- else {
+ if ( EFI_ERROR ( Status )) {
pSocket->State = SOCKET_STATE_BOUND;
}
}
@@ -5141,7 +5133,7 @@ EslSocketRxPoll (
<ul>
<li>::EslIp4Receive to restart the receive engine to release flow control.</li>
<li>::EslIp4RxComplete to continue the operation of the receive engine if flow control is not being applied.</li>
- <li>::EslIp4SocketIsConfigured to start the recevie engine for the new socket.</li>
+ <li>::EslIp4SocketIsConfigured to start the receive engine for the new socket.</li>
<li>::EslTcp4ListenComplete to start the recevie engine for the new socket.</li>
<li>::EslTcp4Receive to restart the receive engine to release flow control.</li>
<li>::EslTcp4RxComplete to continue the operation of the receive engine if flow control is not being applied.</li>
diff --git a/StdLib/EfiSocketLib/Tcp4.c b/StdLib/EfiSocketLib/Tcp4.c
index 4ef46283b..7ece38d52 100644
--- a/StdLib/EfiSocketLib/Tcp4.c
+++ b/StdLib/EfiSocketLib/Tcp4.c
@@ -233,6 +233,13 @@ EslTcp4ConnectComplete (
pTcp4->ConfigData.AccessPoint.RemotePort ));
//
+ // Start the receive operations
+ //
+ pSocket->bConfigured = TRUE;
+ pSocket->State = SOCKET_STATE_CONNECTED;
+ EslSocketRxStart ( pPort );
+
+ //
// Remove the rest of the ports
//
bRemovePorts = TRUE;
@@ -416,7 +423,6 @@ EslTcp4ConnectPoll (
case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT:
diff --git a/StdLib/EfiSocketLib/Tcp6.c b/StdLib/EfiSocketLib/Tcp6.c
index b2e5538da..21c4109d6 100644
--- a/StdLib/EfiSocketLib/Tcp6.c
+++ b/StdLib/EfiSocketLib/Tcp6.c
@@ -239,6 +239,13 @@ EslTcp6ConnectComplete (
pTcp6->ConfigData.AccessPoint.RemotePort ));
//
+ // Start the receive operations
+ //
+ pSocket->bConfigured = TRUE;
+ pSocket->State = SOCKET_STATE_CONNECTED;
+ EslSocketRxStart ( pPort );
+
+ //
// Remove the rest of the ports
//
bRemovePorts = TRUE;
@@ -434,7 +441,6 @@ EslTcp6ConnectPoll (
case EFI_SUCCESS:
pSocket->errno = 0;
- pSocket->bConfigured = TRUE;
break;
case EFI_TIMEOUT:
diff --git a/StdLib/LibC/Wchar/ConsDecons.c b/StdLib/LibC/Wchar/ConsDecons.c
index 534d3e3b0..03815f49c 100644
--- a/StdLib/LibC/Wchar/ConsDecons.c
+++ b/StdLib/LibC/Wchar/ConsDecons.c
@@ -5,7 +5,7 @@
two wide characters the same way as two integers of the underlying integer
type designated by wchar_t.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -19,7 +19,6 @@
#include <LibConfig.h>
-#include <errno.h>
#include <wchar.h>
/* Data initialized by the library constructor */
@@ -44,9 +43,7 @@ __wchar_construct(
ASSERT(__wchar_bitmap != NULL);
if (EFI_ERROR (Status)) {
__wchar_bitmap = NULL;
- EFIerrno = Status;
- errno = ENOMEM;
- return EFIerrno;
+ return Status;
}
return RETURN_SUCCESS;
}
diff --git a/StdLib/LibC/Wchar/Wchar.inf b/StdLib/LibC/Wchar/Wchar.inf
index 5a8823360..9a028da8b 100644
--- a/StdLib/LibC/Wchar/Wchar.inf
+++ b/StdLib/LibC/Wchar/Wchar.inf
@@ -1,7 +1,7 @@
## @file
# Standard C library: Miscelaneous implementations.
#
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2010 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -9,8 +9,6 @@
# 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]
@@ -44,7 +42,6 @@
BaseLib
BaseMemoryLib
MemoryAllocationLib
- LibC
################################################################
#
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
index 12d5e4634..1b899b302 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/CpuExceptionCommon.h
@@ -115,7 +115,7 @@ FindModuleImageBase (
/**
Display CPU information.
- @param InterruptType Exception type.
+ @param ExceptionType Exception type.
@param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
**/
VOID
@@ -155,7 +155,7 @@ InitializeCpuExceptionHandlersWorker (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
RegisterCpuInterruptHandlerWorker (
IN EFI_EXCEPTION_TYPE InterruptType,
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
index 388708676..b8bf4ebd1 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
@@ -29,13 +29,13 @@
#
[Sources.Ia32]
- Ia32/ExceptionHandlerAsm.asm |MSFT
+ Ia32/ExceptionHandlerAsm.asm
Ia32/ExceptionHandlerAsm.S |GCC
Ia32/ArchExceptionHandler.c
Ia32/ArchInterruptDefs.h
[Sources.X64]
- X64/ExceptionHandlerAsm.asm |MSFT
+ X64/ExceptionHandlerAsm.asm
X64/ExceptionHandlerAsm.S |GCC
X64/ArchExceptionHandler.c
X64/ArchInterruptDefs.h
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
index b4b844cde..c38f0e10d 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeException.c
@@ -158,7 +158,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c
index aed5cf812..daa6330f5 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeSmmCpuException.c
@@ -100,7 +100,7 @@ CommonExceptionHandler (
if (mExternalInterruptHandler[ExceptionType] != NULL) {
(mExternalInterruptHandler[ExceptionType]) (ExceptionType, SystemContext);
- } else {
+ } else if (ExceptionType < CPU_EXCEPTION_NUM) {
//
// Get Spinlock to display CPU information
//
@@ -262,14 +262,14 @@ InitializeCpuExceptionHandlersWorker (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
RegisterCpuInterruptHandlerWorker (
IN EFI_EXCEPTION_TYPE InterruptType,
IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler
)
{
- if (InterruptType < 0 || InterruptType > (EFI_EXCEPTION_TYPE)mEnabledInterruptNum ||
+ if (InterruptType < 0 || InterruptType >= (EFI_EXCEPTION_TYPE)mEnabledInterruptNum ||
mReservedVectors[InterruptType].Attribute == EFI_VECTOR_HANDOFF_DO_NOT_HOOK) {
return EFI_UNSUPPORTED;
}
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
index ba2cc6f22..a4326acd7 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Ia32/ArchExceptionHandler.c
@@ -99,7 +99,7 @@ ArchRestoreExceptionContext (
}
/**
- Dump CPU content information.
+ Display CPU information.
@param ExceptionType Exception type.
@param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
index f2e7c8125..7e94e38ae 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c
@@ -171,7 +171,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
index 159d3c61f..3d48f76ee 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLib.inf
@@ -20,7 +20,7 @@
FILE_GUID = CA4BBC99-DFC6-4234-B553-8B6586B7B113
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
- LIBRARY_CLASS = CpuExceptionHandlerLib|SEC PEIM_CORE PEIM
+ LIBRARY_CLASS = CpuExceptionHandlerLib|SEC PEI_CORE PEIM
#
# The following information is for reference only and not required by the build tools.
@@ -29,13 +29,13 @@
#
[Sources.Ia32]
- Ia32/ExceptionHandlerAsm.asm |MSFT
+ Ia32/ExceptionHandlerAsm.asm
Ia32/ExceptionHandlerAsm.S |GCC
Ia32/ArchExceptionHandler.c
Ia32/ArchInterruptDefs.h
[Sources.X64]
- X64/ExceptionHandlerAsm.asm |MSFT
+ X64/ExceptionHandlerAsm.asm
X64/ExceptionHandlerAsm.S |GCC
X64/ArchExceptionHandler.c
X64/ArchInterruptDefs.h
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
index 9fe87be8a..2fe7ac3ca 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.inf
@@ -29,13 +29,13 @@
#
[Sources.Ia32]
- Ia32/ExceptionHandlerAsm.asm |MSFT
+ Ia32/ExceptionHandlerAsm.asm
Ia32/ExceptionHandlerAsm.S |GCC
Ia32/ArchExceptionHandler.c
Ia32/ArchInterruptDefs.h
[Sources.X64]
- X64/ExceptionHandlerAsm.asm |MSFT
+ X64/ExceptionHandlerAsm.asm
X64/ExceptionHandlerAsm.S |GCC
X64/ArchExceptionHandler.c
X64/ArchInterruptDefs.h
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
index c3f4425e0..40f125026 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmException.c
@@ -89,7 +89,7 @@ InitializeCpuInterruptHandlers (
previously installed.
@retval EFI_UNSUPPORTED The interrupt specified by InterruptType is not supported,
or this function is not supported.
-*/
+**/
EFI_STATUS
EFIAPI
RegisterCpuInterruptHandler (
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
index 1af2999ac..74ad13867 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ArchExceptionHandler.c
@@ -103,7 +103,7 @@ ArchRestoreExceptionContext (
}
/**
- Dump CPU content information.
+ Display CPU information.
@param ExceptionType Exception type.
@param SystemContext Pointer to EFI_SYSTEM_CONTEXT.
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
index 6e80d848f..233dbcbcc 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.S
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------ ;
-# Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -269,15 +269,15 @@ VectorNum:
ASM_GLOBAL ASM_PFX(HookAfterStubHeaderEnd)
ASM_PFX(HookAfterStubHeaderEnd):
movq %rsp, %rax
- subq $8, %rsp
- andl $0x0fffffff0, %esp
+ andl $0x0fffffff0, %esp # make sure 16-byte aligned for exception context
+ subq $0x18, %rsp # reserve room for filling exception data later
pushq %rcx
movq 8(%rax), %rcx
pushq %rax
movabsl ASM_PFX(mErrorCodeFlag), %eax
bt %ecx, %eax
popq %rax
- jc NoErrorData
+ jnc NoErrorData
pushq (%rsp) # push additional rcx to make stack alignment
NoErrorData:
xchgq (%rsp), %rcx # restore rcx, save Exception Number in stack
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm
index f348efe4b..59bec5985 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/X64/ExceptionHandlerAsm.asm
@@ -1,5 +1,5 @@
;------------------------------------------------------------------------------ ;
-; Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>
+; Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
; 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
@@ -53,12 +53,12 @@ HookAfterStubHeaderBegin:
jmp rax
HookAfterStubHeaderEnd:
mov rax, rsp
- sub rsp, 8h
- and sp, 0fff0h
+ and sp, 0fff0h ; make sure 16-byte aligned for exception context
+ sub rsp, 18h ; reserve room for filling exception data later
push rcx
mov rcx, [rax + 8]
bt mErrorCodeFlag, ecx
- jc @F
+ jnc @F
push [rsp] ; push additional rcx to make stack alignment
@@:
xchg rcx, [rsp] ; restore rcx, save Exception Number in stack
diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
index 586c620bd..d9449bcca 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c
@@ -1,7 +1,7 @@
/** @file
MTRR setting library
- Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -808,7 +808,7 @@ GetMemoryCacheTypeFromMtrrType (
// MtrrType is MTRR_CACHE_INVALID_TYPE, that means
// no mtrr covers the range
//
- return CacheUncacheable;
+ return MtrrGetDefaultMemoryType ();
}
}
@@ -1609,6 +1609,12 @@ MtrrDebugPrintAllMtrrs (
VariableMtrrCount = GetVariableMtrrCount ();
+ Limit = BIT36 - 1;
+ AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
+ if (RegEax >= 0x80000008) {
+ AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
+ Limit = LShiftU64 (1, RegEax & 0xff) - 1;
+ }
Base = BASE_1MB;
PreviousMemoryType = MTRR_CACHE_INVALID_TYPE;
do {
@@ -1627,12 +1633,6 @@ MtrrDebugPrintAllMtrrs (
RangeBase = BASE_1MB;
NoRangeBase = BASE_1MB;
- Limit = BIT36 - 1;
- AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
- if (RegEax >= 0x80000008) {
- AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
- Limit = LShiftU64 (1, RegEax & 0xff) - 1;
- }
RangeLimit = Limit;
NoRangeLimit = Limit;
@@ -1676,7 +1676,7 @@ MtrrDebugPrintAllMtrrs (
} else {
Base = NoRangeLimit + 1;
}
- } while (Found);
+ } while (Base < Limit);
DEBUG((DEBUG_CACHE, "%016lx\n\n", Base - 1));
);
}
diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf b/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
index f46d6cb79..e635752e8 100644
--- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
+++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
@@ -1,7 +1,7 @@
## @file
# MTRR library provides API for MTRR operation
#
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
# 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
@@ -38,4 +38,5 @@
BaseMemoryLib
BaseLib
CpuLib
+ DebugLib
diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec
index b3858b19b..4a2833583 100644
--- a/UefiCpuPkg/UefiCpuPkg.dec
+++ b/UefiCpuPkg/UefiCpuPkg.dec
@@ -2,7 +2,7 @@
#
# This Package provides UEFI compatible CPU modules and libraries.
#
-# Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available under
# the terms and conditions of the BSD License which accompanies this distribution.
@@ -18,7 +18,7 @@
DEC_SPECIFICATION = 0x00010005
PACKAGE_NAME = UefiCpuPkg
PACKAGE_GUID = 2171df9b-0d39-45aa-ac37-2de190010d23
- PACKAGE_VERSION = 0.2
+ PACKAGE_VERSION = 0.3
[Includes]
Include
diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc
index fa33c1342..70d5bb032 100644
--- a/UefiCpuPkg/UefiCpuPkg.dsc
+++ b/UefiCpuPkg/UefiCpuPkg.dsc
@@ -1,7 +1,7 @@
## @file
# UefiCpuPkg Package
#
-# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -16,7 +16,7 @@
[Defines]
PLATFORM_NAME = UefiCpu
PLATFORM_GUID = a1b7be22-78b3-4260-9569-8649e8c17d49
- PLATFORM_VERSION = 0.2
+ PLATFORM_VERSION = 0.3
DSC_SPECIFICATION = 0x00010005
OUTPUT_DIRECTORY = Build/UefiCpu
SUPPORTED_ARCHITECTURES = IA32|IPF|X64
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
index e57398b50..814e29fee 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
@@ -48,6 +48,16 @@
#include <Library/LockBoxLib.h>
#include <IndustryStandard/Acpi.h>
+/**
+ This macro aligns the address of a variable with auto storage
+ duration down to CPU_STACK_ALIGNMENT.
+
+ Since the stack grows downward, the result preserves more of the
+ stack than the original address (or the same amount), not less.
+**/
+#define STACK_ALIGN_DOWN(Ptr) \
+ ((UINTN)(Ptr) & ~(UINTN)(CPU_STACK_ALIGNMENT - 1))
+
#pragma pack(1)
typedef union {
struct {
@@ -846,7 +856,7 @@ S3ResumeExecuteBootScript (
DEBUG (( EFI_D_ERROR, "PeiS3ResumeState - %x\r\n", PeiS3ResumeState));
PeiS3ResumeState->ReturnCs = 0x10;
PeiS3ResumeState->ReturnEntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)S3ResumeBootOs;
- PeiS3ResumeState->ReturnStackPointer = (EFI_PHYSICAL_ADDRESS)(UINTN)&Status;
+ PeiS3ResumeState->ReturnStackPointer = (EFI_PHYSICAL_ADDRESS)STACK_ALIGN_DOWN (&Status);
//
// Save IDT
//
@@ -1038,7 +1048,7 @@ S3RestoreConfig2 (
SmmS3ResumeState->ReturnEntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)S3ResumeExecuteBootScript;
SmmS3ResumeState->ReturnContext1 = (EFI_PHYSICAL_ADDRESS)(UINTN)AcpiS3Context;
SmmS3ResumeState->ReturnContext2 = (EFI_PHYSICAL_ADDRESS)(UINTN)EfiBootScriptExecutorVariable;
- SmmS3ResumeState->ReturnStackPointer = (EFI_PHYSICAL_ADDRESS)(UINTN)&Status;
+ SmmS3ResumeState->ReturnStackPointer = (EFI_PHYSICAL_ADDRESS)STACK_ALIGN_DOWN (&Status);
DEBUG (( EFI_D_ERROR, "SMM S3 Signature = %x\n", SmmS3ResumeState->Signature));
DEBUG (( EFI_D_ERROR, "SMM S3 Stack Base = %x\n", SmmS3ResumeState->SmmS3StackBase));
diff --git a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
index db5d66e7f..6b29d05c0 100644
--- a/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
+++ b/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf
@@ -34,11 +34,11 @@
S3Resume.c
[Sources.IA32]
- Ia32/AsmFuncs.asm | MSFT
+ Ia32/AsmFuncs.asm
Ia32/AsmFuncs.S | GCC
[Sources.X64]
- X64/AsmFuncs.asm | MSFT
+ X64/AsmFuncs.asm
X64/AsmFuncs.S | GCC
[Packages]